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