How can I slide google map?

家住魔仙堡 提交于 2019-12-11 16:21:06

问题


I have solved my problem here

do I need getJson at all?

The map is reloaded everytime I click a place name that I made as a hyperlink. However, I don't like this kind of reloading effect, I would like the map to move, which looks like when I am dragging my mouse slowly to view a different place. That is, if I click a link of a place on my browser client (i located it as a table data displayed in <table>), the map will slide to display the new place, not reload the whole region.


回答1:


Not sure if I understand your question correctly, but, if you are not reloading your page (in which case you can't achieve this effect) you should use the panTo() method instead of setCenter() to achieve a smooth sliding effect.



来源:https://stackoverflow.com/questions/12550604/how-can-i-slide-google-map

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!