@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 +1 -1
- package/src/visualization/route.js +10 -1
package/package.json
CHANGED
|
@@ -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
|
-
|
|
45
|
+
this.geoJsonLayer.addTo(this.map);
|
|
37
46
|
|
|
38
47
|
}
|
|
39
48
|
|