问题描述
我在这里解决了我的问题
I have solved my problem here
每当我点击一个地名作为超链接。但是,我不喜欢这种重新加载效果,我希望地图能够移动,这看起来像是我慢慢拖动鼠标以查看其他位置。也就是说,如果我点击浏览器客户端上某个地点的链接(我将它定位为显示在< table>
中的表格数据),则地图将
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.
推荐答案
不知道我是否正确理解您的问题,但是,如果你不重新加载你的页面(在这种情况下你不能达到这个效果),你应该使用 panTo()
方法而不是 setCenter()
以实现平滑的滑动效果。
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.
这篇关于我怎样才能滑动谷歌地图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!