cameraForAnnotations

abstract fun cameraForAnnotations(annotations: List<View>, edgeInsets: EdgeInsets? = null, bearing: Double? = null, pitch: Double? = null): CameraOptions?

Return camera options bound to given view annotation list, padding, bearing and pitch values. Annotations with ViewAnnotationOptions.visible set to false will be excluded from the calculations of CameraOptions. Annotations with only View.VISIBLE will be included in the calculations for CameraOptions.

Important: if the render thread did not yet calculate the size of the map (due to initialization or map resizing) - empty CameraOptions will be returned. Emptiness could be checked with CameraOptions.isEmpty. Consider using asynchronous overloaded method: `` fun cameraForAnnotations( annotations: List<View>, edgeInsets: EdgeInsets? = null, bearing: Double? = null, pitch: Double? = null, result: (CameraOptions) -> Unit ) `` Consider using this synchronous method ONLY when you are absolutely sure that map is fully ready.

Calling this API immediately after adding the view is a no-op. Please refer to OnViewAnnotationUpdatedListener documentation for understanding the exact moment of time when view annotation is positioned.

Return

CameraOptions object or NULL if annotations list is empty or map size is not yet known.

Parameters

annotations

view annotation list to be shown. Annotations should be added beforehand with ViewAnnotationManager.addViewAnnotation API.

edgeInsets

paddings to apply.

bearing

camera bearing to apply.

pitch

camera pitch to apply.


abstract fun cameraForAnnotations(annotations: List<View>, edgeInsets: EdgeInsets? = null, bearing: Double? = null, pitch: Double? = null, result: (CameraOptions) -> Unit)

Return camera options bound to given view annotation list, padding, bearing and pitch values. Annotations with ViewAnnotationOptions.visible set to false will be excluded from the calculations of CameraOptions. Annotations with only View.VISIBLE will be included in the calculations for CameraOptions

Calling this API immediately after adding the view is a no-op. Please refer to OnViewAnnotationUpdatedListener documentation for understanding the exact moment of time when view annotation is positioned.

Parameters

annotations

view annotation list to be shown. Annotations should be added beforehand with ViewAnnotationManager.addViewAnnotation API.

edgeInsets

paddings to apply.

bearing

camera bearing to apply.

pitch

camera pitch to apply.

result

CameraOptions bound to given view annotation list. Empty camera (could be checked with CameraOptions.isEmpty) is returned when annotations is an empty list.