我正在使用谷歌地图API在我的手机应用程序中显示地图。谷歌地图无法正常显示在手机上
当地图加载我得到的问题象下面这样:
地图不正确DIV加载。只显示地图的一部分。
我用下面的代码来显示地图:
HTML是:
<div id="mapOuterDiv_details" class="mapHolder">
<div id="map_details">
</div>
</div>
我加载地图中ID为 “map_details”。
我给出了div的100%宽度和100%高度。
和JavaScript代码是:
var mapOptions = {
center: new google.maps.LatLng(19.997779,73.789684),
zoom: 11,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_details"), mapOptions);
var marker = new google.maps.Marker({
position: new google.maps.LatLng(19.997779,73.789684),
map: map,
animation: google.maps.Animation.DROP
});
google.maps.event.trigger(map, 'resize');
由于提前, Tejas的
这个工作对我.... //调用调整函数加载格设置后正确加载地图 google.maps.event.addListenerOnce(地图, '空闲',函数(){ google.maps。 event.trigger(地图, '调整'); \t \t \t \t \t \t \t \t \t \t}); – 2014-09-01 07:18:22