我正在使用 GeoComplete jQuery 插件: https://github.com/ubilabs/geocomplete/blob/master/jquery.geocomplete.js
我按照这个例子初始化它,它工作得很好: http://ubilabs.github.com/geocomplete/examples/draggable.html
我希望能够访问创建的 Google map 实例以进行更多控制,例如,在标记拖动后显示 InfoWindow 等。
在 geocomplete 脚本中, map 的初始化如下:
...
this.map = new google.maps.Map(
$(this.options.map)[0],
this.options.mapOptions
);
...
我可以从脚本中访问 this.map
对象吗?
谢谢。
最佳答案
$("#selector").geocomplete('map')
....返回google.maps.Map
-实例
关于javascript - jQuery GeoComplete : How can I access the map object?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15212970/