I am doing mathematical calculations in the activity of an Android map, and I need to find the GeoPoint position that the user clicked on the map. I understand that I need to use the onTouch event handler. Here's what it looks like at the moment:
@Override
public boolean onTouch(View v, MotionEvent event) {
int action = event.getAction();
if(action == MotionEvent.ACTION_DOWN)
{
GeoPoint pGoal = mapView.getProjection().fromPixels(
(int) event.getX(),
(int) event.getY());
DisplayInfoMessage("The screen has been touched!" + event.getX() + " AND " + event.getY() + "Latitude: "+ pGoal.getLatitudeE6());
}
super.onTouchEvent(event);
return true;
}
However, he does not do what I want. Any help or hint is at least greatly appreciated!
Pavel source
share