Closed vicb closed 5 months ago
/cc @gavinr-maps
Hi, thank you for logging this issue!
there is no way to pass an initial location, a country code, nor the max number of results
That is not strictly true. For all requests in ArcGIS REST JS, you can always use the params
property to pass in any additional properties that is not covered within ArcGIS REST JS. See IGeocodeOptions:
So although I don't think we are opposed to defining more of the REST API properties in ArcGIS REST JS, there is a current way to pass anything you need to the REST endpoint.
@gavinr-maps Thanks for the tip!
I was looking at the doc referenced by the README of the geocoding package.
That doc (https://esri.github.io/arcgis-rest-js/api/geocoding/geocode/) only mention the address
parameters.
I see several options here:
Happy to help with any of those. Let me know what you think
@vicb thanks for the response.
I was looking at the doc referenced by the README of the geocoding package.
Thank you for pointing that out - you're correct that those URLs are linking to our old v3 documentation (https://esri.github.io/arcgis-rest-js/api/) instead of the new v4 documentation (https://developers.arcgis.com/arcgis-rest-js/api-reference. If you would like to issue a PR to update that README, we would certainly appreciate that!
Note that the v4 documentation for geocoding is here: https://developers.arcgis.com/arcgis-rest-js/api-reference/arcgis-rest-geocoding/geocode/ ... and on that page here is where the link to IGeocodeOptions is:
Thank you!
Describe the problem
The geocoding services ('geocode()
and
suggest()` functions) accept many more parameters than what is available in the current API.For example there is no way to pass an initial location, a country code, nor the max number of results.
Ref:
geocode()
suggest()
Describe the proposed solution
Add all missing parameters.
For
geocode
the existing interface (interface IGeocodeOptions extends IEndpointOptions
) can be augmented with the additional parameters.For
suggest
(function suggest(partialText: string, requestOptions?: IEndpointOptions)
) there is a need to create a new interfaceISuggestOptions
extendingIEndpointOptions
Alternatives considered
No response
Additional Information
I'm willing to create a PR if you are willing to accept it and release a new version with that. Let me know!