One of the solution is to call super method in onTap(GeoPoint p, MapView mapView). If super method have handled the event, return with true; otherwise perform as normal.
@Override public boolean onTap(GeoPoint p, MapView mapView) { // TODO Auto-generated method stub if(super.onTap(p, mapView)){ return true; } String title = "pt:" + String.valueOf(overlayItemList.size() + 1); String snippet = "geo:\n" + String.valueOf(p.getLatitudeE6()) + "\n" + String.valueOf(p.getLongitudeE6()); addItem(p, title, snippet); return true; } @Override protected boolean onTap(int index) { // TODO Auto-generated method stub //return super.onTap(index); Toast.makeText(context, "Touch on marker: \n" + overlayItemList.get(index).getTitle(), Toast.LENGTH_LONG).show(); return true; }
Next:
- Switch Activity once a marker on a MapView tapped
very good post, thanks for the enlightment
ReplyDeletePlease Reply to the following post:....Dear it is Urgent..You may also reply @ my personal
ReplyDeleteEmail: shakeelde30@gmail.com;
Sorry...post was this one to reply:
Deletehttp://learnglobally.wordpress.com/2012/05/20/start-new-activity-in-android-clicking-on-a-marker/
Please read Switch Activity once a marker on a MapView tapped.
DeleteVery good article :) but I have a question.
ReplyDeleteHow to remove that added markers pt1,2,3 and so on?
And how to move that markers? Is it possible?
Thanks!