Google Maps v3 fitBounds() Zoom too close for single marker

前端 未结 17 2121
别那么骄傲
别那么骄傲 2020-12-12 23:28

Is there a way to set a max zoom level for fitBounds()? My problem is that when the map is only fed one location, it zooms in as far as it can go, which really

17条回答
  •  悲&欢浪女
    2020-12-13 00:04

    var map = new google.maps.Map(document.getElementById("map"), { maxZoom: 10 });
    

    Using the MaxZoom option works best for not zooming to close on to the marks you have.

提交回复
热议问题