I am trying to create an advanced version MapView.
The problem is when the extended version is defined MapView, mapview does not pan.
I implement onTouchListenerInside my own custom map view.
I also want to know if there are any methods from which I can pan the mapview.
The problem does not persist when the original version of MapView is used with the same source code.
EDIT
MyMapView Source:
public class MyMapView extends MapView{
public MyMapView(Context context, String apiKey) {
super(context, apiKey);
}
public MyMapView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public MyMapView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
if(event.getAction()==MotionEvent.ACTION_DOWN){
Log.v("MyMapView","Touched");
}
return false ;
}
}
my onCreate()fromMapActivity
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.mapper);
mMapView=(MyMapView) findViewById(R.id.mapper_map);
mMapView.setSatellite(false);
}
source
share