Pass additional parameters to geocoders

Created on 5 December 2023, 7 months ago
Updated 13 February 2024, 4 months ago

Problem/Motivation

Several geocoder providers can use, or even require, additional parameters that are stored in the data part of the GeocodeQuery accessed with getData and setData methods. If you are building a site, or coding, knowing which gecoders are to used this is useful (to essential depending on gecoder and site requirements).

The use case I've run into this is for restricting results by countrycodes (which of course you know when someone has filled in an address field as it's the first thing they have to do) for Nominatim but a short grep threw up plenty of more use cases:-

TomTom: setData('countrySet')
Yandex: (reverseQuery) setData('toponym')
PickPoint: (reverseQuery) setData('zoom') required (defaults to 18)
Nominatim: setData('countrycodes') setData('viewbox') setData('bounded')
  (reverseQuery) setData('zoom') required (defaults to 18)
OpenCage: setData('countrycode') setData('proximity')
  also getBounds()
LocationIQ: (reverseQuery) setData('zoon') required defaults to 18
Mapbox: setData('location_type') setData('fuzzyMatch') defaults to false setData('country)'
GoogleMaps: setData('components') required setData('region') defaults to null (can be set on construction)
GoogleMapsPlaces: (both) setData('mode') required defaults to 'find'
AlgoliaPlaces: setData('type') and setData('countries') required no defaults
Here: 'country', 'state', 'county', 'city'; and open 'additionaldata'

Proposed resolution

The resolution, tasks, and API changes, for this this can be the same as Content language Active by being able to construct the GeocodeQuery that is passed. Both get fixed with the same solution.

Feature request
Status

Fixed

Version

4.0

Component

Code

Created by

🇳🇱Netherlands ekes

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024