1

I want to give my users oppertinty to choose destination. from the beginning it will already have a point on the map, and after that they can choose/change to another location if they want..

how is it possible to change the point on the map, by clicking somewhere else on the map?

Troj
  • 11,781
  • 12
  • 40
  • 49

2 Answers2

2

I assume you're talking about a MapView within your application, and not in the Google Maps app. There's a method on a MapView called onTouchEvent(). This callback will be called when a user clicks (or touches) on the map, and you can read the location of the touch from the MotionEvent object that's passed in. From there you can decide what you want to do.

Another way is to extend the Overlay class, and add it to your MapView's Overlay list. Overlay has a method called onTap(), which gives you the GeoPoint where the touch took place. You can then animate to that spot using the MapController to center the map on that spot.

If all you want to do is pan the map sideways, a user can simply touch and drag the map.

For these things to work the MapView must be clickable (settable in XML or with code).

The relevant reference pages are here: URL to Android Maps API

Dave MacLean
  • 5,163
  • 2
  • 22
  • 31
  • thanks I was refering to MapView, and u answerd correct,, I will try to apply this. – Troj Nov 04 '10 at 01:32
0

i think this tutorial is perfect one. You should read carefully content of source code. That's all what u need to do.