mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-24 18:46:40 +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);
|
||||
|
||||
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;
|
||||
|
|
|
@ -52,6 +52,11 @@
|
|||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 100%;
|
||||
cursor: pointer;
|
||||
|
||||
// span {
|
||||
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue