我编写了代码来停止在 android 中的地图上滚动。但是当 MotionEvent.ACTION_UP 发生时叠加。我该如何解决?或者我如何停止地图滚动?
@Override
public boolean onTouch(View arg0, MotionEvent arg1) {
if(arg1.getAction() == MotionEvent.ACTION_MOVE){
Drawable drawable = context.getResources().getDrawable(R.drawable.icon16);
// create and add an OverlayItem to the MyItemizedOverlay list
OverlayItem overlayItem = new OverlayItem(gPt, "", "");
itemizedOverlay = new MyItemizedOverlay(drawable,context);
itemizedOverlay.addOverlay(overlayItem);
// add the overlays to the map
mMapVw.getOverlays().clear();
mMapVw.getOverlays().add(itemizedOverlay);
return true;
}
}
return false;
}