-1
首先,我想明確說明此處找到的解決方案尚未解決。Google地圖未加載完整
我試圖用簡單的谷歌地圖顯示模式警報。 更多的谷歌地圖無法加載全:
我的.js:
var map;
function initialize() {
var mapOptions = {
zoom : 8,
center : new google.maps.LatLng(-34.397, 150.644),
mapTypeId : google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
}
google.maps.event.addDomListener(window, 'load', initialize);
function showModal() {
$('#myModal').foundation('reveal', 'open');
}
HTML:
<div id="myModal" class="reveal-modal">
<div id="map-canvas"></div>
<a class="close-reveal-modal">×</a>
</div>
我做測試用:
google.maps.event.trigger(map, 'resize');
和:
$('#map-canvas').gmap().triggerEvent('resize');
沒有什麼工作。誰能幫忙?謝謝!