Package-level declarations

Types

Link copied to clipboard

A state object that can be hoisted to control and observe the map's camera state. A CameraPositionState may only be used by a single YandexMap composable at a time as it reflects instance state for a single view of a map.

Link copied to clipboard
Link copied to clipboard
data class ClusterGroup(val placemarks: ImmutableList<ClusterItem>, val icon: ImageProvider, val iconStyle: IconStyle = IconStyle(), val text: String? = null, val textStyle: TextStyle = TextStyle())
Link copied to clipboard

Provides cluster icons rendered from composable content.

Link copied to clipboard
data class ClusterInfo(val size: Int)

Cluster data available to render cluster icon.

Link copied to clipboard
data class ClusterItem(val geometry: Point, val data: Any? = null)
Link copied to clipboard
data class ClusterizingConfig(val clusterRadius: Double = DefaultClusterRadius, val minZoom: Int = DefaultMinZoom)
Link copied to clipboard
Link copied to clipboard
data class MapCameraBoundsConfig(val minZoomPreference: Float? = null, val maxZoomPreference: Float? = null, val latLngBounds: BoundingBox? = null)

Config to control zoom limits and the world bounding box with Map.cameraBounds

Link copied to clipboard
data class MapConfig(val isNightModeEnabled: Boolean? = null, val poiLimit: Int? = null, val isFastTapEnabled: Boolean? = null, val isRotateGesturesEnabled: Boolean? = null, val isTiltGesturesEnabled: Boolean? = null, val isScrollGesturesEnabled: Boolean? = null, val isZoomGesturesEnabled: Boolean? = null, val mapType: MapType? = null, val mode: MapMode? = null, val mapStyle: String? = null, val isHdModeEnabled: Boolean? = null, val isIndoorEnabled: Boolean? = null, val isAwesomeModelsEnabled: Boolean? = null, val isTransparentBackgroundEnabled: Boolean? = null, val isBuildingsAboveIndoorEnabled: Boolean? = null, val cameraBounds: MapCameraBoundsConfig = MapCameraBoundsConfig(), val focusRect: ScreenRect? = null, val focusPoint: ScreenPoint? = null, val gestureFocusPoint: ScreenPoint? = null, val gestureFocusPointMode: GestureFocusPointMode? = null, val pointOfView: PointOfView? = null, val scaleFactor: Float? = null, val use2dMode: Boolean? = null, val logo: MapLogoConfig = MapLogoConfig(), val fps: Int? = null)

Config for Map and MapWindow that uses default configuration

Link copied to clipboard
data class MapLogoConfig(val alignment: LogoAlignment? = null, val padding: LogoPadding? = null)

Config to control Yandex logo object with Map.logo

Link copied to clipboard
abstract class MapObjectState<T : MapObject>

The part of a map object that a composable parameter cannot express.

Link copied to clipboard
class PlacemarkState(geometry: Point, direction: Float = 0.0f) : MapObjectState<PlacemarkMapObject>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Marks declarations that runs in custom MapComposition, outside compose-ui composition context.

Link copied to clipboard

Contains common implementation of MapWindow, that uses for controlling YandexMap

Link copied to clipboard
@RequiresOptIn(level = RequiresOptIn.Level.WARNING, message = "Targets marked by this annotation may contain breaking changes in the future as their design is still incubating.")
annotation class YandexMapsComposeExperimentalApi

Marks declarations that are still experimental.

Properties

Functions

Link copied to clipboard
fun MapKit.bindToLifecycleOwner(lifecycleOwner: LifecycleOwner = LocalLifecycleOwner.current)

Bind calling MapKit.onStart and MapKit.onStop to LifecycleOwner and composition

