@lgv/visualization-map 0.0.7 → 0.0.8

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": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "type": "module",
5
5
  "description": "ES6 d3.js core visualization scaffold object and utilities for maps.",
6
6
  "main": "src/index.js",
@@ -25,6 +25,9 @@ class Routemap extends VisualizationMap {
25
25
  // initialize inheritance
26
26
  super(data, width, height, MapLayout ? MapLayout : new ML(data), tileServerUrl, label, name);
27
27
 
28
+ // initialize feature group
29
+ this.geoJsonLayer = null;
30
+
28
31
  }
29
32
 
30
33
  /**
@@ -32,8 +35,14 @@ class Routemap extends VisualizationMap {
32
35
  */
33
36
  generateChart() {
34
37
 
38
+ // clear if exists
39
+ if (this.geoJsonLayer) this.geoJsonLayer.clearLayers();
40
+
41
+ // initialize feature group
42
+ this.geoJsonLayer = L.geoJSON(this.data);
43
+
35
44
  // add lines
36
- L.geoJSON(this.data).addTo(this.map);
45
+ this.geoJsonLayer.addTo(this.map);
37
46
 
38
47
  }
39
48