diff --git a/website/src/lib/components/map/gpx-layer/start-end-markers.ts b/website/src/lib/components/map/gpx-layer/start-end-markers.ts index 10323e762..9e67f6c94 100644 --- a/website/src/lib/components/map/gpx-layer/start-end-markers.ts +++ b/website/src/lib/components/map/gpx-layer/start-end-markers.ts @@ -31,7 +31,7 @@ export class StartEndMarkers { unsubscribes: (() => void)[] = []; constructor() { - map.onLoad(() => this.update()); + map.onLoad((map_) => map_.on('style.load', this.updateBinded)); this.unsubscribes.push(gpxStatistics.subscribe(this.updateBinded)); this.unsubscribes.push(slicedGPXStatistics.subscribe(this.updateBinded)); this.unsubscribes.push(hoveredPoint.subscribe(this.updateBinded));