Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Google Maps

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

Obtain an API key

  1. Create the API key

  2. 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 optional parameters. You can modify these by passing them into the Geocoder function:

val geocoder = GoogleMapsGeocoder(apiKey = "your-api-key") {
    locationTypes(GoogleMapsLocationType.GeometricCenter)
}

Last updated

Was this helpful?