Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MapboxMap and Snapshotter camera(for:padding:bearing:pitch:) methods don't set padding #2165

Open
marcoboerner opened this issue Apr 17, 2024 · 3 comments
Labels
bug 🪲 Something is broken!

Comments

@marcoboerner
Copy link

Environment

  • Xcode version: 15.3
  • iOS version: 16.x, 17.x
  • Maps SDK Version: 11.3.0

Observed behavior and steps to reproduce

When using the camera(for:padding:bearing:pitch:) Methods of MapboxMap or Snapshotter, the padding in the CameraOptions is always nil.

Expected behavior

The padding should not be nil if it has been set with these methods.

Notes / preliminary analysis

As a workaround, when setting the padding property manually after creating the CameraOptions, everything works as intended.

@marcoboerner marcoboerner added the bug 🪲 Something is broken! label Apr 17, 2024
@marcoboerner marcoboerner changed the title MapbocMap and Snapshotter camera(for:padding:bearing:pitch:) Methods don't set Padding MapboxMap and Snapshotter camera(for:padding:bearing:pitch:) Methods don't set Padding Apr 17, 2024
@marcoboerner marcoboerner changed the title MapboxMap and Snapshotter camera(for:padding:bearing:pitch:) Methods don't set Padding MapboxMap and Snapshotter camera(for:padding:bearing:pitch:) methods don't set padding Apr 17, 2024
@persidskiy
Copy link
Contributor

Hi, if you are using this method, it is deperecated now as it was quite counter-intuitive https://docs.mapbox.com/ios/maps/api/11.3.0/documentation/mapboxmaps/mapboxmap/camera(for:padding:bearing:pitch:)-5juqy

If you want the resulting camera to have the specific padding, use this method https://docs.mapbox.com/ios/maps/api/11.3.0/documentation/mapboxmaps/mapboxmap/camera(for:camera:coordinatespadding:maxzoom:offset:)

let camera = map.camera(for:coordinates, camera: CameraOptions(padding: ..desired padding here))

Note: The coordinatesPadding parameter is different to camera.padding.

@marcoboerner
Copy link
Author

@persidskiy I did change this for the MapboxMap methods and it works.However, the Snapshotter doesn't have those new methods yet, but the same issue exists. In this case, it only works when we set the padding on the CameraOptions object manually again after creating it.

@persidskiy
Copy link
Contributor

@marcoboerner Thank you for reporting this, the method should be available in Snapshotter too.

Internal ticket to track: https://mapbox.atlassian.net/browse/MAPSIOS-1323

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something is broken!
Projects
None yet
Development

No branches or pull requests

2 participants