在Google地图中更改半径时放大圆圈内部

时间:2021-09-23 20:37:03

I have created circle in maps using Google maps API. When I change the radius of circle, the map contents inside the circle must be zoomed in. Pls let me know is der a way to zoom in the contents inside the circle when radius of circle is changed.

我使用Google maps API在地图中创建了圆圈。当我改变圆的半径时,圆内的地图内容必须放大。请让我知道当圆的半径改变时放大圆内的内容。

Thanks in advance

提前致谢

1 个解决方案

#1


0  

Use var bounds = circle.getBounds() to get the extent of your circle followed by map.fitBounds(bounds) to zoom your map.

使用var bounds = circle.getBounds()获取圆的范围,然后使用map.fitBounds(bounds)缩放地图。

#1


0  

Use var bounds = circle.getBounds() to get the extent of your circle followed by map.fitBounds(bounds) to zoom your map.

使用var bounds = circle.getBounds()获取圆的范围,然后使用map.fitBounds(bounds)缩放地图。