Link copied to clipboard
fun Circle(state: CircleState, color: Color = DefaultFillColor, strokeColor: Color = DefaultStrokeColor, strokeWidth: Float = DefaultStrokeWidth, geodesic: Boolean = DefaultGeodesic, visible: Boolean = true, zIndex: Float = 0.0f, userData: Any? = null, onTap: (Point) -> Boolean? = null)
Link copied to clipboard
fun ClusterGroup(points: List<Point>, icon: ImageProvider, iconStyle: IconStyle = IconStyle(), text: String? = null, textStyle: TextStyle = TextStyle()): ClusterGroup
Link copied to clipboard
Link copied to clipboard
fun Clustering(groups: ImmutableList<ClusterGroup>, icon: ClusterImageProvider, iconStyle: IconStyle = IconStyle(), config: ClusterizingConfig = ClusterizingConfig(), onItemTap: (ClusterItem) -> Boolean? = null, onClusterTap: (Cluster) -> Boolean? = null, visible: Boolean = true, zIndex: Float = 0.0f)
fun Clustering(groups: ImmutableList<ClusterGroup>, icon: ImageProvider, iconStyle: IconStyle = IconStyle(), config: ClusterizingConfig = ClusterizingConfig(), onItemTap: (ClusterItem) -> Boolean? = null, onClusterTap: (Cluster) -> Boolean? = null, visible: Boolean = true, zIndex: Float = 0.0f)
fun Clustering(group: ClusterGroup, icon: ClusterImageProvider, iconStyle: IconStyle = IconStyle(), config: ClusterizingConfig = ClusterizingConfig(), onItemTap: (ClusterItem) -> Boolean? = null, onClusterTap: (Cluster) -> Boolean? = null, visible: Boolean = true, zIndex: Float = 0.0f)
fun Clustering(group: ClusterGroup, icon: ImageProvider, iconStyle: IconStyle = IconStyle(), config: ClusterizingConfig = ClusterizingConfig(), onItemTap: (ClusterItem) -> Boolean? = null, onClusterTap: (Cluster) -> Boolean? = null, visible: Boolean = true, zIndex: Float = 0.0f)

fun Clustering(groups: ImmutableList<ClusterGroup>, iconStyle: IconStyle = IconStyle(), config: ClusterizingConfig = ClusterizingConfig(), onItemTap: (ClusterItem) -> Boolean? = null, onClusterTap: (Cluster) -> Boolean? = null, visible: Boolean = true, zIndex: Float = 0.0f, content: @Composable (ClusterInfo) -> Unit)
fun Clustering(group: ClusterGroup, iconStyle: IconStyle = IconStyle(), config: ClusterizingConfig = ClusterizingConfig(), onItemTap: (ClusterItem) -> Boolean? = null, onClusterTap: (Cluster) -> Boolean? = null, visible: Boolean = true, zIndex: Float = 0.0f, content: @Composable (ClusterInfo) -> Unit)

Clustering with cluster icons rendered from composable content.

Link copied to clipboard
fun ComposeMapObjectRendererHost(renderer: ComposeMapObjectRenderer = rememberComposeMapObjectRenderer(), content: @Composable () -> Unit)

Provides renderer to content and renders content passed to imageProvider and clusterImageProvider inside it.

Link copied to clipboard

Renders content into ImageProvider to use it as map object icon.

fun imageProvider(resource: DrawableResource): ImageProvider
Link copied to clipboard
fun MapControllerEffect(controller: YandexMapController, dispose: (MapWindow) -> Unit = {}, block: (MapWindow) -> Unit)
fun MapControllerEffect(controller: YandexMapController, key1: Any?, dispose: (MapWindow) -> Unit = {}, block: (MapWindow) -> Unit)
fun MapControllerEffect(controller: YandexMapController, vararg keys: Any?, dispose: (MapWindow) -> Unit = {}, block: (MapWindow) -> Unit)
fun MapControllerEffect(controller: YandexMapController, key1: Any?, key2: Any?, dispose: (MapWindow) -> Unit = {}, block: (MapWindow) -> Unit)
fun MapControllerEffect(controller: YandexMapController, key1: Any?, key2: Any?, key3: Any?, dispose: (MapWindow) -> Unit = {}, block: (MapWindow) -> Unit)
Link copied to clipboard
fun MapEffect(key1: Any?, block: suspend CoroutineScope.(Map) -> Unit)

