Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Method for getting map camera settings from polyline, bearing, bounds and insets #9809

@d-prukop

Description

@d-prukop

This method should accept a polyline, a bearing, a bounding rectangle in pixels and an object defining padding in pixels on all sides. It should then return a center coordinate and a zoom level appropriate for showing the given polyline in the given bounds at the given bearing.

This is basically what's already happening in fitBounds. The only difference is that this returns the calculated values so that the developer can handle the fitting of the bounds using any transition they want.

getCamera(polyline: Array<LngLat>, bounds:Array<Point>, insets: Array<Float>, bearing: Float) {
  return {zoomLevel: Float, centerCoord: LngLat, bearing: Float}
}

cc @mapbox/gl @pveugen

Metadata

Metadata

Labels

CoreThe cross-platform C++ core, aka mbglfeaturenavigationFor the Mapbox Navigation SDK for Android or iOS or navigation use cases in general

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions