Skip to content

Commit

Permalink
remove useless map init
Browse files Browse the repository at this point in the history
  • Loading branch information
bastyen authored and submarcos committed Jul 19, 2024
1 parent 74e23ef commit 07e4cd7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ export class NewObservationComponent {
}
}
});

this.initMap();
}
constructor() {
afterNextRender(async () => {
Expand All @@ -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] });

Expand Down Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ export class SynthesisInterfaceComponent {
});
}

ngOnInit() {}

async initMap() {
this.L = await import('leaflet');
await import('leaflet.locatecontrol');
Expand Down

0 comments on commit 07e4cd7

Please sign in to comment.