Support minZoom in ol.source.Stamen
This commit is contained in:
@@ -6128,7 +6128,7 @@ olx.source.XYZOptions.prototype.maxZoom;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unsupported (TODO: remove this).
|
* Optional min zoom level. Default is `0`.
|
||||||
* @type {number|undefined}
|
* @type {number|undefined}
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ ol.source.StamenProviderConfig = {
|
|||||||
maxZoom: 20
|
maxZoom: 20
|
||||||
},
|
},
|
||||||
'watercolor': {
|
'watercolor': {
|
||||||
minZoom: 3,
|
minZoom: 1,
|
||||||
maxZoom: 16
|
maxZoom: 16
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -106,8 +106,7 @@ ol.source.Stamen = function(options) {
|
|||||||
cacheSize: options.cacheSize,
|
cacheSize: options.cacheSize,
|
||||||
crossOrigin: 'anonymous',
|
crossOrigin: 'anonymous',
|
||||||
maxZoom: providerConfig.maxZoom,
|
maxZoom: providerConfig.maxZoom,
|
||||||
// FIXME uncomment the following when tilegrid supports minZoom
|
minZoom: providerConfig.minZoom,
|
||||||
//minZoom: providerConfig.minZoom,
|
|
||||||
opaque: layerConfig.opaque,
|
opaque: layerConfig.opaque,
|
||||||
reprojectionErrorThreshold: options.reprojectionErrorThreshold,
|
reprojectionErrorThreshold: options.reprojectionErrorThreshold,
|
||||||
tileLoadFunction: options.tileLoadFunction,
|
tileLoadFunction: options.tileLoadFunction,
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ ol.source.XYZ = function(options) {
|
|||||||
ol.tilegrid.createXYZ({
|
ol.tilegrid.createXYZ({
|
||||||
extent: ol.tilegrid.extentFromProjection(projection),
|
extent: ol.tilegrid.extentFromProjection(projection),
|
||||||
maxZoom: options.maxZoom,
|
maxZoom: options.maxZoom,
|
||||||
|
minZoom: options.minZoom,
|
||||||
tileSize: options.tileSize
|
tileSize: options.tileSize
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,13 @@ describe('ol.source.XYZ', function() {
|
|||||||
expect(tileSource.getTileGrid().getTileSize(0)).to.be(512);
|
expect(tileSource.getTileGrid().getTileSize(0)).to.be(512);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('can be constructed with a custom min zoom', function() {
|
||||||
|
var tileSource = new ol.source.XYZ({
|
||||||
|
minZoom: 2
|
||||||
|
});
|
||||||
|
expect(tileSource.getTileGrid().getMinZoom()).to.be(2);
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('tileUrlFunction', function() {
|
describe('tileUrlFunction', function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user