Comprehensive Locator documentation (JavaScript API)

109
5
Jump to solution
04-29-2014 02:33 PM
Highlighted
New Contributor II
I am using the Report Streetlight Problem JavaScript app and want to search for a location based on address, intersection, or point of interest. I can get it to do the first two or the last but not all three. I've looked at Locator under the Javascript API (https://developers.arcgis.com/javascript/jsapi/locator-amd.html) and the REST API Help for Single Input Geocoding (http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Single_input_field_geocoding/02r3000...) but neither fully documents some of the properties. Below are the Locator properties from the config.js file:

        Locators: [{
            DisplayText: "Address",
            DefaultValue: "400 Silver Avenue SW, Albuquerque, NM 87102",
            LocatorParamaters: ["SingleLine"],
            LocatorURL: "http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer",
            CandidateFields: "Loc_name, Score, Match_addr", //orig
            DisplayField: "${Match_addr}",
            ZoomLevel: 7,
            AddressMatchScore: 80,
            LocatorDefaultRequest: "1",
            LocatorFieldName: 'Loc_name',
            LocatorFieldValues: ["USA.StreetName", "USA.PointAddress", "USA.StreetAddress"]

I'm pretty sure I need to modify CandidateFields and LocatorFieldValues and possibly LocatorFieldName but I can't find any documentation for them. Can anybody provide some so I know what the possible property values are?

Thanks,

Aaron Allen
Albuquerque, NM
Tags (2)
Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
New Contributor II
Reply
0 Kudos
5 Replies
Highlighted
Esri Regular Contributor
What do you mean by the following:

"I am using the Report Streetlight Problem JavaScript app and want to search for a location based on address, intersection, or point of interest. I can get it to do the first two or the last but not all three."

There is nothing special that you need to do to return an address vs an intersection vs a POI.  Can you explain in some more detail?

Brad
Reply
0 Kudos
Highlighted
New Contributor II
Brad,

The POI search does not work out of the box for the Report Streetlight Problem app. For instance, I get "No results found" if I type "Starbucks in Albuquerque, NM" (without quotes) in the Search Address text box. That's true for the slightly modified app we are hosting as well as ESRI's sample app (http://tryitlive.arcgis.com/reportastreetlightproblem/).

The core Locator code does support a POI search by default. For example, I get results using the ESRI's Locator live sample (http://developers.arcgis.com/javascript/samples/locator_details/) with "Starbucks in Albuquerque, NM".

The difference tells me there is something in the application code that is limiting what the Locator is searching for and why I asked for further documentation about the parameters in the code I pasted. Could you do so? I would greatly appreciate it.

Aaron
Reply
0 Kudos
Highlighted
Esri Regular Contributor
Aaron,

I think your best bet is to post this on the JavaScript forum here:

http://forums.arcgis.com/forums/15-ArcGIS-API-for-JavaScript

Brad
Reply
0 Kudos
Highlighted
New Contributor II
Brad,

I have posted my query to the JavaScript forum.

I don't mean to be rude but as an ESRI employee don't you have access to the information or know someone in your organization who would be able to answer my question?

Aaron
Reply
0 Kudos
Highlighted
New Contributor II
Reply
0 Kudos