From d4c38aa96f8404f3178031592e773a72b30df533 Mon Sep 17 00:00:00 2001 From: rahighi Date: Thu, 26 Aug 2021 13:11:23 +0430 Subject: Merge branch 'master' of https://github.com/traccar/traccar-web --- modern/src/map/ReplayPathMap.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'modern/src/map/ReplayPathMap.js') 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); + } }; }, []); -- cgit v1.2.3