How do I pass custom data to Google Maps v2 InfoWindowAdapter?

我的未来我决定 提交于 2019-12-10 13:37:04

问题


I am trying to take advantage of an InfoWindowAdapter to provide custom content for the InfoView. I'm pulling down a JSONArray from my web service and adding the Markers but I'm not seeing how to pass the detail to the call back via a Marker.

  @Override
    public View getInfoWindow(Marker marker) 

In the Javascript API I was able to just set arbitrary marker info. I want to be able to pass info that can be used as conditionals for the custom content, example a marker.status string. So something other than title etc. The view will need a number of custom fields I need to pass in.


回答1:


perhaps try adding your info or object to the marker as explained here: http://bon-app-etit.blogspot.be/2012/12/add-informationobject-to-marker-in.html

Edit: I also made a post that continues the previous to use the InfoWindowAdapter. Check it out here!



来源:https://stackoverflow.com/questions/14034792/how-do-i-pass-custom-data-to-google-maps-v2-infowindowadapter

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