Open flamurbeqiri1 opened 1 year ago
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
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!
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
Ok, thnx
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 :/