We have an old js application (https://maps.tucsonaz.gov/zoombiz/ ) built from an ESRI template (can't remember which one, it's pretty old)
The locator we wired up got retired, and we need to put in a new one. Simple, mostly. However there are some additional parameters in the Config.js code that I can't quite crack.
Here's the locator we are now wanting to use:
Geocoders/COMPOSITE_LOCATOR_WEB (GeocodeServer)
And here's what we need for the app, in addition to the service URL:
LocatorParameters: ["SingleKey"], // Set Locator fields (fields to be used for searching).
CandidateFields: "Score, Match_addr, Addr_type", //Set which fields are returned in results
DisplayField: "${Match_addr}", //Set which field from results is displayed
LocatorFieldName: 'Addr_type',//The returned field which specifies match type (specific locator within composite)
LocatorFieldValues: ["Address", "Addr", "Address_1", "Customer_Address"] //List of acceptable individual locators (within composite)
My hunch is that it's the last item - LocatorFieldValues - that's not working with the new locator service, as well as possibly the LocatorParameters (is 'SingleLine' a viable entry there?)
Any tips on the configuration, or where to look in the service properties to find this?
Thanks -
Allen
Solved! Go to Solution.
Allen,
Here is what I decipher that you need:
LocatorParameters: ["SingleLine"], // Set Locator fields (fields to be used for searching).
CandidateFields: "Score, Match_Addr, Addr_type, Loc_name", //Set which fields are returned in results
DisplayField: "${Match_Addr}", //Set which field from results is displayed
LocatorFieldName: 'Loc_name',//The returned field which specifies match type (specific locator within composite)
LocatorFieldValues: ["CENTERLINE_COT", "CENTERLINE", "ADCOUNTY_SH", "ADCOUNTY_SFCOT", "ADCOUNTY_SHCOT"] //List of acceptable individual locators (within composite)
Allen,
Here is what I decipher that you need:
LocatorParameters: ["SingleLine"], // Set Locator fields (fields to be used for searching).
CandidateFields: "Score, Match_Addr, Addr_type, Loc_name", //Set which fields are returned in results
DisplayField: "${Match_Addr}", //Set which field from results is displayed
LocatorFieldName: 'Loc_name',//The returned field which specifies match type (specific locator within composite)
LocatorFieldValues: ["CENTERLINE_COT", "CENTERLINE", "ADCOUNTY_SH", "ADCOUNTY_SFCOT", "ADCOUNTY_SHCOT"] //List of acceptable individual locators (within composite)
Excellent - thanks Robert. That worked.
Any insights into where you looked to get the correct properties - especially the LocatorFieldName and FieldValues? I just poked around the REST service and wasn't able to find the answers.
Thanks -
Allen
Allen,
It was looking for the name of the locator that was used from the composite locator so I looked in the locators attribute fields for the field that returned the locator that was used and found "Loc_Name" and then when I tested an address using the rest endpoint and making sure that "Loc_Name" was an out field I saw the names of the locators that were used in the results and added those to the LocatorFieldValues.
Excellent - many thanks for taking the time.
Allen