From 77959fd0db0653ed4283d941063fa530802f2269 Mon Sep 17 00:00:00 2001 From: GabrielTrettel Date: Tue, 23 Nov 2021 20:54:44 -0300 Subject: [PATCH] Fixing undefined location in mapForm when not allowing location. --- src/app/components/map/OpenStreetMap.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/components/map/OpenStreetMap.js b/src/app/components/map/OpenStreetMap.js index b5b630b..42754e1 100644 --- a/src/app/components/map/OpenStreetMap.js +++ b/src/app/components/map/OpenStreetMap.js @@ -49,7 +49,9 @@ export default function OpenStreetMap({ const [mapRef, setMapRef] = useState(null); const webviewContent = html_content; const [markerListener, setMarkerListener] = useState(null); - const viewFunction = setViewCode(global.location.lat, global.location.long, global.location.zoom); + + const _location = global.location || global.defaultLocation + const viewFunction = setViewCode(_location.lat, _location.long, _location.zoom); const markersList = MapMarkerList({ markers: markers,