Smooth effect to device movement

LadyProgrammera year ago

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]);
Cristiana year ago

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.

Cristiana year ago
LadyProgrammera year ago

Thank you Cristian!

Andreasa year ago

Anyone found a solution to this problem? Can page's refresh rate improved in any way?

Thanks

Rafail Stratiotis2 months ago

Anyone found a solution?