Best Way to Add Map Pins to Google Map Android

[亡魂溺海] 提交于 2019-12-01 10:43:02

问题


I have been successful at adding the pins but I need the pins to be refreshed when the user clicks on the map and provides a new location, I get an error. Keep in mind that I need this to happen in the background so that it does not affect the map interaction.

My problem is that when the user clicks on the map the list of map pins is already being updated and I get an ConcurrentModificationException error.

Basically, I have a JSONArray which has locations. I need each location to be on the map and when the new location is touched the pins are updated and the old pins are cleared.

Any suggestions on how to make this more friendly and easier. I cannot seem to get rid of the ConcurrentModificationException error.


回答1:


Here is the "the missing widget"...

  • Balloons without icons: https://github.com/jgilfelt/android-mapviewballoons#readme
  • Balloons with icons (extends Jeff Gilfelt's project): https://github.com/galex/android-mapviewballoons


来源:https://stackoverflow.com/questions/8641465/best-way-to-add-map-pins-to-google-map-android

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