我已经搜索了如何在点击地图时获取位置的坐标。但是,大多数(如果不是全部)示例都需要 aMapView
作为参数。例如:
public boolean onTap(GeoPoint p, MapView map){
if ( isPinch ){
return false;
}else{
Log.i(TAG,"TAP!");
if ( p!=null ){
handleGeoPoint(p);
return true; // We handled the tap
}else{
return false; // Null GeoPoint
}
}
}
@Override
public boolean onTouchEvent(MotionEvent e, MapView mapView)
{
int fingers = e.getPointerCount();
if( e.getAction()==MotionEvent.ACTION_DOWN ){
isPinch=false; // Touch DOWN, don't know if it's a pinch yet
}
if( e.getAction()==MotionEvent.ACTION_MOVE && fingers==2 ){
isPinch=true; // Two fingers, def a pinch
}
return super.onTouchEvent(e,mapView);
}
MapFragment
因此,我如何使用和不获取地图上点击位置的位置MapView
?