diff --git a/src/gis/components/Map.js b/src/gis/components/Map.js index 94c052fc5..646c57c59 100644 --- a/src/gis/components/Map.js +++ b/src/gis/components/Map.js @@ -166,8 +166,13 @@ export const MapProvider = props => { if (!map) { return; } + let currentSource; - const currentSource = map.getSource(name); + try { + currentSource = map.getSource(name); + } catch (error) { + console.log('Error getting source', error); + } try { const isGeoJson = source.type === 'geojson';