开发者

How to use built-in google map application to display many place markers based on data

I am working on an android application where i need to show many offices of an organization on map. I am using web service to bring this data and populate place markers on map. I have used MapActivity , MapView and Itemized overlays and its all working good.

The disadvantage of this approach is that i don't get additional useful menu options which comes when i use map inbuilt application. I know how to invoke and use Intent to launch goggle maps from application but facing some constraints regarding adding multiple markers using my location's data. I use following code to add a place marker on specific latitude and longitude.

 Intent searchAddress = new Intent(Intent.ACTION_VIEW,
                    Uri.parse("geo:0,0?q=48.19858,16.37164 (My Place)"));
 startActivity(searchAddress);

I have more than once location data (latitude , longitude and description) which i need to add as place marker or pin on the map. GEO URI scheme used to invoke maps inbuilt app doesn't give enough flexibility to add more than one marker.following are possible geo URIs.

a) geo:latitude,longitude
b) geo:latitude,longitude?z=zoom
c) geo:0,0?q=my+street+address
d) geo:0,0?q=business+near+city
  1. None of these URI schemes allows me to add more than once location pin or marker on the map. Can anybody share their experience on how they added multiple place markers on invoked inbuilt ma开发者_如何转开发p application using application data ?

  2. Is is true that MapActivity is the more efficient solution for such situations ? I believe it would be better to use inbuilt apps allowing more options to user of android and flexibility.


The built in maps application will not display more than one location. You need to use a MapView in your application and add them locations to your overlay. Here is an example of how to add markers to a map view.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