mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 19:16:41 +07:00
faster track redraw
This commit is contained in:
parent
c4aede5833
commit
5604d8716b
2 changed files with 7 additions and 2 deletions
|
@ -20,13 +20,13 @@ const GpxPolyline: FC<IProps> = ({ latlngs, color }) => {
|
||||||
setLayer(item);
|
setLayer(item);
|
||||||
|
|
||||||
return () => MainMap.removeLayer(item);
|
return () => MainMap.removeLayer(item);
|
||||||
}, [MainMap, color, latlngs]);
|
}, [MainMap]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!layer) return;
|
if (!layer) return;
|
||||||
|
|
||||||
layer.setLatLngs(latlngs);
|
layer.setLatLngs(latlngs);
|
||||||
layer.options.color = color;
|
layer.setStyle({ color });
|
||||||
}, [latlngs, layer, color]);
|
}, [latlngs, layer, color]);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -52,6 +52,11 @@
|
||||||
width: 8px;
|
width: 8px;
|
||||||
height: 8px;
|
height: 8px;
|
||||||
border-radius: 100%;
|
border-radius: 100%;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
// span {
|
||||||
|
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue