If the minZoomLevel prop is changed after the camera has loaded, it doesn't take effect unless the whole Camera component is reloaded and reset.
<Mapbox.Camera
ref={ref => this.cameraRef = ref}
animationMode="moveTo"
animationDuration={3000}
minZoomLevel={limitZoom ? 7 : 2}
maxZoomLevel={18}
/>
Update: this also seems to apply to maxBounds and likely other props that might be good to update dynamically.
Android
React Native: 0.61.5
@react-native-mapbox-gl/maps: 7.0.4
Thanks for reporting. This is a good first PR.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
valid issue, go away stalebot
I would like to make PR. Can you please explain me briefly how to fix it?
@RobertSasak i think it's because:
so we turn off normal update by react and we use
to do the updates, and minZoomLevel is propbably not handled
I'm having this issue ,on 10% of times it is working correctly but not at 90% , I'm not sure about how :D
I guess it is because 10% of the time your map component is completely rerendering. minZoomLevel works on first mounting of the component.
I still do have a plan to make a PR.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
I guess it is because 10% of the time your map component is completely rerendering. minZoomLevel works on first mounting of the component.
I still do have a plan to make a PR.