Skip to content

No provider could geocode address #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jryd opened this issue Nov 21, 2016 · 3 comments
Closed

No provider could geocode address #55

jryd opened this issue Nov 21, 2016 · 3 comments

Comments

@jryd
Copy link

jryd commented Nov 21, 2016

I've followed the steps outlined to get this package installed in a new project I am working on in Laravel 5.3.

My geocoder.php file is set up like so:

<?php

/**
 * This file is part of the GeocoderLaravel library.
 *
 * (c) Antoine Corcy <contact@sbin.dk>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

use Ivory\HttpAdapter\CurlHttpAdapter;
use Ivory\HttpAdapter\Guzzle6HttpAdapter;
use Geocoder\Provider\Chain;
use Geocoder\Provider\BingMaps;
use Geocoder\Provider\FreeGeoIp;
use Geocoder\Provider\GoogleMaps;
use Geocoder\Provider\MaxMindBinary;

return [
    'providers' => [
        Chain::class => [
            GoogleMaps::class => [
                'en-AU',
                'Australia',
                true,
                env('GOOGLE_MAPS_API_KEY'),
            ],
            FreeGeoIp::class  => [],
        ],
        BingMaps::class => [
            'en-US',
            env('BING_MAPS_API_KEY'),
        ],
        GoogleMaps::class => [
            'en',
            'us',
            true,
            env('GOOGLE_MAPS_API_KEY'),
        ],
    ],
    'adapter'  => CurlHttpAdapter::class,
];

Yet when I run $geocode = app('geocoder')->geocode('Los Angeles, CA')->get(); or any other address I am always getting the error:

exception 'Geocoder\Exception\ChainNoResult' with message 'No provider could geocode address: "Los Angeles, CA".

Am I doing something wrong or is there a bug?

@jryd jryd closed this as completed Nov 23, 2016
@j2r
Copy link

j2r commented Dec 7, 2016

@jryd - I am facing the same issue. How did you fix that ?

@mikebronner
Copy link
Member

mikebronner commented Dec 7, 2016

@j2r It is likely that your configuration settings are wrong. Can you post them here?

@jryd
Copy link
Author

jryd commented Dec 8, 2016

@j2r it actually turned out that the configuration was fine for me - it was that I hadn't enabled the Geocoding API in my console.

I was using a key that I previously used for the Javascript API and completely forgot to check I had enabled to right API.

Perhaps double check that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants