@Override protected void createMapViews() { super.createMapViews(); mapView.getMapZoomControls().setZoomControlsOrientation(Orientation.VERTICAL_IN_OUT); mapView.getMapZoomControls().setZoomInResource(R.drawable.zoom_control_in); mapView.getMapZoomControls().setZoomOutResource(R.drawable.zoom_control_out); mapView.getMapZoomControls().setMarginHorizontal(getResources().getDimensionPixelOffset(R.dimen.controls_margin)); mapView.getMapZoomControls().setMarginVertical(getResources().getDimensionPixelOffset(R.dimen.controls_margin)); }
/** * Template method to create the map views. */ protected void createMapViews() { mapView = getMapView(); mapView.getModel().init(this.preferencesFacade); mapView.setClickable(true); mapView.getMapScaleBar().setVisible(true); mapView.setBuiltInZoomControls(hasZoomControls()); mapView.getMapZoomControls().setAutoHide(isZoomControlsAutoHide()); mapView.getMapZoomControls().setZoomLevelMin(getZoomLevelMin()); mapView.getMapZoomControls().setZoomLevelMax(getZoomLevelMax()); }
@Override protected void createMapViews() { super.createMapViews(); // second mapView is defined in layout this.mapView2 = (MapView) this.findViewById(R.id.mapView2); this.mapView2.getModel().init(this.preferencesFacade2); this.mapView2.setClickable(true); this.mapView2.getMapScaleBar().setVisible(true); this.mapView2.setBuiltInZoomControls(hasZoomControls()); this.mapView2.getMapZoomControls().setZoomLevelMin(getZoomLevelMin()); this.mapView2.getMapZoomControls().setZoomLevelMax(getZoomLevelMax()); initializePosition(this.mapView2.getModel().mapViewPosition); }
@TargetApi(Build.VERSION_CODES.HONEYCOMB) @Override protected void createMapViews() { mapView = getMapView(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { findViewById(R.id.rotateView).setLayerType(View.LAYER_TYPE_SOFTWARE, null); } mapView.getModel().frameBufferModel.setOverdrawFactor(1.0d); mapView.getModel().init(this.preferencesFacade); mapView.setClickable(true); // Use external scale bar mapView.getMapScaleBar().setVisible(false); MapScaleBarImpl mapScaleBar = new MapScaleBarImpl( mapView.getModel().mapViewPosition, mapView.getModel().mapViewDimension, AndroidGraphicFactory.INSTANCE, mapView.getModel().displayModel); mapScaleBar.setVisible(true); mapScaleBar.setScaleBarMode(DefaultMapScaleBar.ScaleBarMode.BOTH); mapScaleBar.setDistanceUnitAdapter(MetricUnitAdapter.INSTANCE); mapScaleBar.setSecondaryDistanceUnitAdapter(ImperialUnitAdapter.INSTANCE); MapScaleBarView mapScaleBarView = (MapScaleBarView) findViewById(R.id.mapScaleBarView); mapScaleBarView.setMapScaleBar(mapScaleBar); mapView.getModel().mapViewPosition.addObserver(mapScaleBarView); mapView.setBuiltInZoomControls(hasZoomControls()); mapView.getMapZoomControls().setZoomLevelMin(getZoomLevelMin()); mapView.getMapZoomControls().setZoomLevelMax(getZoomLevelMax()); initializePosition(mapView.getModel().mapViewPosition); }