Open MarkOlijslagers opened 4 years ago
After some more debugging, i found out the sorting on distance function is working fine, but the location search doesn't work for me with the google maps API key.
This search is working well:
{% set entries = craft.entries.locatie({
location: { lat: 51.6208196, lng: 5.4015683 },
radius:4000
}).orderBy('distance').all() %}
{{ location.locatie.distance }} returns a good result
But search by city or address return in a zero distance:
{% set entries = craft.entries.locatie({
location: 'Maidstone, Kent',
radius:4000
}).orderBy('distance').all() %}
{{ location.locatie.distance }} returns '0' for all entries.
When using Nominatim for Geocoding, both snippets are working fine.
@MarkOlijslagers Have you enabled the Places API and Geocoding API on your Google Maps API key?
Description
Because the website (front+backend) gets really slow sometimes (using nominatim openstreetmaps and get cUrl errors) i changed the geocoding api to Google Maps. When using google maps api, sorting on distance doesn’t work anymore. After sorting al distances results in 0 km/miles.
Steps to reproduce
Additional info
Database driver&version: MySQL 5.5.64