/** * @return the start zoom level (may be null). */ public Byte getStartZoomLevel() { if (this.mapDataStore != null && null != this.mapDataStore.startZoomLevel()) { return this.mapDataStore.startZoomLevel(); } return DEFAULT_START_ZOOM_LEVEL; }
/** * 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()); } }
/** * @return the start zoom level (may be null). */ public Byte getStartZoomLevel() { if (this.mapDataStore != null && null != this.mapDataStore.startZoomLevel()) { return this.mapDataStore.startZoomLevel(); } return DEFAULT_START_ZOOM_LEVEL; }
/** * 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()); } }
/** * Extracts the initial position from the map file, falling back onto the value supplied * by getDefaultInitialPosition if there is no initial position coded into the map file. * You will only need to override this method if you do not want the initial position extracted * from the map file. * * @return the initial position encoded in the map file or a fallback value. */ protected MapPosition getInitialPosition() { MapDataStore mapFile = getMapFile(); if (mapFile.startPosition() != null) { Byte startZoomLevel = mapFile.startZoomLevel(); if (startZoomLevel == null) { // it is actually possible to have no start zoom level in the file startZoomLevel = new Byte((byte) 12); } return new MapPosition(mapFile.startPosition(), startZoomLevel); } else { return getDefaultInitialPosition(); } }