From 44511319998f93fa5df3d79180063e048b8c2310 Mon Sep 17 00:00:00 2001 From: eug-L Date: Fri, 5 Apr 2024 12:47:15 +0800 Subject: [PATCH] update flags for setMaxZoomPixelRatio --- src/viewport.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/viewport.js b/src/viewport.js index 60702c33..4d209dc5 100644 --- a/src/viewport.js +++ b/src/viewport.js @@ -1804,13 +1804,11 @@ $.Viewport.prototype = { * Sets max zoom pixel ratio * @function * @param {Number} ratio - Max zoom pixel ratio - * @param {Boolean} [constraints=false] - Apply constraints after setting ratio; + * @param {Boolean} [applyConstraints=true] - Apply constraints after setting ratio; * Takes effect only if current zoom is greater than set max zoom pixel ratio * @param {Boolean} [immediately=false] - Whether to animate to new zoom */ - setMaxZoomPixelRatio: function(ratio, constraints, immediately) { - constraints = constraints || false; - immediately = immediately || false; + setMaxZoomPixelRatio: function(ratio, applyConstraints = true, immediately = false) { $.console.assert(!isNaN(ratio), "[Viewport.setMaxZoomPixelRatio] ratio must be a number"); @@ -1820,7 +1818,7 @@ $.Viewport.prototype = { this.maxZoomPixelRatio = ratio; - if (constraints) { + if (applyConstraints) { if (this.getZoom() > this.getMaxZoom()) { this.applyConstraints(immediately); }