From 76a8efae25bdee66a5410c47e545cea0001316d5 Mon Sep 17 00:00:00 2001
From: Oleksandr Husak <oleksandr.husak@mailbox.tu-dresden.de>
Date: Tue, 12 Apr 2022 12:55:12 +0200
Subject: [PATCH] display all history point

---
 README.md                               |  2 +-
 src/app/components/map/map.component.ts | 20 ++++++++++++++++----
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md
index 5f753da..c797cf3 100644
--- a/README.md
+++ b/README.md
@@ -79,7 +79,7 @@ Connection settings
             "refSystemId": "ROOT",
             "point": {
                 "latitude": 51.02535,
-                "longitude": 13.72285
+                "longitude": 13.72319
             },
             "accuracy": 1
             }
diff --git a/src/app/components/map/map.component.ts b/src/app/components/map/map.component.ts
index 681229f..396395d 100644
--- a/src/app/components/map/map.component.ts
+++ b/src/app/components/map/map.component.ts
@@ -74,7 +74,21 @@ export class MapComponent implements OnInit {
     // --- Leyers for markers
     if (key in this.markOverlays) {
       console.log(this.markOverlays)
-      this.markOverlays[key].clearLayers();
+      // this.markOverlays[key].clearLayers();
+
+
+      var myIconReplc = L.Icon.extend({
+        options: {}
+      });
+
+      this.markOverlays[key].eachLayer(layer => {
+        if (!(layer instanceof L.Circle)) {
+          this.map.removeLayer(layer)
+        }
+      });
+
+
+
     } else {
       this.markOverlays[key] = L.layerGroup().addTo(<L.Map>this.map)
     }
@@ -122,6 +136,7 @@ export class MapComponent implements OnInit {
  
     if (key=="ROOT") {
       // Root Marker
+      this.markOverlays[key].clearLayers();
       let marker = L.marker(globPos, {
         icon: L.icon({
           iconSize: [40, 40],
@@ -135,9 +150,6 @@ export class MapComponent implements OnInit {
     } else {
       // --- Marker config
       let serialNum = Object.keys(this.markOverlays).indexOf(key)
-      // if (serialNum == 0 && Object.keys(this.markOverlays).length > 1) {
-      //   serialNum = 1
-      // }
       var markerConf = getMarkerConfig(serialNum)
 
       let marker = L.marker(globPos, {
-- 
GitLab