약 1 년 반 동안이 겉으로보기에는 간단한 문제가 해결되었습니다. MapView가 정상적으로 작동하며 기본 줌 키를 표시하고 항상 기본 위치에두고 싶습니다. 그들은 전혀 출현하지 않습니다 - 그들이 떠나는 것처럼 보이지는 않습니다.MapView에 표시 할 줌 버튼을 얻을 수 없습니다.
코드 :
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
_altDisplay = (TextView) findViewById(R.id.altitudeDisplay);
_speedDisplay = (TextView) findViewById(R.id.speedDisplay);
_accuracyDisplay = (TextView) findViewById(R.id.accuracyDisplay);
_mapView = (MapView) findViewById(R.id.mapView);
_mapView.setBuiltInZoomControls(true);
_mapController = _mapView.getController();
_mapController.setZoom(22);
_locationUpdates = new LocationUpdateHandler((LocationManager) getSystemService(Context.LOCATION_SERVICE));
_locationUpdates.addObserver(this);
}
public void updateLocation(GeoPoint point, double altitude, float speed, float accuracy)
{
_mapController.setCenter(point);
_altDisplay.setText("Altitude: " + Double.toString(altitude));
_speedDisplay.setText("Speed: " + Float.toString(speed));
_accuracyDisplay.setText("Accuracy: " + Float.toString(accuracy));
}
나는 setZoom을 주석 시도하고 updateLocation 방법에 setBuiltInZoom 컨트롤을 이동했습니다. 이 문제와 관련하여 많은 게시물을 찾았지만 해결할 수있는 것은 없습니다.
도움 주셔서 감사합니다.
그 코드는 나에게 맞는 것 같습니다. XML에있는 코드일까요? 게시를 시도하면 우리가 볼 수 있습니다. –