Not properly working with Google maps provider

Created on 4 August 2022, about 3 years ago
Updated 5 August 2024, about 1 year ago

Problem/Motivation

The address predictions are not coming from the google API.

Steps to reproduce

Select google maps as current provider in module settings, provide an API key.
Ensure you're not getting address prompts if a part of an address is typed in the field.

Proposed resolution

Currenlty the API endpoint id hardcoded as https://maps.googleapis.com/maps/api/geocode/json and uses address query parameter, which must contain a full address only.
Another endpoint has to be used instead: https://maps.googleapis.com/maps/api/place/autocomplete/json, it takes input query parameter instead, which can contain e.g. just a part of a street's name.

Remaining tasks

Change the api endpoint, adjust json parsing (the autocomplete api uses different json fields).
Also the autocomplete api seems not to return zip code, so this has to be done maybe with en extra query to geocode api.
The administrative area should be also handled (see comment HERE )

User interface changes

n/a

API changes

n/a

Data model changes

n/a

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇦🇹Austria granik Vienna

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024