我正在使用 Google Maps v2 API 并在 map 上放置标记。标记代表不同的东西,所以我想为每一类标记都有一个自定义的 InfoWindow 布局。问题在于覆盖每次选择标记时调用的 getInfoContents
和 getInfoWindow
将为每个标记提供相同的布局。
是否有不同的方法来执行此操作,以便我可以为不同的标记组扩充不同的布局?
最佳答案
The problem is that overriding getInfoContents and getInfoWindow, which are called each time a marker is selected, will supply the same layout for each marker.
他们当然不必这样做。您将 Marker
作为参数传递给每个方法,因此可以根据 Marker
中的信息执行不同的操作。
关于android - 不同标记的不同信息窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15230784/