gmaps primefaces问题

时间:2012-11-18 18:25:05

标签: java primefaces jsf-1.2

当我加载页面时,它会显示地图并仅显示灰色屏幕。显示当前图像。请帮忙。这是我的代码。

<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>

1 个答案:

答案 0 :(得分:0)

您是否尝试在外部定义p:gmap而不使用f:view标记?我认为还定义了

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

没有必要。