【问题标题】:gmaps primefaces problemsgmaps primefaces 问题
【发布时间】:2012-11-06 17:53:52
【问题描述】:

当我加载页面时,它会显示地图并且只显示灰色屏幕。当前显示为图像。这是我的代码:

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
xmlns:m="http://code.google.com/p/gmaps4jsf/">

<h:head>

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>

</h:head>

<h:body>


        <h1>Google Map</h1>

        <h:form>

           <f:view  contentType="text/html">    
               <p:gmap center="41.381542,2.122893" zoom="15" type="HYBIRD"
                style="width:600px;height:400px" />
           </f:view>

       </h:form> 
</h:body>

【问题讨论】:

  • 可能是您的代码中的拼写错误也出现在您的 Web 应用程序中吗?type="HYBIRD" 应该是 type="HYBRID"

标签: java primefaces jsf-1.2


【解决方案1】:

您是否尝试在外部定义 p:gmap 而没有 f:view 标签?我认为也定义了

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true" />

没有必要。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-04-26
    • 1970-01-01
    • 2018-08-03
    • 2012-02-28
    • 2014-08-06
    • 2013-11-09
    • 2011-10-28
    相关资源
    最近更新 更多