PrimeFaces 7 p:gmap不在h:form标记内呈现

问题描述 投票:0回答:1

添加标签后,地图不会呈现。当我删除标签时,地图将呈现。请协助。

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

<h:head>
    <title></title>
    <h:outputStylesheet library="css" name="base.css" />
</h:head>
<h:body>
    <h:form>
        <p:gmap
            center="#{initParam['centerLatitude']}, #{initParam['centerLongitude']}"
            zoom="#{initParam['centerZoom']}" type="map"
            style="width:100%;height:100%" model="#{mapBean.mapModel}">
            <p:ajax listener="#{mapBean.onMarkerSelect}" event="overlaySelect" />
        </p:gmap>
    </h:form>
    <script
        src="https://maps.googleapis.com/maps/api/js?key=#{initParam['googleApiKey']}&amp;callback=initMap"></script>
</h:body>
</html>
jsf primefaces
1个回答
0
投票

当我从样式标签中的100%高度更改为600px时,地图再次显示。问题似乎是100%的高度。

© www.soinside.com 2019 - 2024. All rights reserved.