Fix error when marker set is removed when changing between maps on the same world

This commit is contained in:
James Lyne 2022-02-23 13:58:32 +00:00
parent 61b2a59e2a
commit 61194c9c99

View File

@ -82,10 +82,13 @@ export default defineComponent({
watch(currentMap, (newValue, oldValue) => {
if(newValue && (!oldValue || oldValue.world === newValue.world)) {
converter = newValue.locationToLatLng.bind(newValue);
//Prevent error if this marker set has just been removed due to the map change
if(nonReactiveState.markers.has(props.set.id)) {
converter = newValue.locationToLatLng.bind(newValue);
for (const [id, area] of nonReactiveState.markers.get(props.set.id)!) {
updateMarkerLayer(layers.get(id), area, converter);
for (const [id, area] of nonReactiveState.markers.get(props.set.id)!) {
updateMarkerLayer(layers.get(id), area, converter);
}
}
}
});