I have a mapView implemented and I want to snapshot this mapView
I read the document and create a SnapshotOption like this:
let center = mapView.cameraState.center
let zoom = mapView.cameraState.zoom
let snapshotCamera = SnapshotCamera(lookingAtCenter: center, zoomLevel: zoom > 20 ? 20 : zoom)
let options = SnapshotOptions(
styleURL: styleURL,
camera: snapshotCamera,
size: mapView.bounds.size)
let snapshot = Snapshot(
options: options,
accessToken: "<accessToken>"
)
let image = snapshot.image
But it seems like the zoomLevel of SnapshotCamera is not the same with zoom level of MapView camera so the UIImage I received is zoomed more than I expected.
My question is how to convert MapView camera zoom to SnapshotCamera zoomLevel?
Thanks!
I have a mapView implemented and I want to snapshot this mapView I read the document and create a SnapshotOption like this:
But it seems like the
zoomLevel
of SnapshotCamera is not the same withzoom
level of MapView camera so theUIImage
I received is zoomed more than I expected. My question is how to convert MapView camerazoom
to SnapshotCamerazoomLevel
? Thanks!