0
지도에서 클릭 한 위치를 감지 할 수 있도록 onTouchEvent를 재정의합니다. 하지만 이제 내 줌 컨트롤이 사라졌습니다. 내 onTouch 이벤트 :onTouchEvent 메서드를 재정의하면 MapView 확대/축소 컨트롤이 표시되지 않습니다.
public boolean onTouchEvent(MotionEvent event, MapView mapView) {
final int action=event.getAction();
final int x=(int)event.getX();
final int y=(int)event.getY();
boolean result=false;
if (action==MotionEvent.ACTION_DOWN) {
//Log.d(TAG, "down");
result=true;
}
if (action==MotionEvent.ACTION_MOVE) {
//Log.d(TAG, "move");
result=true;
}
else if (action==MotionEvent.ACTION_UP) {
GeoPoint pt=mapView.getProjection().fromPixels(x,
y);
OverlayItem toDrop=new OverlayItem(pt, "MyLoc","Tukaj me poberite");
locations.clear();
locations.add(toDrop);
populate();
result=true;
}
return(result || super.onTouchEvent(event, mapView));
}
내가 뭘 잘못하고 있니?
로 변경해야합니다 나는 또한 그지도를 이동하지 못할 발견했다. – DixieFlatline