简体   繁体   中英

gmaps primefaces problems

When I load the page, it shows the map and only shows a gray screen. Display currently as the image. This is my code:

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

Did you try to define p:gmap outside and without f:view tag? I think also defining the

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

is not necessary.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM