当我将其宽度设置为高于800像素的值时,我的Google地图无效。如果我将其宽度设置为小于800px或更小的任何值,它就可以工作。
检查一下:
01. 900px宽度,地图不起作用,
02. 800px,宽度图正在工作,
01.链接:www.designclime.com/demo/googleMapProblem/contact-1.html
02.链接:www.designclime.com/demo/googleMapProblem/contact-2.html
这是我的代码:
<script src="https://maps.googleapis.com/maps/api/js?key=[redacted]"></script>
<script>
var myCenter=new google.maps.LatLng(23.810332,90.412518);
function initialize()
{
var mapProp = {
center:myCenter,
scrollwheel: false,
zoom:12,
zoomControl:false,
mapTypeControl:false,
streetViewControl:false,
mapTypeId:google.maps.MapTypeId.ROADMAP
};
var map=new google.maps.Map(document.getElementById("googleMap"),mapProp);
var marker=new google.maps.Marker({
position:myCenter
});
marker.setMap(map);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>