简体   繁体   English

PrimeFaces Gmap不显示

[英]PrimeFaces Gmap does not show

I want to use primefaces gmap, and my xhtml file is something like this: 我想使用primefaces gmap,而我的xhtml文件是这样的:

<ui:fragment 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">
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript" ></script>
<p:dataGrid id="list" var="l" value="#{bean.list}" columns="1" style="width:100%">
    <h:form>
        <f:view contentType="text/html">
            <p:gmap center="41.381542,2.122893" zoom="15" type="HYBRID" style="width:100%;height:400px"/>
        </f:view>
    </h:form>
    <p:fieldset collapsed="true" toggleable="true" toggleSpeed="500" legend="#{l.username}"
                style="text-align:left">
        <h:panelGrid columns="2" style="width:100%">
            .
            .
            .
            .
        </h:panelGrid>
    </p:fieldset>
</p:dataGrid>

but the map does not show, what is the problem? 但是地图没有显示,这是什么问题? how can I solve it? 我该如何解决?

Instead of ui:fragment I use 我用的不是ui:fragment

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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