Problem/Motivation
A customer reported that when they use the places api the pointer seems inaccurate. After looking into it it seems that this module somehow changes the actual value gotten from the maps/places api.
Steps to reproduce
Create a new clean website with the geolocation + geolocation_google_maps + geolocation_google_places_api.
* Configure the golocation maps api so you can use it
* Add a geolocation field to a node. Configure the form view to use the "Geolocation Google Maps API - Geocoding and Map" (geolocation_googlegeocoder) plugin. (default settings is fine).
* Create a node of the type you created
* Use the places api search field to search for a location (example Warsaw).
Note how the result from the places api has a slightly different value than the filled value in drupal.
Filled: 52.233207594531564, 21.061419749999963
Api: 52.22909629999999, 21.0153648
Proposed resolution
I am uncertain where this inaccuracy is added/created
Remaining tasks
Further testing might be needed i did not know how to get a similar functionality in the 4.x branch.
The above was tested on Drupal version 11.1.7 and version 3.13 of the geolocation module.
| Comment | File | Size | Author |
|---|---|---|---|
| Screenshot 2025-07-22 135844.png | 129.29 KB | hikkypo |
Comments
Comment #2
christianadamski commentedI do not have an answer ready, but the by API you mean the PHP side? Like in the geolocation GooglePlaceAPI.php Plugin?
That one calls https://maps.googleapis.com/maps/api/place/details/json under the hood.
The widget works with the JS API instead. File geolocation-google-places-api-geocoder.js in v3. Calling JS google.maps.places.PlacesService.getDetails().
I assume these give different results? Or they determine different "Place ID"?
Can you test that?
Comment #3
christianadamski commented