显示地图与多个位置 [英] Display Maps with multiple locations

查看:357
本文介绍了显示地图与多个位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发在Android中一个银行应用中,我需要显示其在信所有分支的位置说A,B,C ...,N在谷歌地图。这些位置是动态的,需要在服务器检索位置设置它们的飞行。请把你的指针就如何实现多个位置上的谷歌地图显示。

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 先在你的应用程序集成地图,你可以使用这个博客帖子指南这样做的:

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

谷歌地图API V2指南

2 下一步,你将需要得到你想从某种Web服务的展示和解析成对象,如果您收到此数据的JSON,您可以使用本指南来解析这这些点数据转换成某种阵列/列表。

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解析

3 那么你应该去在这个阵列/列表并使用下列code把所有的标志物有塔图:

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)));

这篇关于显示地图与多个位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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