A side-effect backed by a LaunchedEffect which will launch block and provide the underlying managed YandexMap object into the composition's CoroutineContext. This effect will be re-launched when a different key1 is provided.

fun MapEffect(vararg keys: Any?, block: suspend CoroutineScope.(Map) -> Unit)

A side-effect backed by a LaunchedEffect which will launch block and provide the underlying managed YandexMap object into the composition's CoroutineContext. This effect will be re-launched when a different keys is provided.

fun MapEffect(key1: Any?, key2: Any?, block: suspend CoroutineScope.(Map) -> Unit)

A side-effect backed by a LaunchedEffect which will launch block and provide the underlying managed YandexMap object into the composition's CoroutineContext. This effect will be re-launched when a different key1 or key2 is provided.

fun MapEffect(key1: Any?, key2: Any?, key3: Any?, block: suspend CoroutineScope.(Map) -> Unit)

A side-effect backed by a LaunchedEffect which will launch block and provide the underlying managed YandexMap object into the composition's CoroutineContext. This effect will be re-launched when a different key1, key2 or key3 is provided.

Link copied to clipboard
fun MapListeners(onMapTap: (Point) -> Unit? = null, onMapLongTap: (Point) -> Unit? = null, onGeoObjectTap: (GeoObjectTapEvent) -> Boolean? = null, onMapLoaded: (MapLoadStatistics) -> Unit? = null, onActivePlanFocused: (IndoorPlan) -> Unit? = null, onActivePlanLeft: () -> Unit? = null, onActiveLevelChanged: (String) -> Unit? = null, onMapWindowSizeChanged: (width: Int, height: Int) -> Unit? = null)

Subscribes to the map events for as long as this composable stays in the composition.

Link copied to clipboard
fun MapObjectCollection(state: MapObjectCollectionState = rememberMapObjectCollectionState(), visible: Boolean = true, zIndex: Float = 0.0f, userData: Any? = null, onTap: (Point) -> Boolean? = null, content: @Composable () -> Unit)

Groups the map objects of content into a nested MapObjectCollection.

Link copied to clipboard
fun MapObjectLayer(layerId: String, content: @Composable () -> Unit)

Puts the map objects of content into an independent collection linked to layerId, instead of the default collection of the map.

Link copied to clipboard
fun Placemark(state: PlacemarkState, iconStyle: IconStyle = IconStyle(), visible: Boolean = true, draggable: Boolean = false, zIndex: Float = 0.0f, opacity: Float = 1.0f, userData: Any? = null, onTap: (Point) -> Boolean? = null, content: @Composable () -> Unit)

Placemark with icon rendered from composable content.

fun Placemark(state: PlacemarkState, icon: ImageProvider, iconStyle: IconStyle = IconStyle(), onTap: (Point) -> Boolean? = null, visible: Boolean = true, draggable: Boolean = false, zIndex: Float = 0.0f, opacity: Float = 1.0f, userData: Any? = null)
Link copied to clipboard
fun Polygon(state: PolygonState, color: Color = DefaultFillColor, strokeColor: Color = DefaultStrokeColor, strokeWidth: Float = DefaultStrokeWidth, geodesic: Boolean = DefaultGeodesic, pattern: ImageProvider? = null, patternScale: Float = 1.0f, visible: Boolean = true, zIndex: Float = 0.0f, userData: Any? = null, onTap: (Point) -> Boolean? = null)
Link copied to clipboard
fun Polyline(state: PolylineState, strokeColor: Color = DefaultStrokeColor, strokeWidth: Float = DefaultStrokeWidth, gradientLength: Float = DefaultGradientLength, outlineWidth: Float = DefaulOutlineWidth, outlineColor: Color = DefaultOutlineColor, innerOutlineEnabled: Boolean = false, turnRadius: Float = DefaultTurnRadius, dashLength: Float = DefaultDashLength, gapLength: Float = DefaultGapLength, dashOffset: Float = DefaultDashOffset, visible: Boolean = true, zIndex: Float = 0.0f, userData: Any? = null, onTap: (Point) -> Boolean? = null)
Link copied to clipboard

