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

前端 未结 17 2127
别那么骄傲
别那么骄傲 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-12 23:52

    u can use

    map.setOptions({
        maxZoom: [what u want],
        minZoom: [what u want]
    });
    

    this way u set the properties of the map after the map has been initialized .... u can set them as many times as u want ... but in ur case ... u can set them before fitBounds()

    good luck, rarutu

提交回复
热议问题