From 07e4cd7a20730059cb12537a837f9f8cf16d6fae Mon Sep 17 00:00:00 2001 From: Bastyen Date: Tue, 25 Jun 2024 10:01:58 +0200 Subject: [PATCH] remove useless map init --- .../src/app/new-observation/new-observation.component.ts | 7 ++----- .../synthesis-interface/synthesis-interface.component.ts | 2 -- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/front-end/src/app/new-observation/new-observation.component.ts b/front-end/src/app/new-observation/new-observation.component.ts index c02327a..7a2fdbd 100644 --- a/front-end/src/app/new-observation/new-observation.component.ts +++ b/front-end/src/app/new-observation/new-observation.component.ts @@ -135,8 +135,6 @@ export class NewObservationComponent { } } }); - - this.initMap(); } constructor() { afterNextRender(async () => { @@ -147,7 +145,6 @@ export class NewObservationComponent { async initMap() { this.L = await import('leaflet'); await import('leaflet.locatecontrol'); - const { Icon, icon } = await import('leaflet'); this.map = this.L.map('map', { zoom: 4, center: [47, 2] }); @@ -177,8 +174,8 @@ export class NewObservationComponent { lng: round(center.lng, 6), }; this.marker = this.L.marker(center, { - icon: icon({ - ...Icon.Default.prototype.options, + icon: this.L.icon({ + ...this.L.Icon.Default.prototype.options, iconUrl: 'assets/marker-icon.png', iconRetinaUrl: 'assets/marker-icon-2x.png', shadowUrl: 'assets/marker-shadow.png', diff --git a/front-end/src/app/synthesis-interface/synthesis-interface.component.ts b/front-end/src/app/synthesis-interface/synthesis-interface.component.ts index 6d7da48..0f85ad1 100644 --- a/front-end/src/app/synthesis-interface/synthesis-interface.component.ts +++ b/front-end/src/app/synthesis-interface/synthesis-interface.component.ts @@ -32,8 +32,6 @@ export class SynthesisInterfaceComponent { }); } - ngOnInit() {} - async initMap() { this.L = await import('leaflet'); await import('leaflet.locatecontrol');