获取Google Map上的所有infoWindows [英] Get all infoWindows on a Google Map

查看:126
本文介绍了获取Google Map上的所有infoWindows的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用DirectionService绘制多个路线的地图上,并且路线上的每个标记都有一个infoWindow。

不必跟踪哪个infoWindow绑定到哪个标记,有没有办法让我抓住地图上的所有infoWindows?

解决方案

有没有办法做到你想要的。

地图不知道它具有什么标记或者这些标记具有什么信息。标记知道他们属于哪个地图,但就是这样。所以不幸的是,如果你想在创建后使用它们,你将不得不跟踪你的标记和infowindows。


I am working on a map where I neet to plot multiple routes using the DirectionService, and each marker on the route has an infoWindow.
Instead of having to keep track of which infoWindow binds to which marker, is there a way for me to grab all infoWindows on a map?

解决方案

There are no way to do what you want.

The map does not know what markers it have or what infowindows those markers have. The Markers know what map they belong to, but that is it. So unfortunatly you will have to keep track of your markers and infowindows if you want to use them after they are created.

这篇关于获取Google Map上的所有infoWindows的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