hi all,
I used dispatchTouchEvent on mapview,
the code is bellow:
===========================
public boolean dispatchTouchEvent(MotionEvent ev) {
// TODO Auto-generated method stub
//test
Projection p=mMapView01.getProjection();
GeoPoint g=p.fromPixels((int)ev.getX(), (int)ev.getY());
double d1=g.getLatitudeE6()/1E6;
double d2=g.getLongitudeE6()/1E6;
showDialog("lat:"+d1+"lon:"+d2); //a dialog output
return super.dispatchTouchEvent(ev);
}
============================
in fact, when I touch the mapview,
then I want to show a dialog to output the longtitude
and latitude of the position I touch,
and there are two problems...
1) when I touch the mapview, it will show the dialog **twice**,
that is there are two dialog shows.
2) when I want to move the map(by drag), then the dispatchTouchEvent
will be trigger, so I need the program to know whether *this touch*
need to
show dialog.
so why and to implement...
and I want to know if there are other methods to address
my requirement?
thanks!
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en