Merge pull request #5105 from fredj/stamen_minZoom
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}
|
||||
* @api
|
||||
*/
|
||||
|
||||
@@ -70,7 +70,7 @@ ol.source.StamenProviderConfig = {
|
||||
maxZoom: 20
|
||||
},
|
||||
'watercolor': {
|
||||
minZoom: 3,
|
||||
minZoom: 1,
|
||||
maxZoom: 16
|
||||
}
|
||||
};
|
||||
@@ -106,8 +106,7 @@ ol.source.Stamen = function(options) {
|
||||
cacheSize: options.cacheSize,
|
||||
crossOrigin: 'anonymous',
|
||||
maxZoom: providerConfig.maxZoom,
|
||||
// FIXME uncomment the following when tilegrid supports minZoom
|
||||
//minZoom: providerConfig.minZoom,
|
||||
minZoom: providerConfig.minZoom,
|
||||
opaque: layerConfig.opaque,
|
||||
reprojectionErrorThreshold: options.reprojectionErrorThreshold,
|
||||
tileLoadFunction: options.tileLoadFunction,
|
||||
|
||||
@@ -33,6 +33,7 @@ ol.source.XYZ = function(options) {
|
||||
ol.tilegrid.createXYZ({
|
||||
extent: ol.tilegrid.extentFromProjection(projection),
|
||||
maxZoom: options.maxZoom,
|
||||
minZoom: options.minZoom,
|
||||
tileSize: options.tileSize
|
||||
});
|
||||
|
||||
|
||||
@@ -20,6 +20,13 @@ describe('ol.source.XYZ', function() {
|
||||
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() {
|
||||
|
||||
Reference in New Issue
Block a user