craft-coordinates icon indicating copy to clipboard operation
craft-coordinates copied to clipboard

Keyless API calls are deprecated

Open denisyilmaz opened this issue 6 years ago • 2 comments

since two days Google Maps API refuses to return Longitude/Latitude without having an valid API key.

{
   "error_message" : "Keyless access to Google Maps Platform is deprecated. Please use an API key with all your API calls to avoid service interruption. For further details please refer to http://g.co/dev/maps-no-account",
   "results" : [],
   "status" : "OVER_QUERY_LIMIT"
}

denisyilmaz avatar Sep 17 '18 12:09 denisyilmaz

You need to modify this file: coordinates -> services -> CoordinatesService.php

from this:

$data = file_get_contents('http://maps.googleapis.com/maps/api/geocode/json?address=' . urlencode($address));

to this:

$data = file_get_contents('https://maps.googleapis.com/maps/api/geocode/json?key=YOUR_KEY&address=' . urlencode($address));

two things need to be changed:

  1. requests must be over https
  2. you need to enter a API key (without any restrictions).

Hope that helps. Stefan

outline4 avatar Oct 09 '18 10:10 outline4

yes, I actually did it exactly as you described. I just thought it might be helpful for people having the same issue because the plugin doesn't make it clear, as in the README.md it's described as a "keyless" plugin. maybe I will create a pull request if I find the time for the edits.

denisyilmaz avatar Oct 09 '18 12:10 denisyilmaz