Use minZoom and maxZoom olx.source.StamenOptions
This commit is contained in:
@@ -105,8 +105,8 @@ ol.source.Stamen = function(options) {
|
||||
attributions: ol.source.Stamen.ATTRIBUTIONS,
|
||||
cacheSize: options.cacheSize,
|
||||
crossOrigin: 'anonymous',
|
||||
maxZoom: providerConfig.maxZoom,
|
||||
minZoom: providerConfig.minZoom,
|
||||
maxZoom: options.maxZoom != undefined ? options.maxZoom : providerConfig.maxZoom,
|
||||
minZoom: options.minZoom != undefined ? options.minZoom : providerConfig.minZoom,
|
||||
opaque: layerConfig.opaque,
|
||||
reprojectionErrorThreshold: options.reprojectionErrorThreshold,
|
||||
tileLoadFunction: options.tileLoadFunction,
|
||||
|
||||
28
test/spec/ol/source/stamensource.test.js
Normal file
28
test/spec/ol/source/stamensource.test.js
Normal file
@@ -0,0 +1,28 @@
|
||||
goog.provide('ol.test.source.Stamen');
|
||||
|
||||
describe('ol.source.Stamen', function() {
|
||||
|
||||
describe('constructor', function() {
|
||||
|
||||
it('can be constructed with a custom minZoom', function() {
|
||||
var source = new ol.source.Stamen({
|
||||
layer: 'watercolor',
|
||||
minZoom: 10
|
||||
});
|
||||
expect(source.getTileGrid().getMinZoom()).to.be(10);
|
||||
});
|
||||
|
||||
it('can be constructed with a custom maxZoom', function() {
|
||||
var source = new ol.source.Stamen({
|
||||
layer: 'watercolor',
|
||||
maxZoom: 8
|
||||
});
|
||||
expect(source.getTileGrid().getMaxZoom()).to.be(8);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
goog.require('ol.source.Stamen');
|
||||
Reference in New Issue
Block a user