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]: Disabling rotation in gestureSettings doesn't work on iOS #3675

Closed
Elter71 opened this issue Nov 2, 2024 · 1 comment
Closed

[Bug]: Disabling rotation in gestureSettings doesn't work on iOS #3675

Elter71 opened this issue Nov 2, 2024 · 1 comment

Comments

@Elter71
Copy link
Contributor

Elter71 commented Nov 2, 2024

Mapbox Implementation

Mapbox

Mapbox Version

10.19.0

React Native Version

0.76.0

Platform

iOS

@rnmapbox/maps version

10.1.33

Standalone component to reproduce

import React, { useEffect } from 'react';
import { Alert } from 'react-native';
import Mapbox from '@rnmapbox/maps';
import sheet from '../../styles/sheet';
import { ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc

const ShowMap = () => {

  useEffect(() => {
    Mapbox.locationManager.start();

    return (): void => {
      Mapbox.locationManager.stop();
    };
  }, []);


  const onUserMarkerPress = (): void => {
    Alert.alert('You pressed on the user location annotation');
  };

  return (
    <>
      <Mapbox.MapView
        styleURL='mapbox://styles/mapbox/satellite-v9'
        style={sheet.matchParent}
        testID={'show-map'}
        gestureSettings={{rotateEnabled: false, simultaneousRotateAndPinchZoomEnabled: false, rotateDecelerationEnabled: false}}
      >
        <Mapbox.Camera followZoomLevel={12} followUserLocation />

        <Mapbox.UserLocation onPress={onUserMarkerPress} />
      </Mapbox.MapView>
    </>
  );
};

export default ShowMap;

Observed behavior and steps to reproduce

Simulator.Screen.Recording.-.iPhone.SE.3rd.generation.-.2024-11-02.at.16.34.29.mp4

Expected behavior

When rotateEnabled in gestureSettings is set to false, the user can't rotate the map.

Notes / preliminary analysis

No response

Additional links and references

No response

@Elter71 Elter71 added the bug 🪲 Something isn't working label Nov 2, 2024
Copy link

github-actions bot commented Nov 2, 2024

Lint failed 😭

Please fix the errors in your code example - More info.:

error: Parsing error: Unexpected token ) at example.jsx:13:13:
  11 |     Mapbox.locationManager.start();
  12 | 
> 13 |     return (): void => {
     |             ^
  14 |       Mapbox.locationManager.stop();
  15 |     };
  16 |   }, []);


1 error found.```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant