@Override public MapReadResult readLabels(Tile tile) { switch (this.dataPolicy) { case RETURN_FIRST: for (MapDataStore mdb : mapDatabases) { if (mdb.supportsTile(tile)) { return mdb.readLabels(tile); } } return null; case RETURN_ALL: return readLabels(tile, false); case DEDUPLICATE: return readLabels(tile, true); } throw new IllegalStateException("Invalid data policy for multi map database"); }
@Override public MapReadResult readMapData(Tile tile) { switch (this.dataPolicy) { case RETURN_FIRST: for (MapDataStore mdb : mapDatabases) { if (mdb.supportsTile(tile)) { return mdb.readMapData(tile); } } return null; case RETURN_ALL: return readMapData(tile, false); case DEDUPLICATE: return readMapData(tile, true); } throw new IllegalStateException("Invalid data policy for multi map database"); }
@Override public MapReadResult readPoiData(Tile upperLeft, Tile lowerRight) { switch (this.dataPolicy) { case RETURN_FIRST: for (MapDataStore mdb : mapDatabases) { if (mdb.supportsTile(upperLeft)) { return mdb.readPoiData(upperLeft, lowerRight); } } return null; case RETURN_ALL: return readPoiData(upperLeft, lowerRight, false); case DEDUPLICATE: return readPoiData(upperLeft, lowerRight, true); } throw new IllegalStateException("Invalid data policy for multi map database"); }
MultiMapDataStore mapDataStore = new MultiMapDataStore(MultiMapDataStore.DataPolicy.RETURN_ALL); for (File file : mapFiles) { mapDataStore.addMapDataStore(new MapFile(file), false, false); boundingBox = mapDataStore.boundingBox();
@Override protected void onCreate(Bundle savedInstanceState) { pointDataStore = new PointDataStore(); multiMapDataStore = new MultiMapDataStore(MultiMapDataStore.DataPolicy.RETURN_ALL); multiMapDataStore.addMapDataStore(getBaseMapFile(), true, true); multiMapDataStore.addMapDataStore(getUserDataStore(), false, false); super.onCreate(savedInstanceState); } }
@Override protected void onCreate(Bundle savedInstanceState) { worldMapFile = new MapFile(getWorldMapFile(this)) { @Override public boolean supportsTile(Tile tile) { // Example low res world map has sufficient detail up to zoom level 7 return tile.zoomLevel <= 10 && super.supportsTile(tile); } }; multiMapDataStore = new MultiMapDataStore(MultiMapDataStore.DataPolicy.RETURN_ALL); MapFile mapFile1 = (MapFile) getMapFile1(); mapFile1.restrictToZoomRange((byte) 8, Byte.MAX_VALUE); multiMapDataStore.addMapDataStore(mapFile1, true, true); multiMapDataStore.addMapDataStore(getMapFile2(), false, false); super.onCreate(savedInstanceState); } }
@Override public MapReadResult readLabels(Tile upperLeft, Tile lowerRight) { switch (this.dataPolicy) { case RETURN_FIRST: for (MapDataStore mdb : mapDatabases) { if (mdb.supportsTile(upperLeft)) { return mdb.readLabels(upperLeft, lowerRight); } } return null; case RETURN_ALL: return readLabels(upperLeft, lowerRight, false); case DEDUPLICATE: return readLabels(upperLeft, lowerRight, true); } throw new IllegalStateException("Invalid data policy for multi map database"); }
@Override public MapReadResult readPoiData(Tile tile) { switch (this.dataPolicy) { case RETURN_FIRST: for (MapDataStore mdb : mapDatabases) { if (mdb.supportsTile(tile)) { return mdb.readPoiData(tile); } } return null; case RETURN_ALL: return readPoiData(tile, false); case DEDUPLICATE: return readPoiData(tile, true); } throw new IllegalStateException("Invalid data policy for multi map database"); }
@Override public MapReadResult readMapData(Tile upperLeft, Tile lowerRight) { switch (this.dataPolicy) { case RETURN_FIRST: for (MapDataStore mdb : mapDatabases) { if (mdb.supportsTile(upperLeft)) { return mdb.readMapData(upperLeft, lowerRight); } } return null; case RETURN_ALL: return readMapData(upperLeft, lowerRight, false); case DEDUPLICATE: return readMapData(upperLeft, lowerRight, true); } throw new IllegalStateException("Invalid data policy for multi map database"); }
@Override public MapReadResult readLabels(Tile tile) { switch (this.dataPolicy) { case RETURN_FIRST: for (MapDataStore mdb : mapDatabases) { if (mdb.supportsTile(tile)) { return mdb.readLabels(tile); } } return null; case RETURN_ALL: return readLabels(tile, false); case DEDUPLICATE: return readLabels(tile, true); } throw new IllegalStateException("Invalid data policy for multi map database"); }
@Override public MapReadResult readPoiData(Tile upperLeft, Tile lowerRight) { switch (this.dataPolicy) { case RETURN_FIRST: for (MapDataStore mdb : mapDatabases) { if (mdb.supportsTile(upperLeft)) { return mdb.readPoiData(upperLeft, lowerRight); } } return null; case RETURN_ALL: return readPoiData(upperLeft, lowerRight, false); case DEDUPLICATE: return readPoiData(upperLeft, lowerRight, true); } throw new IllegalStateException("Invalid data policy for multi map database"); }
@Override public MapReadResult readMapData(Tile tile) { switch (this.dataPolicy) { case RETURN_FIRST: for (MapDataStore mdb : mapDatabases) { if (mdb.supportsTile(tile)) { return mdb.readMapData(tile); } } return null; case RETURN_ALL: return readMapData(tile, false); case DEDUPLICATE: return readMapData(tile, true); } throw new IllegalStateException("Invalid data policy for multi map database"); }
@Override public MapReadResult readLabels(Tile upperLeft, Tile lowerRight) { switch (this.dataPolicy) { case RETURN_FIRST: for (MapDataStore mdb : mapDatabases) { if (mdb.supportsTile(upperLeft)) { return mdb.readLabels(upperLeft, lowerRight); } } return null; case RETURN_ALL: return readLabels(upperLeft, lowerRight, false); case DEDUPLICATE: return readLabels(upperLeft, lowerRight, true); } throw new IllegalStateException("Invalid data policy for multi map database"); }
@Override public MapReadResult readPoiData(Tile tile) { switch (this.dataPolicy) { case RETURN_FIRST: for (MapDataStore mdb : mapDatabases) { if (mdb.supportsTile(tile)) { return mdb.readPoiData(tile); } } return null; case RETURN_ALL: return readPoiData(tile, false); case DEDUPLICATE: return readPoiData(tile, true); } throw new IllegalStateException("Invalid data policy for multi map database"); }
@Override public MapReadResult readMapData(Tile upperLeft, Tile lowerRight) { switch (this.dataPolicy) { case RETURN_FIRST: for (MapDataStore mdb : mapDatabases) { if (mdb.supportsTile(upperLeft)) { return mdb.readMapData(upperLeft, lowerRight); } } return null; case RETURN_ALL: return readMapData(upperLeft, lowerRight, false); case DEDUPLICATE: return readMapData(upperLeft, lowerRight, true); } throw new IllegalStateException("Invalid data policy for multi map database"); }