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>

4

1 に答える 1

0

p:gmap を外部で f:view タグなしで定義しようとしましたか? も定義すると思います

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

は必要ありません。

于 2012-12-04T10:53:42.043 に答える