aboutsummaryrefslogtreecommitdiff
path: root/modern/src/map/AccuracyMap.js
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/map/AccuracyMap.js')
-rw-r--r--modern/src/map/AccuracyMap.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/modern/src/map/AccuracyMap.js b/modern/src/map/AccuracyMap.js
index 4baa105..5734ee8 100644
--- a/modern/src/map/AccuracyMap.js
+++ b/modern/src/map/AccuracyMap.js
@@ -36,8 +36,12 @@ const AccuracyMap = () => {
});
return () => {
- map.removeLayer(id);
- map.removeSource(id);
+ if (map.getLayer(id)) {
+ map.removeLayer(id);
+ }
+ if (map.getSource(id)) {
+ map.removeSource(id);
+ }
};
}, []);