Skip to content

Commit 1767636

Browse files
committed
fix(incidents-map): ensure source not created
1 parent 18ab47e commit 1767636

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libs/incidents/map/src/lib/exploring-map/incidents-map.page.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ export class IncidentsMapPage {
6767
})),
6868
} as FeatureCollection<Geometry, IIncidentMarker>;
6969

70+
const source = mlMap.getSource(incidentsSource) as maplibregl.GeoJSONSource;
71+
if (source) {
72+
source.setData(markerCollection);
73+
return;
74+
}
75+
7076
mlMap.addSource(incidentsSource, {
7177
type: 'geojson',
7278
data: markerCollection,

0 commit comments

Comments
 (0)