cameraForCoordinates

open fun cameraForCoordinates(@NonNull coordinates: List<Point>, @Nullable padding: EdgeInsets, @Nullable bearing: Double, @Nullable pitch: Double): CameraOptions

Convenience method that returns the `camera options` object for given parameters. This method takes into account the current map padding in addition to the padding provided in parameters.

Return

The `camera options` object representing the provided parameters. Padding is absent in the returned `camera options` as the zoom level already accounts for the padding.

Parameters

coordinates

The `coordinates` representing the bounds of the camera.

padding

The amount of padding in pixels to add to the given `coordinates`.

bearing

The bearing of the camera.

pitch

The pitch of the camera.


Convenience method that adjusts the provided `camera options` object for given parameters. Returns the provided `camera` options with zoom adjusted to fit `coordinates` into the `box`, so that `coordinates` on the left, top, right, and bottom of the effective `camera` center at the principal point of the projection (defined by `padding`) fit into the `box`. Returns the provided `camera` options object unchanged upon an error. The method fails if the principal point is positioned outside of the `box` or if there is no sufficient screen space, defined by principal point and the `box`, to fit the geometry. Additionally, in cases when the principal point is positioned exactly on one of the edges of the `box`, any geometry point that spans further than that edge on the same axis cannot possibly be framed and is ignored for zoom level calculation purposes. This API isn't supported by Globe projection.

Return

The `camera options` object with the zoom level adjusted to fit `coordinates` into the `box`.

Parameters

coordinates

The `coordinates` representing the bounds of the camera.

camera

The `camera options` for which zoom should be adjusted. Note that the `camera.center`, and `camera.zoom` (as fallback) is required.

box

The `screen box` into which `coordinates` should fit.