When the auto-complete mode is set to true, the default max propositions is limited to 5.
I am wondering if this is the default behavior.
is there a way to change that value to 15 for example?
Solved! Go to Solution.
The World Geocoder, which is the default geocoder used by search, doesn't support specifying maxSuggestions. It will always return 5. We'll add this info to the API Ref doc reference page.
According to the API reference, there doesn't seem to be a supported property. I dug in and found the requests in one of the Esri examples:
http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/suggest?f=json&text=chu%20Redland...
This returns the object with 5 recommendations based upon string "chu". According to this page:
There doesn't seem to be a way to do this, unless it's undocumented.
Update:
I found the API reference regarding "suggest" for the geocoder:
ArcGIS REST API - Services and Data Types
I don't see anything mentioned about configuring the number of autocomplete results... If it's not supported, maybe Esri can add it?
Hi Chris,
Yes I did look through the API as well with no luck. So, I posted this manner as an idea at ArcGIS Idea - Geocode Service Max Results Suggest . We can all go support it and hopefully, ESRI will take it to consideration. I think it will be great if we can control the suggestions results...
It looks like you would use maxLocations under properties in the API reference. maxLocations sets the Maximum number of locations to display in the results menu. - Geocoder | API Reference | ArcGIS API for JavaScript
That was my initial thought, too, but when I tried adjusting the property in one of Esri's sandboxes (ArcGIS API for JavaScript Sandbox), it didn't appear to do anything.
The following thread appears to explain why:
I see that, but even with autocomplete turned on, the maxLocation property has a default of 6, I wonder if it's a bug. Kelly Hutchins?
Also in the sample, the screenshot displays 6 addresses, but the when it runs, it displays 5. Makes me think it's a bug: Geocoder widget | Guide | ArcGIS API for JavaScript
The World Geocoder, which is the default geocoder used by search, doesn't support specifying maxSuggestions. It will always return 5. We'll add this info to the API Ref doc reference page.