-
Notifications
You must be signed in to change notification settings - Fork 102
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
Using multiple providers #4
Comments
Hi Adam, By multiple provider do you mean the |
No, the ability to explicitly pick a provider. For now I ended up using the native Geocoder methods because I couldn't figure out how to add more than one provider in the config.php file. |
Sorry for the late response.. What about this ? // get the current adapter provided in the config.php file
$adapter = App::make('geocoder.adapter');
// define providers
$providers = array(
new \Geocoder\Provider\BaiduProvider($adapter, 'api-key'),
new \Geocoder\Provider\OIORestProvider($adapter),
// ...
);
// register providers
Geocoder::registerProviders($providers);
// pick up one registered provider by its name
Geocoder::using('baidu');
try {
// geocode
var_dump(Geocoder::geocode('10 rue Gambetta, Paris, France'));
} catch (\Exception $e) {
echo $e->getMessage();
} The |
I believe it does. Thanks. :-) |
Cool! Can we close the issue then? |
Sure no problem. |
Having difficulty figuring out best way (or any way) to use multiple providers with the Laravel module. Could a few examples be given?
Thanks
Adam
The text was updated successfully, but these errors were encountered: