question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't update Camera minZoomLevel dynamically

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
RobertSasakcommented, May 10, 2020

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.

2reactions
ferdicuscommented, Mar 11, 2020

valid issue, go away stalebot

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't update Camera minZoomLevel dynamically #597 - GitHub
If the minZoomLevel prop is changed after the camera has loaded, it doesn't take effect unless the whole Camera component is reloaded and...
Read more >
How to set back camera zoom level to 0.5x using Swift?
The solution was not obvious: use AVCaptureDevice.default(.builtInTripleCamera, for: .video, position: .back) to get the real device capable of ...
Read more >
How to Control the zoom in and zoom out in scene view
In the SceneView there isn't really "zoom". It's a camera that moves forward or backwards when the mouse wheel event fires.
Read more >
Camera and view | Maps SDK for Android - Google Developers
CameraUpdateFactory.zoomTo(float) gives you a CameraUpdate that changes the zoom level to the given value, while keeping all other properties the same.
Read more >
Change Zoom advanced options for accessibility on Mac
Change the size and position of the zoom window while working using the indicated keyboard shortcuts. Set the maximum and minimum levels of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found