@lgv/visualization-map 1.0.3 → 1.0.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lgv/visualization-map",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "type": "module",
5
5
  "description": "ES6 d3.js core visualization scaffold object and utilities for maps.",
6
6
  "main": "src/index.js",
@@ -1,5 +1,5 @@
1
1
  import { select } from "d3-selection";
2
- import { debounce, LinearGrid } from "@lgv/visualization-chart";
2
+ import { LinearGrid } from "@lgv/visualization-chart";
3
3
  import { mean } from "d3-array";
4
4
  import L from "leaflet";
5
5
  import "leaflet/dist/leaflet.css";
@@ -37,7 +37,9 @@ class VisualizationMap extends LinearGrid {
37
37
 
38
38
  // update self
39
39
  this.center = [x,y];
40
+ this.debounceDelay = 500;
40
41
  this.map = null;
42
+ this.moveendTimeout = null;
41
43
  this.tileServerUrl = tileServerUrl;
42
44
  this.zoom = 1;
43
45
 
@@ -64,7 +66,10 @@ class VisualizationMap extends LinearGrid {
64
66
  * Attach event handlers for map events.
65
67
  */
66
68
  attachEvents() {
67
- this.map.on("moveend", debounce(() => this.processMoveEnd(),2000));
69
+ this.map.on("moveend", () => {
70
+ clearTimeout(this.moveendTimeout);
71
+ this.moveendTimeout = setTimeout(() => this.processMoveEnd(),this.debounceDelay);
72
+ });
68
73
  }
69
74
 
70
75
  /**