MapFileTileSource: zoom level improvements, closes #219
This commit is contained in:
parent
c1f65144df
commit
64a586dde8
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
## New since 0.6.0
|
## New since 0.6.0
|
||||||
|
|
||||||
|
- MapFileTileSource zoom level improvements [#219](https://github.com/mapsforge/vtm/issues/219)
|
||||||
- Polygon label position enhancements [#80](https://github.com/mapsforge/vtm/issues/80)
|
- Polygon label position enhancements [#80](https://github.com/mapsforge/vtm/issues/80)
|
||||||
- Many other minor improvements and bug fixes
|
- Many other minor improvements and bug fixes
|
||||||
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aissue+is%3Aclosed+milestone%3A0.7.0)
|
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aissue+is%3Aclosed+milestone%3A0.7.0)
|
||||||
|
@ -25,13 +25,17 @@ import org.oscim.utils.Utils;
|
|||||||
|
|
||||||
public class OsmTileLayer extends VectorTileLayer {
|
public class OsmTileLayer extends VectorTileLayer {
|
||||||
|
|
||||||
protected final static int MAX_ZOOMLEVEL = 17;
|
private static final int MAX_ZOOMLEVEL = 17;
|
||||||
protected final static int MIN_ZOOMLEVEL = 2;
|
private static final int MIN_ZOOMLEVEL = 2;
|
||||||
protected final static int CACHE_LIMIT = 150;
|
private static final int CACHE_LIMIT = 150;
|
||||||
|
|
||||||
public OsmTileLayer(Map map) {
|
public OsmTileLayer(Map map) {
|
||||||
|
this(map, MIN_ZOOMLEVEL, MAX_ZOOMLEVEL);
|
||||||
|
}
|
||||||
|
|
||||||
|
public OsmTileLayer(Map map, int zoomMin, int zoomMax) {
|
||||||
super(map, CACHE_LIMIT);
|
super(map, CACHE_LIMIT);
|
||||||
mTileManager.setZoomLevel(MIN_ZOOMLEVEL, MAX_ZOOMLEVEL);
|
mTileManager.setZoomLevel(zoomMin, zoomMax);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -39,10 +43,10 @@ public class OsmTileLayer extends VectorTileLayer {
|
|||||||
return new OsmTileLoader(this);
|
return new OsmTileLoader(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
static class OsmTileLoader extends VectorTileLoader {
|
private static class OsmTileLoader extends VectorTileLoader {
|
||||||
private final TagSet mFilteredTags;
|
private final TagSet mFilteredTags;
|
||||||
|
|
||||||
public OsmTileLoader(VectorTileLayer tileLayer) {
|
OsmTileLoader(VectorTileLayer tileLayer) {
|
||||||
super(tileLayer);
|
super(tileLayer);
|
||||||
mFilteredTags = new TagSet();
|
mFilteredTags = new TagSet();
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ import java.io.IOException;
|
|||||||
import java.io.RandomAccessFile;
|
import java.io.RandomAccessFile;
|
||||||
|
|
||||||
public class MapFileTileSource extends TileSource {
|
public class MapFileTileSource extends TileSource {
|
||||||
static final Logger log = LoggerFactory.getLogger(MapFileTileSource.class);
|
private static final Logger log = LoggerFactory.getLogger(MapFileTileSource.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Amount of cache blocks that the index cache should store.
|
* Amount of cache blocks that the index cache should store.
|
||||||
@ -44,7 +44,7 @@ public class MapFileTileSource extends TileSource {
|
|||||||
IndexCache databaseIndexCache;
|
IndexCache databaseIndexCache;
|
||||||
boolean experimental;
|
boolean experimental;
|
||||||
File mapFile;
|
File mapFile;
|
||||||
RandomAccessFile mInputFile;
|
private RandomAccessFile mInputFile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The preferred language when extracting labels from this tile source.
|
* The preferred language when extracting labels from this tile source.
|
||||||
@ -53,7 +53,11 @@ public class MapFileTileSource extends TileSource {
|
|||||||
private Callback callback;
|
private Callback callback;
|
||||||
|
|
||||||
public MapFileTileSource() {
|
public MapFileTileSource() {
|
||||||
super(0, 17);
|
this(0, 17);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MapFileTileSource(int zoomMin, int zoomMax) {
|
||||||
|
super(zoomMin, zoomMax);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user