Compass 🧭
GithubReferenceMaven
  • 🧭Compass
  • 🖥️Artifacts
  • 🚗Roadmap
  • Setup
    • 📇All Dependencies
    • 🤖Android / iOS
    • 📱Mixed platforms
  • Geocoding
    • 🌎Geocoding Overview
    • 📈Web API Service
      • Google Maps
      • Mapbox
    • ❓Request a Geocoder API
  • Geolocation
    • 📍Geolocation Overview
    • 🔍Geolocator
    • 🌐Location
    • 📱Android / iOS
    • 🖥️Browser
  • Autocomplete
    • 🔍Autocomplete Overview
    • 🌎Via Geocoding
      • 📱Android / iOS
      • 📈Web API Service
  • Misc
    • 📲Demo
    • 💾Contributing
    • 🔧Compass Reference
Powered by GitBook
On this page
  • Overview
  • Features
  • Easy to use
  • Get Started

Was this helpful?

Edit on GitHub

Compass

NextArtifacts

Last updated 1 year ago

Was this helpful?

Overview

Compass is a Kotlin Multiplatform library location toolkit. It provides a set of tools for working with location data, including geocoding, reverse geocoding, and more. The library is built with a focus on simplicity and ease of use, providing a straightforward API for geocoding operations.

Features

  • Geocoding

    • Native support for Android and iOS

    • Support for other platforms by using web based APIs

      • Included support for and

      • See Web API Service

  • Geolocation

    • Mobile support (Android/iOS)

    • Browser

    • Built-in permission handling

  • Autocomplete

    • Mobile support (Android/iOS) via Geocoder

    • Support for other platforms by using web based APIs

      • Included support for and via the Decoder API

      • Google Places API support is planned

Easy to use

Compass has a simple API:

suspend fun lookupCoordinates(latitude: Double, longitude: Double): Place? {
    val geocoder = Geocoder()
    val result: GeocoderResult<Place> = geocoder.reverse(latitude, longitude)
    return result.getOrNull()
}

The above Geocoder() function is one of many extension functions included to make your life easier. Behind the scenes a PlatformGeocoder is used to do all the heavy lifting, and can be created and provided on a per-platform basis.

You can learn more about geocoding here: Geocoding Overview

The above Geocoder()extension function is from the Android/iOS only artifact. If you plan on supporting other platforms, check out Mixed platforms.

Get Started

Here is a few good starting points to start using Compass!

🧭
📇Setup
🖥️Artifacts
📇All Dependencies
Google Maps
Mapbox
Geolocation API
Google Maps
Mapbox