smeijer / leaflet-geosearch

A geocoding/address-lookup library supporting various api providers.
https://smeijer.github.io/leaflet-geosearch/
MIT License
1.03k stars 273 forks source link

Search Country specific for Esri and Bing Providers #168

Closed anujkamat29 closed 5 years ago

anujkamat29 commented 6 years ago

I am able to get search results country specific for Open Street Maps and Google. Not the same for Esri and Bing.

For Open Street Maps I have used countrycodes: '_Countrycode'

For Google I have used components:'country:_Countrycode',

Please help in the remaining two providers

smeijer commented 6 years ago

You should check the documentation of the api's. It will be possible to provide the setting to your provider, as long as the API supports it. The provider will just forward it to the API. He doesn't do anything with the settings himself.

Links to the API documentation of the default providers are all placed in the README.md. Please see there. Not all API's do provide this option.

ertejaspatel commented 5 years ago

Hi Smeijer,

Thanks for this awesome library...

Does this library pass any additional parameter to the search provider?

i.e. searchProvider.search({ query: input, components: "country:ca|country:au" })

Thanks,

smeijer commented 5 years ago

Yes it does. The arguments that you're providing to the provider are passed trough.

They should be given trough the constructed though. Not when calling the search method.