Skip to content

About

Kotlin-first SDK for Yandex MapKit. It's API is similar to the Yandex MapKit SDK but also supports multiplatform projects and compose multiplaform, enabling you to use MapKit directly from your common source targeting iOS or Android.

Topics

Resources

Stars

73 stars

Watchers

2 watching

Forks

Latest commit

 

History

152 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yandex MapKit KMP SDK

CI Kotlin Compose Multiplatform Maven Central License badge-android badge-ios

Kotlin-first SDK for Yandex MapKit. Its API is similar to the Yandex MapKit SDK but also supports multiplatform projects and Compose Multiplatform, enabling you to use MapKit directly from your common source targeting iOS or Android.

NOTE: It is not Yandex's project. Author has no connection with original SDK, it is wrapper above official Yandex MapKit SDK

Available libraries

The following libraries are available. It uses Yandex MapKit SDK version 4.45.0-lite

Module Gradle Dependency Description
Core ru.sulgik.mapkit:yandex-mapkit-kmp:1.0.0-beta02 Features of original Yandex MapKit SDK
Compose ru.sulgik.mapkit:yandex-mapkit-kmp-compose:1.0.0-beta02 Render the map and its objects with Compose Multiplatform
Compose Resources ru.sulgik.mapkit:yandex-mapkit-kmp-compose-resources:1.0.0-beta02 Use Compose Multiplatform drawable resources as map images
Moko ru.sulgik.mapkit:yandex-mapkit-kmp-moko:1.0.0-beta02 Use moko-resources as map images. Requires native initialization
Moko Compose ru.sulgik.mapkit:yandex-mapkit-kmp-moko-compose:1.0.0-beta02 Use moko-resources as image provider. Not require native initialization

Installation

The minimum supported Android SDK is 26 (Android 8.0).

Supported iOS targets are iosArm64 and iosSimulatorArm64. The iosX64 target was dropped because Compose Multiplatform no longer publishes for it.

All modules are available for use in common code, but native API available only in native code.

On iOS the official Yandex MapKit SDK is not linked as a transitive dependency. Therefore, any project using this SDK needs to link the same Yandex MapKit SDK as well. This can be done through your preferred installation method (CocoaPods/SPM).

kotlin {
  cocoapods {
    pod("YandexMapsMobile") {
      version = "<mapkit-version>"
    }
  }
  sourceSets {
    commonMain.dependencies {
      implementation("ru.sulgik.mapkit:yandex-mapkit-kmp:<version>") // main module
      implementation("ru.sulgik.mapkit:yandex-mapkit-kmp-compose:<version>") // optional compose support
      implementation("ru.sulgik.mapkit:yandex-mapkit-kmp-compose-resources:<version>") // optional drawable resources
      implementation("ru.sulgik.mapkit:yandex-mapkit-kmp-moko:<version>") // optional: moko support
      implementation("ru.sulgik.mapkit:yandex-mapkit-kmp-moko-compose:<version>") // optional: moko compose resources support
    }
  }
}

In 1.0.0-beta01, imageProvider(Res.drawable.*) is provided by yandex-mapkit-kmp-compose. When upgrading to a release that includes yandex-mapkit-kmp-compose-resources, add that module at the same version if you use this overload. Keep the ru.sulgik.mapkit.compose.imageProvider import and your existing calls.

The unreleased Full wrapper includes text search and suggestions and driving, walking, cycling and public transit routing with ordered request points, route alternatives and cancellable sessions.

Compatibility

Within 1.x the modules guarantee source compatibility, not binary compatibility.

The wrapper follows MapKit, and MapKit adds fields to its structures and constants to its enums in minor releases. Those structures are data classes here, so a new field changes componentN and copy$default, and a new enum constant makes an exhaustive when over it stop compiling. Both are binary-breaking, and refusing them would mean freezing the wrapper on one MapKit version.

So: recompile against the version you depend on, do not mix wrapper versions in a single dependency graph, and expect a when over a wrapper enum to need a new branch after an update. Renames, removals and signature changes are reserved for a major release.

Documentation

Full documentation is at ymk-kmp.sulgik.ru, in English and Russian, with the KDoc under /kdoc.

About

Kotlin-first SDK for Yandex MapKit. It's API is similar to the Yandex MapKit SDK but also supports multiplatform projects and compose multiplaform, enabling you to use MapKit directly from your common source targeting iOS or Android.

Topics

Resources

Stars

73 stars

Watchers

2 watching

Forks

Releases

Used by

Contributors

Languages