Google Maps v3: Enforcing min. zoom level when using fitBounds

前端 未结 8 2077
攒了一身酷
攒了一身酷 2020-12-12 15:02

I\'m drawing a series of markers on a map (using v3 of the maps api).

In v2, I had the following code:

  bounds = new GLatLngBounds();

  ... loop th         


        
8条回答
  •  旧时难觅i
    2020-12-12 15:27

    When you call map.fitBounds() on one item - the map may zoom in too closely. To fix this, simply add 'maxZoom' to mapOptions...

    var mapOptions = {
      maxZoom: 15
    };
    

提交回复
热议问题