问题
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