diff --git a/src/views/Home/components/ActionDock/index.js b/src/views/Home/components/ActionDock/index.js index a430cac..91801ba 100644 --- a/src/views/Home/components/ActionDock/index.js +++ b/src/views/Home/components/ActionDock/index.js @@ -85,7 +85,14 @@ export default function ActionDock({ }) { const viewItem = useMemo(() => viewKey ? VIEWS.filter(o => o.id === viewKey)[0].children : VIEWS, [viewKey, VIEWS]) const dispatch = useDispatch(); - + const removePoint = () => { + const map = window.__mapref; + const layer = map.getLayer('关联站点') + if (layer) { + map.removeLayer('关联站点'); + map.removeSource('关联站点'); + } + } return (
@@ -97,6 +104,7 @@ export default function ActionDock({ }) { setViewKey(null) dispatch.runtime.setScya(false) dispatch.runtime.setGwtc(false) + removePoint() }}>
@@ -136,6 +144,7 @@ export default function ActionDock({ }) { } else { sessionStorage.setItem('point','') } + removePoint() } }}>