在下图中(从Polaris),您可以在MapView
的右上方看到一个“定位”ImageButton
。MapView - 点击定位按钮时停止滚动
我有一个自定义的(一个ImageView
),并处理自己的点击。
现在,当用户拖动地图,然后(在拖动过程中)单击定位按钮,它将不执行任何操作,直到地图停止移动。
我想完成的是从滚动停止地图。
这里是我试过(感谢blazzerbg):mMap.getController().stopAnimation(false);
但没有去。
我知道我有这些功能,也许他们干预?
@Override
public boolean onTouch(View view, MotionEvent event) {
// Disables multi-touch (zoom in/out)
if (event.getPointerCount() > 1) {
return true;
}
// Get the map if a drag is done
if (event.getAction() == MotionEvent.ACTION_UP) {
// ...
}
// Disables double-tap
return mGestureDetector.onTouchEvent(event);
}
private class GestureListener extends GestureDetector.SimpleOnGestureListener {
@Override
public boolean onDoubleTap(MotionEvent event) {
return true;
}
}
看来我不是唯一一个...
- Android MapView MapController stopAnimation not stopping animation
- Action after mapview (swipe) animation stops
- Android MapView: animateTo doesnt work while map is panning
奇怪这不起作用..看到我更新的问题。 – shkschneider