add cacheLimit parameter to TileLayer constructor
This commit is contained in:
parent
16f4d85086
commit
c16ffef0bd
@ -39,11 +39,17 @@ import com.google.gwt.user.client.ui.RootPanel;
|
||||
|
||||
public class BitmapTileLayer extends TileLayer<TileLoader> {
|
||||
|
||||
private final static int CACHE_LIMIT = 50;
|
||||
|
||||
final TileSource mTileSource;
|
||||
private final FadeStep[] mFade;
|
||||
|
||||
public BitmapTileLayer(Map map, TileSource tileSource) {
|
||||
super(map, tileSource.getZoomLevelMin(), tileSource.getZoomLevelMax(), 100);
|
||||
this(map, tileSource, CACHE_LIMIT);
|
||||
}
|
||||
|
||||
public BitmapTileLayer(Map map, TileSource tileSource, int cacheLimit) {
|
||||
super(map, tileSource.getZoomLevelMin(), tileSource.getZoomLevelMax(), cacheLimit);
|
||||
mTileSource = tileSource;
|
||||
mFade = mTileSource.getFadeSteps();
|
||||
}
|
||||
|
@ -40,6 +40,8 @@ public class BitmapTileLayer extends TileLayer<TileLoader> {
|
||||
|
||||
protected static final Logger log = LoggerFactory.getLogger(BitmapTileLayer.class);
|
||||
|
||||
private final static int CACHE_LIMIT = 50;
|
||||
|
||||
private static final int TIMEOUT_CONNECT = 5000;
|
||||
private static final int TIMEOUT_READ = 10000;
|
||||
|
||||
@ -47,10 +49,13 @@ public class BitmapTileLayer extends TileLayer<TileLoader> {
|
||||
private final FadeStep[] mFade;
|
||||
|
||||
public BitmapTileLayer(Map map, TileSource tileSource) {
|
||||
super(map, tileSource.getZoomLevelMin(), tileSource.getZoomLevelMax(), 100);
|
||||
this(map, tileSource, CACHE_LIMIT);
|
||||
}
|
||||
|
||||
public BitmapTileLayer(Map map, TileSource tileSource, int cacheLimit) {
|
||||
super(map, tileSource.getZoomLevelMin(), tileSource.getZoomLevelMax(), cacheLimit);
|
||||
mTileSource = tileSource;
|
||||
mFade = mTileSource.getFadeSteps();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -105,7 +110,7 @@ public class BitmapTileLayer extends TileLayer<TileLoader> {
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -39,6 +39,10 @@ public class VectorTileLayer extends TileLayer<VectorTileLoader> {
|
||||
super(map);
|
||||
}
|
||||
|
||||
public VectorTileLayer(Map map, int minZoom, int maxZoom, int cacheLimit) {
|
||||
super(map, minZoom, maxZoom, cacheLimit);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected VectorTileLoader createLoader(TileManager tm) {
|
||||
return new VectorTileLoader(tm);
|
||||
|
Loading…
x
Reference in New Issue
Block a user