Open mfazekas opened 4 months ago
Hey, @mfazekas I'm currently working on the issues with camera(for:) and will take a look at this too. Thank you, for the reproduction steps!
Hi @aleksproger - any updates on findings for this issue?
@mfazekas hey! do you observe similar problem in Android in v11.4.0-rc.1 when using async overload of cameraForCoordinates
which makes sure that viewport is set properly.
@kiryldz sorry, I cannot comment on that, this was reported as an iOS only issue, so this might not have surfaced on android beacuse timing or other
+1 on this
camera(for coordinates:camera:coordinatesPadding:maxZoom:offset:)
behaves inconsistently in my app.
The zoom is smaller than expected in some scenarios.
SDK Version (iOS): v11.5.1
I have to stay on v10.x until it's fixed :( Hope a fix can be found soon.
Environment
Observed behavior and steps to reproduce
CameraOptions
calculated forcamera(for: coordinates)
just after map is added to a view is smaller than when calculated fromonStyleDataLoaded
When calculated just after map added to a view the zoom is less than the ideal (:
When calculated from
onStyleDataLoaded
the zoom is correct:To reproduce use the code snippet at the end of the report to replace
BasicMapExample
in theApps/Examples
Xcode project. Observe the zoom values printed and uncomment the setCamera inonStyleDataLoaded
handler to verify that that the zoom value is correct there.Expected behaviour
Either
camera(for:)
should return an error, so signal that it's not in the state to calculate CameraOption correctly or return the correct camera settings (zoom!) for the actual bounds. I don't think any map loading is needed for that calculation.Notes / preliminary analysis
Additional links and references
https://github.com/rnmapbox/sponsors/issues/3