deucalion0
deucalion0

Reputation: 2440

Is it possible to add a map marker by touching the map in Android V2 maps API?

I just want to touch the screen, use a listener to detect and add a marker at the location touched and allow the user to add written information to the marker. I done this a while back using the now deprecated API, after a long time searching SO, all I see on markers and V2 API is how to animate, add custom markers, or shadows, all beyond what I need to know. I read through the documentation at Google for a good while and got lost.

It seems that basic stuff is hard to find. I would just like to know if this is possible, and a few pointers on how it is different in V2.

Thank you!

Upvotes: 0

Views: 459

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006554

I would just like to know if this is possible

I don't see why not.

and a few pointers on how it is different in V2

Implement an OnMapClickListener and attach it to your GoogleMap via setOnMapClickListener(). Your onMapClick() method will be called when the user taps on the map. There, add a new marker. AFAIK, this should work just fine.

Upvotes: 5

Related Questions