Display Maps with multiple locations

 ̄綄美尐妖づ 提交于 2020-03-05 05:27:21

问题


I am developing a bank applications in android, where i need to display the locations of all its branches in letters say A, B, C..., N in google maps. These locations are dynamic and need to set them on the fly when the server retrieves the locations. Please put your pointers on how to achieve the multiple locations display on google maps.


回答1:


Pointers:

1. First integrate a map in you application, you can use this blog post guide to do so:

Google Maps API V2 Guide

2. Next you will need to receive those point you want to display from some kind of web service and parse into objects, if you receive this data a JSON you can use this guide to parse this data into some kind of Array/List.

JSON Parsing

3. then you should go over this Array/List and put all the markers in there on tha map using the following code:

Marker melbourne = mMap.addMarker(new MarkerOptions()
                      .position(new LatLng(-37.81319, 144.96298))
                      .title("Melbourne")
                      .snippet("Population: 4,137,400")
                      .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_AZURE)));


来源:https://stackoverflow.com/questions/17948161/display-maps-with-multiple-locations

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