@opengeoweb/webmap 2.4.0 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import moment from 'moment';
2
2
  import proj4 from 'proj4';
3
- import { debounce } from 'throttle-debounce';
3
+ import { debounce, throttle } from 'throttle-debounce';
4
4
 
5
5
  function _typeof(obj) {
6
6
  "@babel/helpers - typeof";
@@ -3813,6 +3813,8 @@ var buildWMSGetMapRequest = function buildWMSGetMapRequest(map, layer) {
3813
3813
 
3814
3814
  var SCALE_DELAY = 10;
3815
3815
  var ZOOMED_CALLBACK_DELAY = 500;
3816
+ var THROTTLE_WAIT_TIME = 300;
3817
+ var THROTTLE_NO_TRAILING = true;
3816
3818
 
3817
3819
  var WMFlyToBBox = function WMFlyToBBox(wmMap) {
3818
3820
  var _this = this;
@@ -3915,6 +3917,14 @@ var WMFlyToBBox = function WMFlyToBBox(wmMap) {
3915
3917
  }
3916
3918
  };
3917
3919
 
3920
+ this.startZoomThrottled = throttle(THROTTLE_WAIT_TIME, THROTTLE_NO_TRAILING, function (currentbox, newbox) {
3921
+ return _this.flyZoomToBBOXStartZoom(currentbox, newbox);
3922
+ });
3923
+
3924
+ this.flyZoomToBBOXStartZoomThrottled = function (currentbox, newbox) {
3925
+ _this.startZoomThrottled(currentbox, newbox);
3926
+ };
3927
+
3918
3928
  this.wmMap = wmMap;
3919
3929
  this.flyZoomToBBOXTimerFuncReadyDebounced = debounce(ZOOMED_CALLBACK_DELAY, this.flyZoomToBBOXTimerFuncReadyDebounced);
3920
3930
  this.flyZoomToBBOXDebounced = debounce(SCALE_DELAY, this.flyZoomToBBOXTimerFunc);
@@ -5670,7 +5680,12 @@ var WMJSMap = /*#__PURE__*/function () {
5670
5680
  this.mouseWheelEventBBOXNew.right = newRight;
5671
5681
  this.mouseWheelEventBBOXNew.top = newTop;
5672
5682
  this.mouseWheelBusy = 0;
5673
- this.wMFlyToBBox.flyZoomToBBOXStartZoom(this.mouseWheelEventBBOXCurrent, this.mouseWheelEventBBOXNew);
5683
+
5684
+ if (Math.abs(delta) < 4) {
5685
+ this.wMFlyToBBox.flyZoomToBBOXStartZoomThrottled(this.mouseWheelEventBBOXCurrent, this.mouseWheelEventBBOXNew);
5686
+ } else {
5687
+ this.wMFlyToBBox.flyZoomToBBOXStartZoom(this.mouseWheelEventBBOXCurrent, this.mouseWheelEventBBOXNew);
5688
+ }
5674
5689
  }
5675
5690
  }, {
5676
5691
  key: "destroy",
package/index.umd.js CHANGED
@@ -3865,6 +3865,8 @@
3865
3865
  * */
3866
3866
  var SCALE_DELAY = 10;
3867
3867
  var ZOOMED_CALLBACK_DELAY = 500;
3868
+ var THROTTLE_WAIT_TIME = 300;
3869
+ var THROTTLE_NO_TRAILING = true;
3868
3870
 
3869
3871
  var WMFlyToBBox =
3870
3872
  /** @class */
@@ -3968,6 +3970,14 @@
3968
3970
  }
3969
3971
  };
3970
3972
 
3973
+ this.startZoomThrottled = throttleDebounce.throttle(THROTTLE_WAIT_TIME, THROTTLE_NO_TRAILING, function (currentbox, newbox) {
3974
+ return _this.flyZoomToBBOXStartZoom(currentbox, newbox);
3975
+ });
3976
+
3977
+ this.flyZoomToBBOXStartZoomThrottled = function (currentbox, newbox) {
3978
+ _this.startZoomThrottled(currentbox, newbox);
3979
+ };
3980
+
3971
3981
  this.wmMap = wmMap;
3972
3982
  this.flyZoomToBBOXTimerFuncReadyDebounced = throttleDebounce.debounce(ZOOMED_CALLBACK_DELAY, this.flyZoomToBBOXTimerFuncReadyDebounced);
3973
3983
  this.flyZoomToBBOXDebounced = throttleDebounce.debounce(SCALE_DELAY, this.flyZoomToBBOXTimerFunc);
@@ -5658,7 +5668,12 @@
5658
5668
  this.mouseWheelEventBBOXNew.right = newRight;
5659
5669
  this.mouseWheelEventBBOXNew.top = newTop;
5660
5670
  this.mouseWheelBusy = 0;
5661
- this.wMFlyToBBox.flyZoomToBBOXStartZoom(this.mouseWheelEventBBOXCurrent, this.mouseWheelEventBBOXNew);
5671
+
5672
+ if (Math.abs(delta) < 4) {
5673
+ this.wMFlyToBBox.flyZoomToBBOXStartZoomThrottled(this.mouseWheelEventBBOXCurrent, this.mouseWheelEventBBOXNew);
5674
+ } else {
5675
+ this.wMFlyToBBox.flyZoomToBBOXStartZoom(this.mouseWheelEventBBOXCurrent, this.mouseWheelEventBBOXNew);
5676
+ }
5662
5677
  };
5663
5678
 
5664
5679
  WMJSMap.prototype.destroy = function () {
@@ -19,4 +19,6 @@ export default class WMFlyToBBox {
19
19
  resetBBoxTimer: () => void;
20
20
  flyZoomToBBOXStop: () => void;
21
21
  flyZoomToBBOXStartZoom: (currentbox: WMBBOX, newbox: WMBBOX) => void;
22
+ startZoomThrottled: any;
23
+ flyZoomToBBOXStartZoomThrottled: (currentbox: WMBBOX, newbox: WMBBOX) => void;
22
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/webmap",
3
- "version": "2.4.0",
3
+ "version": "2.6.0",
4
4
  "description": "GeoWeb webmap library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {