@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_item_detail, container, false); if (this.dummyItem != null) { this.mapView = (MapView) rootView.findViewById(R.id.mapView); this.mapView.setClickable(true); this.mapView.getMapScaleBar().setVisible(true); createLayers(); } return rootView; }
this.mMapView.getMapScaleBar().setVisible(true);
mMapView.getMapScaleBar().setVisible(true);
this.mapView2.getMapScaleBar().setVisible(false);
this.mMapView.getMapScaleBar().setVisible(true);
void changeTileSize() { Integer[] tileSizes = {256, 120, 0, 120}; if (tileSizes.length > 0) { iteration += 1; // destroy and recreate the tile caches so that old storage is // freed and a new tile cache is created based on the new tile size mapView.getLayerManager().getLayers().remove(tileRendererLayer); tileRendererLayer.onDestroy(); purgeTileCaches(); int tileSize = tileSizes[iteration % tileSizes.length]; this.mapView.getModel().displayModel.setFixedTileSize(tileSize); createTileCaches(); createLayers(); this.mapView.getMapScaleBar().redrawScaleBar(); this.mapView.getLayerManager().redrawLayers(); } }
mapView.getMapScaleBar().setVisible(true); mapView.setBuiltInZoomControls(true);
mapView.setMapScaleBar(null); } else { MapScaleBar scaleBar = mapView.getMapScaleBar(); if (scaleBar == null) { scaleBar = new DefaultMapScaleBar(mapView.getModel().mapViewPosition, mapView.getModel().mapViewDimension,
/** * 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); }