nitaliano / react-native-mapbox-gl

A Mapbox GL react native module for creating custom maps
Other
2.16k stars 696 forks source link

Camera moveTo lose camera padding #1714

Closed manromero closed 3 years ago

manromero commented 3 years ago

When call "moveTo" or "flyTo" of camera, padding defined as props in the camera component is lose. As workaround you can call camera.setCamera. But I think is a minor bug.

<MapboxGL.MapView
      styleURL={styleURL}
      ref={ref => (map = ref)}
      onPress={(data) => camera.flyTo(data.geometry.coordinates, 1000)}>
      <MapboxGL.Camera
        ref={ref => (camera = ref)}
        centerCoordinate={centerCoordinate}
        zoomLevel={17}
        padding={{paddingBottom: SCREEN_HEIGHT / 2}}
      />
</MapboxGL.MapView>

Regards!