maps icon indicating copy to clipboard operation
maps copied to clipboard

[Bug]: MarkerView coordinate on iOS is not animating

Open Crysp opened this issue 1 year ago • 1 comments

Mapbox Implementation

Mapbox

Mapbox Version

11.0.0

React Native Version

0.74.1

Platform

iOS

@rnmapbox/maps version

10.1.24

Standalone component to reproduce

import React, { useEffect } from 'react';
import { View } from 'react-native';
import MapboxGL from '@rnmapbox/maps';
import Animated, {
  useAnimatedProps,
  useSharedValue,
  withTiming,
} from 'react-native-reanimated';

const AnimatedMarkerView = Animated.createAnimatedComponent(MapboxGL.MarkerView);

const BugReportExample = () => {
  const coordinate = useSharedValue([0, 0]);
  const animatedProps = useAnimatedProps(
    () => ({
      coordinate: coordinate.value,
    }),
    [coordinate],
  );

  useEffect(() => {
    setInterval(() => {
      coordinate.value = withTiming(
        coordinate.value[0] > 0 ? [0, 0] : [10, 10],
        {
          duration: 1000,
        },
      );
    }, 3000);
  }, [coordinate]);

  return (
    <MapboxGL.MapView
      styleURL='mapbox://styles/mapbox/streets-v12'
      style={{ flex: 1 }}
    >
      <MapboxGL.Camera centerCoordinate={[0, 0]} />
      <AnimatedMarkerView
        id='me'
        anchor={{ x: 0.5, y: 0.5 }}
        allowOverlap={true}
        allowOverlapWithPuck={false}
        isSelected={false}
        animatedProps={animatedProps}
      >
        <View
          style={{
            width: 20,
            height: 20,
            borderRadius: 10,
            backgroundColor: 'red',
          }}
        />
      </AnimatedMarkerView>
    </MapboxGL.MapView>
  );
};

Observed behavior and steps to reproduce

Marker is not moving

Expected behavior

Marker should smoothly moves

Notes / preliminary analysis

#3294

Additional links and references

No response

Crysp avatar Jun 01 '24 15:06 Crysp

did you find any fix for that ?

kbvac avatar Oct 12 '25 18:10 kbvac