Skip to content

[Bug]: Ios Crash when zoomEnabled is set #3272

@TheUncharted

Description

@TheUncharted

Mapbox Implementation

Mapbox

Mapbox Version

10.16.2

Platform

iOS

@rnmapbox/maps version

10.1.1

Standalone component to reproduce

import Mapbox from "@rnmapbox/maps";
import React, { useState } from "react";
import { StyleSheet, View } from "react-native";

void Mapbox.setAccessToken("sk...");

const MyComponent = () => {

  return (
    <View
      style={{
        gap: 16,
        flex: 1,
      }}
    >
        <Mapbox.MapView
          style={styles.map}
          logoEnabled={false}
          // scrollEnabled={false}
          pitchEnabled={false}
          zoomEnabled={false}
          scaleBarEnabled={false}
          attributionEnabled={false}
        >
          <Mapbox.Camera
            zoomLevel={14}
            defaultSettings={{
              centerCoordinate: [location.longitude, location.latitude],
            }}
            centerCoordinate={[location.longitude, location.latitude]}
          />
        </Mapbox.MapView>

    </View>
  );
};

const styles = StyleSheet.create({
  map: {
    flex: 1,
    borderRadius: 16,
  },
});

export default MyComponent;

Observed behavior and steps to reproduce

I upgraded @rnmapbox/maps" from 10.0.15 to latest version 10.1.1
The app crash when I open one of my screens where I display a small map but it doesn't crash on another screen where I use also Mapbox
By reducing the difference I noticed that when i comment the line with zoomEnabled it doesn't crash anymore
'

Expected behavior

if zoomEnabled is set to false, the app should not crash and display a map where the user can't zoom

Notes / preliminary analysis

No response

Additional links and references

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🪲Something isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions