From 5604d8716b0e25b221d6406a85b97ecd7429b532 Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Fri, 24 Jan 2020 17:48:07 +0700 Subject: [PATCH] faster track redraw --- src/map/GpxPolyline/index.tsx | 4 ++-- src/styles/gpx.less | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/map/GpxPolyline/index.tsx b/src/map/GpxPolyline/index.tsx index 560ba5d..c870d49 100644 --- a/src/map/GpxPolyline/index.tsx +++ b/src/map/GpxPolyline/index.tsx @@ -20,13 +20,13 @@ const GpxPolyline: FC = ({ latlngs, color }) => { setLayer(item); return () => MainMap.removeLayer(item); - }, [MainMap, color, latlngs]); + }, [MainMap]); useEffect(() => { if (!layer) return; layer.setLatLngs(latlngs); - layer.options.color = color; + layer.setStyle({ color }); }, [latlngs, layer, color]); return null; diff --git a/src/styles/gpx.less b/src/styles/gpx.less index 2b47f32..f46c62c 100644 --- a/src/styles/gpx.less +++ b/src/styles/gpx.less @@ -52,6 +52,11 @@ width: 8px; height: 8px; border-radius: 100%; + cursor: pointer; + + // span { + + // } } }