From 92a9ef2061823e56b1e80aa3cb8ff7b48931aaa6 Mon Sep 17 00:00:00 2001 From: "Milos Brzakovic (E-Search)" Date: Tue, 27 Apr 2021 14:10:13 +0200 Subject: [PATCH] Move CrossEditableZoom event firing. It should happen after projection is transformed. --- modules/renderer/map.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/renderer/map.js b/modules/renderer/map.js index 4d5c6491f..28fd0c94d 100644 --- a/modules/renderer/map.js +++ b/modules/renderer/map.js @@ -589,15 +589,6 @@ export function rendererMap(context) { return; // no change } - var withinEditableZoom = map.withinEditableZoom(); - if (_lastWithinEditableZoom !== withinEditableZoom) { - if (_lastWithinEditableZoom !== undefined) { - // notify that the map zoomed in or out over the editable zoom threshold - dispatch.call('crossEditableZoom', this, withinEditableZoom); - } - _lastWithinEditableZoom = withinEditableZoom; - } - if (geoScaleToZoom(k, TILESIZE) < _minzoom) { surface.interrupt(); dispatch.call('hitMinZoom', this, map); @@ -608,6 +599,15 @@ export function rendererMap(context) { } projection.transform(eventTransform); + + var withinEditableZoom = map.withinEditableZoom(); + if (_lastWithinEditableZoom !== withinEditableZoom) { + if (_lastWithinEditableZoom !== undefined) { + // notify that the map zoomed in or out over the editable zoom threshold + dispatch.call('crossEditableZoom', this, withinEditableZoom); + } + _lastWithinEditableZoom = withinEditableZoom; + } var scale = k / _transformStart.k; var tX = (x / scale - _transformStart.x) * scale;