Declare the dependencies in your libs.versions.toml:
Add the dependencies to your build.gradle.kts:
If you plan on using Compass in a project that targets both mobile and non-mobile platforms (desktop, browser, etc). Then you will need to make sure use expect/actual to provide the implementation for each platform. See Mixed platforms.
kotlin {
sourceSets {
commonMain {
dependencies {
// Geocoding
implementation(libs.compass.geocoder)
// To use geocoding you need to use one or more of the following
// Optional - Geocoder support for only iOS and Android
implementation(libs.compass.geocoder.mobile)
// Optional - Geocoder support for all platforms, but requires an API key from the service
implementation(libs.compass.geocoder.web.googlemaps)
implementation(libs.compass.geocoder.web.mapbox)
implementation(libs.compass.geocoder.web.opencage)
// Optional - If you want to create your own geocoder implementation
implementation(libs.compass.geocoder.web)
// Geolocation
implementation(libs.compass.geolocation)
// To use geolocation you need to use one or more of the following
// Optional - Geolocation support for only iOS and Android
implementation(libs.compass.geolocation.mobile)
// Optional - Geolocation support for JS/WASM Browser Geolocation API
implementation(libs.compass.geolocation.browser)
// Autocomplete
implementation(libs.compass.autocomplete)
// Optional - Autocomplete support for only iOS and Android using native Geocoder
implementation(libs.compass.autocomplete.mobile)
// Optional - Autocomplete support for all platforms, using services Geocoder APIs
implementation(libs.compass.autocomplete.geocoder.googlemaps)
implementation(libs.compass.autocomplete.geocoder.mapbox)
// Optional - If you want to create your own geocoder implementation
implementation(libs.compass.autocomplete.web)
// Optional - Location permissions for mobile
implementation(libs.compass.permissions.mobile)
}
}
}
}
kotlin {
sourceSets {
commonMain {
dependencies {
val compassVersion = "1.0.0"
// Geocoding
implementation("dev.jordond.compass:geocoder:$compassVersion")
// To use geocoding you need to use one or more of the following
// Optional - Geocoder support for only iOS and Android
implementation("dev.jordond.compass:geocoder-mobile:$compassVersion")
// Optional - Geocoder support for all platforms, but requires an API key from the service
implementation("dev.jordond.compass:geocoder-web-googlemaps:$compassVersion")
implementation("dev.jordond.compass:geocoder-web-mapbox:$compassVersion")
implementation("dev.jordond.compass:geocoder-web-opencage:$compassVersion")
// Optional - If you want to create your own geocoder implementation
implementation("dev.jordond.compass:geocoder-web:$compassVersion")
// Geolocation
implementation("dev.jordond.compass:geolocation:$compassVersion")
// To use geolocation you need to use one or more of the following
// Optional - Geolocation support for only iOS and Android
implementation("dev.jordond.compass:geolocation-mobile:$compassVersion")
// Optional - Geolocation support for JS/WASM Browser Geolocation API
implementation("dev.jordond.compass:geolocation-browser:$compassVersion")
// Autocomplete
implementation("dev.jordond.compass:autocomplete:$compassVersion")
// Optional - Autocomplete support for only iOS and Android using native Geocoder
implementation("dev.jordond.compass:autocomplete-mobile:$compassVersion")
// Optional - Autocomplete support for all platforms, using services Geocoder APIs
implementation("dev.jordond.compass:autocomplete-geocoder-googlemaps:$compassVersion")
implementation("dev.jordond.compass:autocomplete-geocoder-mapbox:$compassVersion")
// Optional - If you want to create your own geocoder implementation
implementation("dev.jordond.compass:autocomplete-web:$compassVersion")
// Optional - Location permissions for mobile (Android/iOS)
implementation("dev.jordond.compass:permissions-mobile:$compassVersion")
}
}
}
}