p:gmap 未在 h:form 标记内呈现
p:gmap not rendering inside a h:form tag
添加标签时地图没有呈现。当我删除标签时,地图呈现。请协助。
<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']}&callback=initMap"></script>
</h:body>
</html>
当我将样式标签中的 100% 高度更改为 600px 时,地图再次显示。问题似乎与 100% 高度有关。
添加标签时地图没有呈现。当我删除标签时,地图呈现。请协助。
<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']}&callback=initMap"></script>
</h:body>
</html>
当我将样式标签中的 100% 高度更改为 600px 时,地图再次显示。问题似乎与 100% 高度有关。