Prevent map from repositioning when clicking a marker (Google Map v3)

此生再无相见时 提交于 2020-01-05 06:19:45

问题


Markers open a window containing a couple paragraphs of text. When users click a marker, the map repositions itself (typically shifting the map north) to display the pop-up.

Is there a method for preventing this repositioning action?


回答1:


Set the disableAutoPan option:

infowindow.setOptions({disableAutoPan: true});

Documentation here



来源:https://stackoverflow.com/questions/14596635/prevent-map-from-repositioning-when-clicking-a-marker-google-map-v3

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