Skip to content

Commit fc1077d

Browse files
Joxitfcamblor
authored andcommitted
fix: build since 76224ef
1 parent 2fe164e commit fc1077d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/components/vmd-appointment-map.component.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import { css, unsafeCSS, customElement, html, LitElement, property, internalProp
22
import { Icon, map, marker, tileLayer, LatLngTuple } from 'leaflet';
33
import leafletCss from 'leaflet/dist/leaflet.css';
44
import leafletMarkerCss from 'leaflet.markercluster/dist/MarkerCluster.Default.css';
5-
import { MarkerClusterGroup } from 'leaflet.markercluster';
5+
import * as L from 'leaflet';
6+
import 'leaflet.markercluster';
67
import { Router } from '../routing/Router';
78
import { LieuAffichableAvecDistance, Coordinates, SearchRequest, TYPES_LIEUX } from '../state/State';
89
import { CSS_Global } from '../styles/ConstructibleStyleSheets';
@@ -43,8 +44,8 @@ export class VmdAppointmentMapComponent extends LitElement {
4344

4445
private loadMap() {
4546
const coordinates =
46-
this.currentSearch &&
47-
(this.toCoordinates(this.currentSearch.commune) || this.toCoordinates(this.currentSearch.departement));
47+
this.currentSearch instanceof SearchRequest.ByCommune &&
48+
this.toCoordinates((this.currentSearch as SearchRequest.ByCommune).commune);
4849
const mymap = map(this.shadowRoot!.querySelector('#appointment-map') as HTMLElement).setView(
4950
coordinates || [46.505, 3],
5051
13
@@ -87,7 +88,7 @@ export class VmdAppointmentMapComponent extends LitElement {
8788
};
8889
const markers = lieux
8990
.filter((lieu) => lieu.disponible)
90-
.reduce((markers: MarkerClusterGroup, lieu: LieuAffichableAvecDistance) => {
91+
.reduce((markers: L.MarkerClusterGroup, lieu: LieuAffichableAvecDistance) => {
9192
const coordinates = this.toCoordinates(lieu.location);
9293
if (coordinates) {
9394
var string_popup = `
@@ -143,7 +144,7 @@ export class VmdAppointmentMapComponent extends LitElement {
143144
}
144145

145146
return markers;
146-
}, new MarkerClusterGroup({ disableClusteringAtZoom: 9 }));
147+
}, new L.MarkerClusterGroup({ disableClusteringAtZoom: 9 }));
147148

148149
return { markers, bounds };
149150
}

0 commit comments

Comments
 (0)