JavaScript谷歌地图setcenter和setzoom与动画 [英] javascript google map setcenter and setzoom with animation
问题描述
我在javascript中使用google map api,我需要通过来自restful service的值来改变缩放和居中,我可以用setCenter和setZoom函数来实现。
但问题是,地图重新加载,我的老板希望它通过动画来关注那个位置,而不是通过重新加载地图是否有这样做?
方法 setCenter
重新加载地图。如果没有进行充值并有动画,请使用 panTo
方法: Map.panTo Developers Documentation
I am using google map api in javascript, i need to change zoom and center by the value coming from restful service and i can do that with setCenter and setZoom functions.
But the problem is that, map is reloading and my boss want it to focus that location with an animation not by reloading map is there anyway for doing so?
The method setCenter
reload the map. For not having the recharge and have an animation, use the panTo
method: Map.panTo Developers Documentation
这篇关于JavaScript谷歌地图setcenter和setzoom与动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!