jsf - p:gmap 不在 ah:form 标签内渲染
问题描述
添加标签时地图未呈现。当我删除标签时,地图会呈现。请协助。
<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% 高度有关。
推荐阅读
- amazon-web-services - Classic 和 Application EC2 负载均衡器之间的 HTTPS 到 HTTP 差异
- python-3.x - 我们可以使用 cx_Oracle 在 python3 中实现查询 dbms_stats.gather_table_stats 吗?如果是,那怎么办?
- spring-boot - 需要在 Spring Boot 中动态生成 url 以进行招摇
- javascript - 如何确定 jquery ajax 调用何时完成?
- sql - 将数值转换为 VARCHAR2 会引发 ORA-03113
- teradata - 如何检查 Teradata 中的列是 CASESPECIFIC 还是 NOT CASESPECIFIC
- vue.js - Vue v-model 命名最佳实践
- python - spaCy中的token和span(来自文档的切片)有什么区别?
- java - Java Spark获取kafka解析json
- ssl - WebSocket 握手:意外的响应代码:200 - React 客户端