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,
|
attributions: ol.source.Stamen.ATTRIBUTIONS,
|
||||||
cacheSize: options.cacheSize,
|
cacheSize: options.cacheSize,
|
||||||
crossOrigin: 'anonymous',
|
crossOrigin: 'anonymous',
|
||||||
maxZoom: providerConfig.maxZoom,
|
maxZoom: options.maxZoom != undefined ? options.maxZoom : providerConfig.maxZoom,
|
||||||
minZoom: providerConfig.minZoom,
|
minZoom: options.minZoom != undefined ? options.minZoom : providerConfig.minZoom,
|
||||||
opaque: layerConfig.opaque,
|
opaque: layerConfig.opaque,
|
||||||
reprojectionErrorThreshold: options.reprojectionErrorThreshold,
|
reprojectionErrorThreshold: options.reprojectionErrorThreshold,
|
||||||
tileLoadFunction: options.tileLoadFunction,
|
tileLoadFunction: options.tileLoadFunction,
|
||||||
|
|||||||
@@ -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