From 0e653933cf7029d8c0948c8b661ae3baba26bae2 Mon Sep 17 00:00:00 2001
From: Hugo <hnouts@grandlyon.com>
Date: Tue, 14 Sep 2021 14:29:40 +0200
Subject: [PATCH] fix (orientationform): navigating pages keeps selected
 structure markers

on map component, selected structure to print have their own marker. Marker persist when map is reloaded from navigating form pages.
---
 src/app/form/orientation-form/orientation-form.component.ts | 1 +
 src/app/map/components/map.component.ts                     | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/src/app/form/orientation-form/orientation-form.component.ts b/src/app/form/orientation-form/orientation-form.component.ts
index c5c8c8d35..a76082df7 100644
--- a/src/app/form/orientation-form/orientation-form.component.ts
+++ b/src/app/form/orientation-form/orientation-form.component.ts
@@ -196,6 +196,7 @@ export class OrientationFormComponent implements OnInit {
       }
       this.currentPage--;
       this.progressStatus -= 100 / this.nbPagesForm;
+      this.setStructuresAndCoord();
       this.updatePageValid();
     }
   }
diff --git a/src/app/map/components/map.component.ts b/src/app/map/components/map.component.ts
index e432b027e..d3871abcf 100644
--- a/src/app/map/components/map.component.ts
+++ b/src/app/map/components/map.component.ts
@@ -141,6 +141,10 @@ export class MapComponent implements OnChanges {
     } else if (this.structures) {
       this.map = this.mapService.cleanMap(this.map);
       this.getStructuresPositions(this.structures);
+      this.structuresToPrint.forEach((structure: Structure) => {
+        this.mapService.setAddedToListMarker(structure._id);
+      });
+
     }
   }
 
-- 
GitLab