Remember global MapKit instance and initialize it on Android

Remember global MapKit instance and initialize it on Android

Remember global MapKit instance and initialize it on Android

Link copied to clipboard
inline fun rememberCameraPositionState(key: String? = null, crossinline init: CameraPositionState.() -> Unit = {}): CameraPositionState

Create and rememberSaveable a CameraPositionState using CameraPositionState.Saver. init will be called when the CameraPositionState is first created to configure its initial state.

Link copied to clipboard

Uses rememberSaveable to retain CircleState.geometry across configuration changes, for simple use cases.

Link copied to clipboard
Link copied to clipboard

Remember global MapKit instance

Link copied to clipboard
fun rememberPlacemarkState(geometry: Point, direction: Float = 0.0f, key: String? = null): PlacemarkState

Uses rememberSaveable to retain PlacemarkState.geometry and PlacemarkState.direction across configuration changes, for simple use cases.

Link copied to clipboard
Link copied to clipboard

Uses rememberSaveable to retain PolylineState.geometry across configuration changes, for simple use cases.

Link copied to clipboard

Create and remember YandexMapController. Don't pass to multiple YandexMap. Don't save it anywhere, contains native references.

Link copied to clipboard
fun TileLayer(layerId: String, options: LayerOptions = LayerOptions(), active: Boolean = true, styleId: Int = 0, style: String? = null, onLayerLoaded: () -> Unit? = null, onDataSourceUpdated: (BaseDataSource) -> Unit? = null, createTileDataSource: (builder: TileDataSourceBuilder) -> Unit)

Adds a custom tile layer for as long as this composable stays in the composition.

Link copied to clipboard
fun TitledPlacemark(state: PlacemarkState, icon: ImageProvider, title: String, iconStyle: IconStyle = IconStyle(), titleStyle: TextStyle = TextStyle(), onTap: (Point) -> Boolean? = null, visible: Boolean = true, draggable: Boolean = false, zIndex: Float = 0.0f, opacity: Float = 1.0f, userData: Any? = null)
Link copied to clipboard
actual fun ERROR CLASS: Symbol not found for ImageBitmap.toImageProvider(): ERROR CLASS: Symbol not found for ImageProvider
Link copied to clipboard
fun ERROR CLASS: Symbol not found for Bitmap.toUIImage(scale: Double = 1.0): ERROR CLASS: Symbol not found for UIImage

Converts bitmap to UIImage with given scale.

Link copied to clipboard
fun TrafficLayer(visible: Boolean = true, style: String? = null, onTrafficChanged: (TrafficLevel?) -> Unit? = null, onTrafficLoading: () -> Unit? = null, onTrafficExpired: () -> Unit? = null)

Shows the traffic layer for as long as this composable stays in the composition.

Link copied to clipboard
fun YandexMap(controller: YandexMapController = rememberYandexMapController(), modifier: Modifier = Modifier)
fun YandexMap(cameraPositionState: CameraPositionState = rememberCameraPositionState(), modifier: Modifier = Modifier, config: MapConfig = MapConfig(isNightModeEnabled = isSystemInDarkTheme()), content: @Composable () -> Unit = {})
fun YandexMap(locationState: UserLocationState, modifier: Modifier = Modifier, cameraPositionState: CameraPositionState = rememberCameraPositionState(), locationConfig: UserLocationConfig = UserLocationConfig(), config: MapConfig = MapConfig(isNightModeEnabled = isSystemInDarkTheme()), content: @Composable () -> Unit = {})