diff --git a/src/ol/control/zoomslidercontrol.js b/src/ol/control/zoomslidercontrol.js index 2ecb78f55c..fbaaac77f6 100644 --- a/src/ol/control/zoomslidercontrol.js +++ b/src/ol/control/zoomslidercontrol.js @@ -123,20 +123,22 @@ ol.control.ZoomSlider.CSS_CLASS_THUMB = /** * The default value for minResolution_ when the control isn't instanciated with - * an explicit value. + * an explicit value. The default value is the resolution of the standard OSM + * tiles at zoomlevel 18. * * @const {number} */ -ol.control.ZoomSlider.DEFAULT_MIN_RESOLUTION = 500; +ol.control.ZoomSlider.DEFAULT_MIN_RESOLUTION = 0.5971642833948135; /** * The default value for maxResolution_ when the control isn't instanciated with - * an explicit value. + * an explicit value. The default value is the resolution of the standard OSM + * tiles at zoomlevel 0. * * @const {number} */ -ol.control.ZoomSlider.DEFAULT_MAX_RESOLUTION = 1000000; +ol.control.ZoomSlider.DEFAULT_MAX_RESOLUTION = 156543.0339; /** diff --git a/test/spec/ol/control/zoomslider.test.js b/test/spec/ol/control/zoomslider.test.js index da5010da60..1d52d5a522 100644 --- a/test/spec/ol/control/zoomslider.test.js +++ b/test/spec/ol/control/zoomslider.test.js @@ -22,12 +22,15 @@ describe('ol.control.ZoomSlider', function() { describe('configuration & defaults', function() { it('has valid defaults for min and maxresolution', function() { + var expectedMin = 0.5971642833948135, + expectedMax = 156543.0339, + expectedRange = expectedMax - expectedMin; expect(function() { zoomslider = new ol.control.ZoomSlider({}); }).not.toThrow(); - expect(zoomslider.minResolution_).toBe(500); - expect(zoomslider.maxResolution_).toBe(1000000); - expect(zoomslider.range_).toBe(999500); + expect(zoomslider.minResolution_).toBe(expectedMin); + expect(zoomslider.maxResolution_).toBe(expectedMax); + expect(zoomslider.range_).toBe(expectedRange); }); it('throws exception when configured with wrong resolutions', function() {