In the Flex app, Locator widget, I could restrict the address searches to only within the overall extent of the map. As all of my searches happen within Tulsa, Oklahoma, I would LIKE to have my users only have to enter the address and not the City and State in order to run the geocoder. I've been digging around the config.json and such files trying to find out how to make this happen but no luck so far.
Does anyone know if this is an option?
Solved! Go to Solution.
Brain,
I have had better luck using this json (suffix instead) .
{
"geocoder": {
"autoComplete": true,
"minCharacters": 3,
"name": "Esri World Geocoder",
"arcgisGeocoder": false,
"geocoders": [
{
"url": "https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer",
"name": "Esri World Geocoder",
"singleLineFieldName": "SingleLine",
"placeholder": "Find address or place",
"suffix": " Tulsa, OK"
}
]
}
}
Brain,
This should be what you are looking for (hopefully I have the extent of Tulsa correct):
{
"geocoder": {
"autoComplete": true,
"minCharacters": 3,
"arcgisGeocoder": {
"placeholder": "Find address or place",
"searchExtent": {"xmin":-10738000,"ymin":4281800,"xmax":-10592000,"ymax":4344600,"spatialReference":{"wkid":102100}}
}
}
}
For the "searchExtent", I tested in JS API, it looks like only take Extent Object, the way add "searchExtent" in json is not working. Need more changes in some .js file
Brain,
I have had better luck using this json (suffix instead) .
{
"geocoder": {
"autoComplete": true,
"minCharacters": 3,
"name": "Esri World Geocoder",
"arcgisGeocoder": false,
"geocoders": [
{
"url": "https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer",
"name": "Esri World Geocoder",
"singleLineFieldName": "SingleLine",
"placeholder": "Find address or place",
"suffix": " Tulsa, OK"
}
]
}
}
Perfection. Thank you kindly sir.
Robert,
Can we use suffix like you suggest here, to limit search to a state in USA when using CountryCode, like this "Texas, US" , right now it works fine, finding results only for USA, but want I the search within Texas only.
s.set("sources", sources.reverse(), sources[4].countryCode = "US")
search extent also works, but I am still getting some results from neighboring states, wanted to know if there was a way to refine it further.
Thank you.
Saloni,
This thread was dealing with the Geocoder. Your question has to do with the new Search Dijit it looks like the new Search dijits source does support the suffix property but I would think that "Texas, US" is incorrect and the suffix you would want and try would be "TX" (but I have no experience yet with the Search dijit.
Thanks for the reply Robert.
I tried suffix: "TX, US", it did not work, also tried with USA instead of US.
Neither did this:
s.set("sources", sources.reverse(), sources[4].countryCode = " TX, US");
Not sure if I have it right.
Saloni,
No My advice was to leave this alone:
s.set("sources", sources.reverse(), sources[4].countryCode = "US")
And just add the "suffix" of "TX" to your source 4
Robert,
Thanks, it worked!