LocatorTask.ReverseGeocodeAsync has a method that takes a parameter that has ReverseGeocodeParameters.MaxResult that the documentation says the WorldGeocodeService can return up to 20 results per request. The return value of this method is an IReadOnlyList of GeoCodeResult. This leads me to believe that I can request more than one hit within a radius.
However, looking at the request through Fiddler, the maxResult is not passed in the request parameters. The documentation for the Rest API for reverseGeocode doesn't indicate that the result can ever be a list of addresses, or that MaxResult is an available parameter. Is there a mismatch between the implemented SDK API and the REST API, or is it more future proof?
We have many configured Geocode services (doing direct query against featurelayers is rather cumbersome as everything is ideally supposed to be configured in the portal. We want to query "What's near this location?", and we need multiple results per service as the MaxResult property says.
Are there good workarounds for this, or alternative geocode API? findAddressCandidates (LocatorTask.Geocode, I presume) with location might be an option, but I've not seen samples on how to send just a position to get multiple addresses, but that could be a combination with SearchArea and some additional parameters to get within a radius?
@dotMorten is this something you have experience with?
Sorry no I don't remember the reason for this. However the geocode task can work with many different services as well as local offline datasets, where each could have different capabilities.
Thank you for getting back to me. The geocode services we are searching against are custom proxies, which might be tailored to provide multiple results, however, since the maxresult parameter is never passed to the service, it is tricky to tell it how many results to return. Rewriting it to return multiple results might be possible, however it is unknown what format to return to be able to support multiple results that the Maps SDK is able to process successfully. I.e. "What's here" functionality with multiple results per geocodeService.
Can you think of other ways to get multiple results from a geocode service based on a location only, and still follow specifications?