How to affect the “grace margin” of map.fitBounds()

后端 未结 2 1852
说谎
说谎 2020-12-10 11:57

In Google maps API v2, map of our country was nicely fitted to 700x400px map with the following:

map.getBoundsZoomLevel()
         


        
2条回答
  •  春和景丽
    2020-12-10 12:08

    Now, the method fitBounds has a second parameter that represents the size of the padding. For those who want to remove it, you just need to pass 0.

    Map.map.fitBounds(bounds, 0);
    
    
    New method signature: fitBounds(bounds:LatLngBounds|LatLngBoundsLiteral, padding?:number)
    

提交回复
热议问题