0
我使用具有Map的加載方法顯示頁面。 問題是頁面被加載,但在地圖div顯示灰色的屏幕。 當我刷新頁面地圖加載。我也調用文檔就緒功能的地圖功能。但沒用。顯示無刷新頁面的地圖。
我的代碼是
<div class="public-view" id="map_canvass">
<script type="text/javascript">
// OnLoad function ...
initialize();
function initialize() {
var fenway = new google.maps.LatLng(<?php echo $propertyValues->lat; ?>, <?php echo $propertyValues->lng; ?>);
var mapOptions = {
center: fenway,
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvass"), mapOptions);
var circleOptions = {
center: fenway,
map: map,
strokeColor: "#BB0A68",
strokeOpacity: 0.1,
fillColor: "#BB0A68",
fillOpacity: 0.35,
radius: 200
}
var circle = new google.maps.Circle(circleOptions);
google.maps.event.trigger(map, 'resize');
}
</script>
</div>