Fix error without marker.json

This commit is contained in:
Blue (Lukas Rieger) 2020-04-20 18:08:51 +02:00
parent e91bb8a99f
commit f813f9d925
1 changed files with 7 additions and 4 deletions

View File

@ -13,7 +13,8 @@ export default class MarkerManager {
this.readyPromise =
this.loadMarkerData()
.then(this.loadMarkers);
.catch(ignore => {})
.then(this.loadMarkers);
$(document).on('bluemap-map-change', this.onBlueMapMapChange);
}
@ -34,9 +35,11 @@ export default class MarkerManager {
}
loadMarkers = () => {
this.markerData.markerSets.forEach(setData => {
this.markerSets.push(new MarkerSet(this.blueMap, setData));
});
if (this.markerData && this.markerData.markerSets) {
this.markerData.markerSets.forEach(setData => {
this.markerSets.push(new MarkerSet(this.blueMap, setData));
});
}
};
update(){