Closed yurixcode closed 3 years ago
Hi,
Yes, that's possible, but how it exactly works, and to what scope you can limit, depends on the provider that you use.
Please check the provider specific docs, and let me know if you are not able to make it work.
For the OpenStreetMap provider, you can take a look at the example here: https://smeijer.github.io/leaflet-geosearch/providers/openstreetmap#optional-parameters
All providers that we support, have a link on their page to the official docs. And all providers can proxy those official options right to their API. Just like the openstreetmap example shows.
Hi, I'm trying to use optional parameters but it doesn't working.
Here is the code I'm using const provider = new OpenStreetMapProvider() as the provider:
and here are the results:
Ok, I just realize of my error. The provider must be initialized like below, and not at query instance:
const provider = new OpenStreetMapProvider({
params: {
countrycodes: 'ar', // limit search results to Argentina
addressdetails: 1, // include additional address detail parts
},
});
Correct @cargallo . Thanks for coming back to let us know :slightly_smiling_face:
Hi! first of all congratulate you for the work done in your bookstore, thank you!
I would like to know if it is possible to limit the results of the geo search to a previously defined geographic frame
For example, if the search limitation is located in Madrid, that the provider returns only results that are included within this geographic area, would it be possible to do this with this library?
I already appreciate your response.
Cheers