I have an application which requires plotting two locations on google map ? One of these location will be my current location and second location is my friend's location which I have obtained.Now my problem is I'm abled to plot my friend's location on map but not abled to plot my location on same map.Can anyone tell me how to plot my location and my friend's location on same map ?
Asked
Active
Viewed 4,193 times
1
-
1Are you trying to show multiple markers ? – Nibha Jain Nov 01 '11 at 10:06
-
@ nibha : Yes,but how can I do that ? – dark_shadow Nov 01 '11 at 11:03
-
have u checked the link below..? or what problem r u getting..? you need to set mapController.animateTo(geopoint);mapController.setZoom(12); proper zoomlevel as per requirement... – Nibha Jain Nov 01 '11 at 11:10
1 Answers
9
Check this link :
http://eagle.phys.utk.edu/guidry/android/mapOverlayDemo.html
This code may help you :
MapView mapView = (MapView) findViewById(R.id.mapview);
mapView.setBuiltInZoomControls(true);
List<Overlay> mapOverlays = mapView.getOverlays();
Drawable drawable = this.getResources().getDrawable(R.drawable.icon);
HelloItemizedOverlay itemizedoverlay = new HelloItemizedOverlay(drawable,this);
GeoPoint point = new GeoPoint(30443769,-91158458);
OverlayItem overlayitem = new OverlayItem(point, "Hi!", "Second!");
GeoPoint point2 = new GeoPoint(17385812,78480667);
OverlayItem overlayitem2 = new OverlayItem(point2, "Hello!", " fisrt one!");
itemizedoverlay.addOverlay(overlayitem);
itemizedoverlay.addOverlay(overlayitem2);
mapOverlays.add(itemizedoverlay);

Nibha Jain
- 7,742
- 11
- 47
- 71
-
-
-
Hi Nibha, Can you please have a look in [this ques](http://stackoverflow.com/questions/19218081/how-to-calculate-distance-from-different-markers-in-a-map-and-then-pick-up-the-l) and suggest some solution.? – Aishvarya Jaiswal Oct 07 '13 at 09:24