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
  • Obtain an API key
  • Create the Geocoder

Was this helpful?

Edit on GitHub
  1. Geocoding
  2. Web API Service

Google Maps

PreviousWeb API ServiceNextMapbox

Last updated 1 year ago

Was this helpful?

To use as your geocoding backend you will need to do the following:

Obtain an API key

  1. First you will need to

  2. Create the

  3. Copy your key

Create the Geocoder

Simple pass your API key to the Geocoder function:

val geocoder = GoogleMapsGeocoder(apiKey = "your-api-key")

// Or this helper function
val geocoder = Geocoder(apiKey = "your-api-key")

Customizing Google Maps request

The Google Maps geocoding API has some . You can modify these by passing them into the Geocoder function:

val geocoder = GoogleMapsGeocoder(apiKey = "your-api-key") {
    locationTypes(GoogleMapsLocationType.GeometricCenter)
}
📈
Google Maps API
create a cloud project and enable the API
API key
optional parameters