use zoomTable for zoom-levels provided by db
This commit is contained in:
parent
3b0c3c8ce9
commit
355f41aee3
@ -141,6 +141,13 @@ public class TileManager {
|
||||
// ... free static pools
|
||||
}
|
||||
|
||||
private int[] mZoomTable;
|
||||
|
||||
public void setZoomTable(int[] zoomLevel) {
|
||||
mZoomTable = zoomLevel;
|
||||
|
||||
}
|
||||
|
||||
public void init(int width, int height) {
|
||||
|
||||
// sync with GLRender thread
|
||||
@ -201,6 +208,18 @@ public class TileManager {
|
||||
|
||||
int tileZoom = FastMath.clamp(pos.zoomLevel, MIN_ZOOMLEVEL, mMaxZoom);
|
||||
|
||||
if (mZoomTable != null){
|
||||
int match = 0;
|
||||
for (int z : mZoomTable){
|
||||
if (z <= tileZoom && z > match)
|
||||
match = z;
|
||||
}
|
||||
if (match == 0)
|
||||
return;
|
||||
|
||||
tileZoom = match;
|
||||
}
|
||||
|
||||
mMapViewPosition.getMapViewProjection(mMapPlane);
|
||||
|
||||
// scan visible tiles. callback function calls 'addTile'
|
||||
@ -350,7 +369,7 @@ public class TileManager {
|
||||
mJobs.add(tile);
|
||||
}
|
||||
|
||||
if (zoomLevel > 2) {
|
||||
if ((zoomLevel > 2) && (mZoomTable == null)) {
|
||||
boolean add = false;
|
||||
|
||||
// prefetch parent
|
||||
|
@ -104,6 +104,8 @@ public class MapTileLayer extends TileLayer<MapTileLoader> {
|
||||
else
|
||||
MapView.enableClosePolygons = false;
|
||||
|
||||
mTileManager.setZoomTable(mMapDatabase.getMapInfo().zoomLevel);
|
||||
|
||||
mMapView.clearMap();
|
||||
|
||||
resumeLoaders();
|
||||
|
Loading…
x
Reference in New Issue
Block a user