adrian
adrian

Reputation: 4594

iphone like annotation on android map

Inside my android map I have three overlays looking like this: enter image description

what I want is when I tap on each overlay to obtain something like an iphone callout. Something similar with what you see on the second picture, on the top of the overlay.

So: When I tap an overlay on the top of it I want to get something like in second picture...and when I click that callout I want to get to a new activity.Any idea how????? Thank you!

enter image description

EDIT:

When the user taps my overlys I've done this, the problem is that the dialog box appears on the middle of the screnn not on the top of the overlay tapped.How do I get that?

    @Override
        protected boolean onTap(int i) {

          AlertDialog.Builder dialog = new AlertDialog.Builder(NotificationsActivity.this);
          //dialog.setTitle(items.getTitle());
          dialog.setMessage(items.get(i).getSnippet());
          dialog.show();
          return true; 
        }

Upvotes: 0

Views: 2750

Answers (2)

Adil Soomro
Adil Soomro

Reputation: 37729

Here is a project MapViewBallons

download that project.. open it in Eclipse

Goto Properties and the Android section and make sure is Library check box is checked.

now Open your project properties got android section from left

and add MapViewBallonsProject as a library project.

Upvotes: 3

jtt
jtt

Reputation: 13541

Look up CustomViews and Opacity and How maps uses point on a map. ItemizedOverlay would be a good start.

An example

http://developer.android.com/resources/tutorials/views/hello-mapview.html

Upvotes: 0

Related Questions