faster track redraw

This commit is contained in:
Fedor Katurov 2020-01-24 17:48:07 +07:00
parent c4aede5833
commit 5604d8716b
2 changed files with 7 additions and 2 deletions

View file

@ -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;