Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: MarkerView coordinate on iOS is not animating #3504

Open
Crysp opened this issue Jun 1, 2024 · 0 comments
Open

[Bug]: MarkerView coordinate on iOS is not animating #3504

Crysp opened this issue Jun 1, 2024 · 0 comments
Labels
bug 🪲 Something isn't working

Comments

@Crysp
Copy link

Crysp commented Jun 1, 2024

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 Crysp added the bug 🪲 Something isn't working label Jun 1, 2024
@github-actions github-actions bot closed this as completed Jun 1, 2024
@github-actions github-actions bot reopened this Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant