ClusterKit icon indicating copy to clipboard operation
ClusterKit copied to clipboard

How to animate the position of a marker/cluster with Mapbox?

Open zilions opened this issue 5 years ago • 2 comments

Is it possible to animate the position of a marker/cluster that is created with ClusterKit when used with Mapbox?

Mapbox supports this with native markers, although the same code does not work when applied to ClusterKit. Here is a demo on how Mapbox do this on iOS - https://docs.mapbox.com/android/maps/examples/animate-marker-position/

At the moment, we are having to destroy the cluster and rebuild it at the new coordinates, which is not a very nice user experience since it looks like the cluster is disappearing from one location and appearing at another - almost like it is jumping coordinates very quickly. We would like to animate the position of the cluster so that it appears like it is smoothly transitioning from one location to another.

We're also tried a few suggestions from this thread, although none seemed to work - https://github.com/mapbox/mapbox-gl-native/issues/8378#issuecomment-287910768

When attempting to apply any of the above solutions, the cluster/marker refuses to move position, and instead, it just stays at its original coordinates.

Is animating the position of a marker/cluster currently possible with ClusterKit?

zilions avatar Mar 19 '19 04:03 zilions

Any update on this? I am trying to achieve the same thing on my iOS project but no luck so far. I want to move marker from point A to point B with animation.

prgorasiya avatar Jul 29 '19 09:07 prgorasiya

@zilions @prgorasiya check out my PR https://github.com/hulab/ClusterKit/pull/80 regarding animations

aramsargsyan avatar Mar 28 '20 14:03 aramsargsyan