Issue
I've created a MapActivity that uses MapView to place drawables on an ArrayList of points I've specified. This works great.
I want the user to be able to press each point and have a bubble appear (as when you are using Google Maps in your web browser) with some information about that point.
I can not figure out how to do this. Could someone point me to some good resources?
Solution
If you are using ItemizedOverlay
, just override onTap()
in your overlay class. Here is a sample project demonstrating this.
The relevant snippet there is:
@Override
protected boolean onTap(int i) {
Toast.makeText(NooYawk.this, items.get(i).getSnippet(),
Toast.LENGTH_SHORT).show();
return(true);
}
Instead of displaying a Toast
, you can do something else. For example, here is a sample project that displays a popup. And here's an Android library project that displays bubbles that point to the actual marker.
Answered By - CommonsWare
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.