Skip to content

Commit

Permalink
fix: build since 76224ef
Browse files Browse the repository at this point in the history
  • Loading branch information
Joxit authored and fcamblor committed May 27, 2021
1 parent 60cba0b commit ab96172
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/components/vmd-appointment-map.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { css, unsafeCSS, customElement, html, LitElement, property, internalProp
import { Icon, map, marker, tileLayer, LatLngTuple } from 'leaflet';
import leafletCss from 'leaflet/dist/leaflet.css';
import leafletMarkerCss from 'leaflet.markercluster/dist/MarkerCluster.Default.css';
import { MarkerClusterGroup } from 'leaflet.markercluster';
import * as L from 'leaflet';
import 'leaflet.markercluster';
import { Router } from '../routing/Router';
import { LieuAffichableAvecDistance, Coordinates, SearchRequest, TYPES_LIEUX } from '../state/State';
import { CSS_Global } from '../styles/ConstructibleStyleSheets';
Expand Down Expand Up @@ -43,8 +44,8 @@ export class VmdAppointmentMapComponent extends LitElement {

private loadMap() {
const coordinates =
this.currentSearch &&
(this.toCoordinates(this.currentSearch.commune) || this.toCoordinates(this.currentSearch.departement));
this.currentSearch instanceof SearchRequest.ByCommune &&
this.toCoordinates((this.currentSearch as SearchRequest.ByCommune).commune);
const mymap = map(this.shadowRoot!.querySelector('#appointment-map') as HTMLElement).setView(
coordinates || [46.505, 3],
13
Expand Down Expand Up @@ -87,7 +88,7 @@ export class VmdAppointmentMapComponent extends LitElement {
};
const markers = lieux
.filter((lieu) => lieu.disponible)
.reduce((markers: MarkerClusterGroup, lieu: LieuAffichableAvecDistance) => {
.reduce((markers: L.MarkerClusterGroup, lieu: LieuAffichableAvecDistance) => {
const coordinates = this.toCoordinates(lieu.location);
if (coordinates) {
var string_popup = `
Expand Down Expand Up @@ -143,7 +144,7 @@ export class VmdAppointmentMapComponent extends LitElement {
}

return markers;
}, new MarkerClusterGroup({ disableClusteringAtZoom: 9 }));
}, new L.MarkerClusterGroup({ disableClusteringAtZoom: 9 }));

return { markers, bounds };
}
Expand Down

0 comments on commit ab96172

Please sign in to comment.