问题是,当我使用下面包含客户端键的代码时,enter页面会显示空的google地图,如果我调整一下浏览器的大小,地图就会出现。
我不知道是怎么回事..。有什么帮助吗。

$(document).on("pagecreate", function (event) {
initMap();
});
function initMap()
{
var map_options = {
center: new google.maps.LatLng(-16.5112321,-68.1224865),
zoom: 20,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map_canvas = document.getElementById('googleMap');
var map = new google.maps.Map(map_canvas, map_options);
}<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
<script src="https://maps.googleapis.com/maps/api/js"></script>
<div id="googleMap" style="width:100%;height:400px;"></div>
发布于 2017-03-16 20:36:44
我已经使用了标签的jQuery手机,所以解决方案是插入地图,然后TAB是活动的。答案#55是在这里找到的,https://issuetracker.google.com/issues/35818323
$( "#tabs" ).on( "tabsactivate", function( event, ui ) {
initMap();
} );https://stackoverflow.com/questions/42823800
复制相似问题