/** * adds another mapDataStore * * @param mapDataStore the mapDataStore to add * @param useStartZoomLevel if true, use the start zoom level of this mapDataStore as the start zoom level * @param useStartPosition if true, use the start position of this mapDataStore as the start position */ public void addMapDataStore(MapDataStore mapDataStore, boolean useStartZoomLevel, boolean useStartPosition) { if (this.mapDatabases.contains(mapDataStore)) { throw new IllegalArgumentException("Duplicate map database"); } this.mapDatabases.add(mapDataStore); if (useStartZoomLevel) { this.startZoomLevel = mapDataStore.startZoomLevel(); } if (useStartPosition) { this.startPosition = mapDataStore.startPosition(); } if (null == this.boundingBox) { this.boundingBox = mapDataStore.boundingBox(); } else { this.boundingBox = this.boundingBox.extendBoundingBox(mapDataStore.boundingBox()); } }
Rectangle insideArea = this.mapDataStore.boundingBox().getPositionRelativeToTile(rendererJob.tile); if (!rendererJob.hasAlpha) { renderContext.canvasRasterer.fillOutsideAreas(renderContext.renderTheme.getMapBackgroundOutside(), insideArea);
Rectangle insideArea = this.mapDataStore.boundingBox().getPositionRelativeToTile(rendererJob.tile); if (!rendererJob.hasAlpha) { renderContext.canvasRasterer.fillOutsideAreas(renderContext.renderTheme.getMapBackgroundOutside(), insideArea);
private BoundingBox getMapBoundingBox() { Collection<Layer> values = mapsToLayers.values(); if (!values.isEmpty()) { Layer layer = values.iterator().next(); if (layer instanceof TileRendererLayer) { TileRendererLayer tileRendererLayer = (TileRendererLayer) layer; return toBoundingBox(tileRendererLayer.getMapDataStore().boundingBox()); } } return null; }
/** * adds another mapDataStore * * @param mapDataStore the mapDataStore to add * @param useStartZoomLevel if true, use the start zoom level of this mapDataStore as the start zoom level * @param useStartPosition if true, use the start position of this mapDataStore as the start position */ public void addMapDataStore(MapDataStore mapDataStore, boolean useStartZoomLevel, boolean useStartPosition) { if (this.mapDatabases.contains(mapDataStore)) { throw new IllegalArgumentException("Duplicate map database"); } this.mapDatabases.add(mapDataStore); if (useStartZoomLevel) { this.startZoomLevel = mapDataStore.startZoomLevel(); } if (useStartPosition) { this.startPosition = mapDataStore.startPosition(); } if (null == this.boundingBox) { this.boundingBox = mapDataStore.boundingBox(); } else { this.boundingBox = this.boundingBox.extendBoundingBox(mapDataStore.boundingBox()); } }
@Override protected MapPosition getInitialPosition() { int tileSize = this.mapView.getModel().displayModel.getTileSize(); byte zoomLevel = LatLongUtils.zoomForBounds(new Dimension(tileSize * 4, tileSize * 4), getMapFile().boundingBox(), tileSize); return new MapPosition(getMapFile().boundingBox().getCenterPoint(), zoomLevel); }
@Override protected MapPosition getInitialPosition() { int tileSize = this.mapView.getModel().displayModel.getTileSize(); byte zoomLevel = LatLongUtils.zoomForBounds(new Dimension(tileSize * 4, tileSize * 4), getMapFile().boundingBox(), tileSize); return new MapPosition(getMapFile().boundingBox().getCenterPoint(), zoomLevel); }
public void setMapFile(final String mapFile) { if ((mapFile == null) || (mapFile.equals(mapFile_))) return; mapFile_ = mapFile; if (mapDatabase_ != null) mapDatabase_.close(); if (theme_ != null) theme_.decrementRefCount(); mapDatabase_ = new MapFile(new File(mapFile)); InMemoryTileCache tileCache = new InMemoryTileCache(2); mapGenerator_ = new DatabaseRenderer( mapDatabase_, AndroidGraphicFactory.INSTANCE, tileCache, new TileBasedLabelStore(tileCache.getCapacityFirstLevel()), true, true, null ); mapBounds_ = mapDatabase_.boundingBox(); final GraphicFactory gf = AndroidGraphicFactory.INSTANCE; final XmlRenderTheme theme = InternalRenderTheme.OSMARENDER; theme_ = new RenderThemeFuture(gf, theme, displayModel_); new Thread(theme_).start(); zoomBounds_ = -1; }
Rectangle insideArea = this.mapDataStore.boundingBox().getPositionRelativeToTile(rendererJob.tile); if (!rendererJob.hasAlpha) { renderContext.canvasRasterer.fillOutsideAreas(renderContext.renderTheme.getMapBackgroundOutside(), insideArea);