Now I can show the map and markers that are defined in the program, but I need to add markers to touched location.
I think I know the way to do this, which is:
1 To set something like onTouchEventListener to the MapView;
2 Get the position information from Listener;
3 Set the marker according to the position information.
But I am too new to this to find out how to write code to achieve it, especially the step 1. I mean I don't understand how to use the solution like Add marker on touched location using google map in Android .My problem is more fundamental. I dont know how to set eventListener for my MapView and which eventListener should I use. https://developer.mapquest.com/content/mobile/android/documentation/api/com/mapquest/android/maps/Overlay.OverlayTouchEventListener.html This OverlayTouchEventListener seems to be the one but cant find an useful guide for it.
So could some one tell me how to do this in detail?
Eg.How to set the listener and which listener to choose?
Try this...
1. Create interface MyGeoPointListener.java
2. Create Overlay class:
3. Implement MyGeoPointListener in activity
like,
public class MainActivity extends MapActivity implements MyGeoPointListener {
4. Override MyGeoPointListener:
5. In OnCreate()
6. Result: