From d77a8b0a1d2a9421c84c6cd36ad9b3703a6908dc Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Tue, 12 Mar 2013 16:09:58 +0100 Subject: [PATCH] Add an assertion to the dragchange handler. This ensures that the result of resolution calculation stays inside of the allowed bounds. --- src/ol/control/zoomslidercontrol.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ol/control/zoomslidercontrol.js b/src/ol/control/zoomslidercontrol.js index fbaaac77f6..3e9a151fdb 100644 --- a/src/ol/control/zoomslidercontrol.js +++ b/src/ol/control/zoomslidercontrol.js @@ -307,6 +307,8 @@ ol.control.ZoomSlider.prototype.handleSliderChange_ = function(e) { var map = this.getMap(), amountDragged = this.amountDragged_(e), res = this.resolutionForAmount_(amountDragged); + goog.asserts.assert(res >= this.minResolution_ && res <= this.maxResolution_, + 'calculated new resolution is in allowed bounds.'); if (res !== this.currentResolution_) { this.currentResolution_ = res; map.getView().setResolution(res);