Added error handling for leaflet initialisation errors
This commit is contained in:
parent
75fad90880
commit
7988f8c2d9
|
@ -283,6 +283,8 @@
|
||||||
if (mapInstance) {
|
if (mapInstance) {
|
||||||
mapInstance.remove()
|
mapInstance.remove()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
mapInstance = L.map(embeddedMapId, mapOptions)
|
mapInstance = L.map(embeddedMapId, mapOptions)
|
||||||
mapMarkerGroup.addTo(mapInstance)
|
mapMarkerGroup.addTo(mapInstance)
|
||||||
candidateMarkerGroup.addTo(mapInstance)
|
candidateMarkerGroup.addTo(mapInstance)
|
||||||
|
@ -304,6 +306,9 @@
|
||||||
|
|
||||||
// Reset view
|
// Reset view
|
||||||
resetView()
|
resetView()
|
||||||
|
} catch (e) {
|
||||||
|
console.log("There was a problem with the map", e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleMapClick = e => {
|
const handleMapClick = e => {
|
||||||
|
|
Loading…
Reference in New Issue