I want to add smooth effect to device movement, I tried a lot of time, can anyone help, in map/MapPostion.js useFetch hook I think I must add here some time or duration?
useEffect(() => {
map.getSource(id)?.setData({
type: 'FeatureCollection',
features: positions.filter((it) => devices.hasOwnProperty(it.deviceId)).map((position) => ({
type: 'Feature',
geometry: {
type: 'Point',
coordinates: [position.longitude, position.latitude],
},
properties: createFeature(devices, position, selectedPosition && selectedPosition.id),
})),
});
}, [mapCluster, clusters, direction, onMarkerClick, onClusterClick, devices, positions, selectedPosition]);
I read on the forum that the problem was that every time the device updates position the page refreshes, and that did not allow to get the motion effect. if I find the thread I will share it.
Anyone found a solution to this problem? Can page's refresh rate improved in any way?
Thanks
I want to add smooth effect to device movement, I tried a lot of time, can anyone help, in map/MapPostion.js useFetch hook I think I must add here some time or duration?
useEffect(() => { map.getSource(id)?.setData({ type: 'FeatureCollection', features: positions.filter((it) => devices.hasOwnProperty(it.deviceId)).map((position) => ({ type: 'Feature', geometry: { type: 'Point', coordinates: [position.longitude, position.latitude], }, properties: createFeature(devices, position, selectedPosition && selectedPosition.id), })), }); }, [mapCluster, clusters, direction, onMarkerClick, onClusterClick, devices, positions, selectedPosition]);