0

I have made a sample Android application that displays a Google map using phonegap. I want to get the location of the place that was touched on the map. Is there any method for that?

J. Steen
  • 15,470
  • 15
  • 56
  • 63
Dinesh Subedi
  • 2,603
  • 1
  • 26
  • 36

1 Answers1

0

Its solution for Android MapView, but I'm sure that you have similar method in PhoneGap.
I think you need to extend Overlay class and override OnTap method.

@Override
public boolean onTap(GeoPoint p,MapView mapView){
Log.d("TOUCHED_PLACE", "Latitutde:"+p.getLatitudeE6()/1E6 + " Longitude:"+p.getLongitude()/1E6);

}

More info: https://developers.google.com/maps/documentation/android/reference/com/google/android/maps/Overlay#onTap%28com.google.android.maps.GeoPoint,%20com.google.android.maps.MapView%29

:)

Peter Moskala
  • 360
  • 1
  • 9