Skip to content
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

How to set limit of results in openstreetmap #344

Open
flamurbeqiri1 opened this issue Nov 18, 2022 · 4 comments
Open

How to set limit of results in openstreetmap #344

flamurbeqiri1 opened this issue Nov 18, 2022 · 4 comments
Labels

Comments

@flamurbeqiri1
Copy link

I use the provider openstreetmap and according to documentation it says we can use the nominatim properties. How can we e.x use the limit for geocode.

Currently I have:
let results: any = await geocoder.geocode(query);

The initialiser requires only the query string :/

@nchaulet
Copy link
Owner

Hi I just added an example test on how you can use openstreetmap with custom props https://github.com/nchaulet/node-geocoder/blob/master/integration_test/geocoder/openstreetmapgeocoder.test.js#L30

@flamurbeqiri1
Copy link
Author

flamurbeqiri1 commented Nov 20, 2022

How does it work on your case when i get:
Argument of type '{ q: string; limit: number; }' is not assignable to parameter of type 'string | Query'. Object literal may only specify known properties, and 'q' does not exist in type 'Query'.ts(2345)
And i see there is no "q" in the Query Interface!

@nchaulet
Copy link
Owner

Oh I guess the types probably need to be updated, the node-geocoder module is not written in typescript and types are coming from DefinitelyTyped/DefinitelyTyped.
You can probably temporarly fix this in your code with a ts-expect-error or ts-ignore comment

@flamurbeqiri1
Copy link
Author

Ok, thnx

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

No branches or pull requests

2 participants