谷歌地图默认缩放问题

时间:2017-05-02 06:45:04

标签: javascript google-maps google-maps-api-3

Google地图默认缩放问题。默认缩放级别无效。我更改了缩放值,但它没有响应。请帮我解决这个问题。先感谢您。请帮我解决这个问题。



 #map { width: 100%; height: 300px; border: 0px; padding: 0px; }

<div id="map"></div>
&#13;
root
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:1)

尝试一下..它会起作用 在脚本中:

var myCenter=new google.maps.LatLng(10.123,11.989);
var marker;

function initialize()
{
    var mapProp = {
    center:myCenter,
    zoom:5,
    mapTypeId:google.maps.MapTypeId.ROADMAP 
   };

    var map=new google.maps.Map(document.getElementById("googleMap"),mapProp);

    var marker=new google.maps.Marker({
    position:myCenter,
    animation:google.maps.Animation.BOUNCE
  });

   marker.setMap(map);
}

在html中:

 <div id="googleMap" style="width:1400px;height:620px;">