Closed AlifAbhiesa closed 5 years ago
And i already placed my API KEY in here, but still doesn't work
Hello @AlifAbhiesa ,
Have a look at the constructor : https://github.com/geocoder-php/google-maps-provider/blob/master/GoogleMaps.php#L97 You'll see that the last parameter is your key.
So it should be something like this:
new GoogleMaps($client, null, 'myApiKey');
@AlifAbhiesa Did you get this resolved?
@atymic
i put the key manually on this function
on this file
FYI : i'm using composer
@AlifAbhiesa
You should not modify parts of the library, could you post the code you are using to do the geocode? You should just be using something like this:
use Geocoder\Query\GeocodeQuery;
use Geocoder\Query\ReverseQuery;
$httpClient = new \Http\Adapter\Guzzle6\Client();
$provider = new \Geocoder\Provider\GoogleMaps\GoogleMaps($httpClient, 'YOURAPIKEYHERE');
$geocoder = new \Geocoder\StatefulGeocoder($provider, 'en');
$result = $geocoder->geocodeQuery(GeocodeQuery::create('Buckingham Palace, London'));
Note where I put YOURAPIKEYHERE
, instead use your API there.
Thank you @atymic it's work for me ;)
No worries :smile:
Where i must placed the API KEY for google maps? because when i try manually it's working, like this