Select to view content in your preferred language

My Government Services and Geocoding

2867
6
07-17-2013 12:51 PM
Dawn_Scott
Occasional Contributor
We are considering using our own address locator for this application.  Is there any documentation on how to configure the address locator?  I have changed the url to our geocoding service, but I'm having trouble understanding the locate fields and other variables in config.js.  Thanks.
0 Kudos
6 Replies
HeatherEisan1
Deactivated User
The 10.2 version of My Government Services app exposes the locator parameters to allow users to configure your own address locator. The 10.2 version of the My Government Services has just been released. You can find the application here.
0 Kudos
JeremyWilliams
Emerging Contributor
Same here, regardless of geocoder (esri or mine) no results are found.
0 Kudos
LindsayThomas
Esri Contributor
Hi Dawn,

Are you using the 10.1 or 10.2 version of the application?

Cheers,
Lindsay
(It was nice to meet you at User Conference this year)
0 Kudos
JordanRogers
Regular Contributor
I am having the same issue.  I am using the 10.1 application.

I was able to implement my own address service within the Parks finder app without much of an issue however this one seems to be a bit different.

In the parks finder app there is only a space for the 'LocatorFileds' (similar to the second part below)

  //Set locator name fields to search.
    LocatorNameFields: [{
        FieldName: 'Loc_name',
        FieldValues: ["CAN.PointAddress", "CAN.StreetAddress"]
}],

        // Set Locator fields (fields to be used for searching).
        LocatorFields: "SingleLine",

Does anyone know what the script is looking for in the 'LocatorNameFields' (FieldName, FieldValue) vs. the 'LocatorFields'?

Thanks,

Jordan
0 Kudos
MikeTschudi
Esri Alum
Hi Jordan,

LocatorNameFields is used to connect the locator service to the app, because a call to a locator service in turn spawns calls to multiple types of locator.  When a response comes back from the locator, it can contain a response from each of the subsidiary locators; FieldName is the name of the attribute field with the name of subsidiary locator that provided a response. E.g., here is a snippet of a response
    "candidates": [{
        "address": "971 Sylvan Cir, Naperville, IL, 60540",
        "location": {
            "x": -9810866.9852000009,
            "y": 5126375.4676999971
        },
        "score": 100,
        "attributes": {
            "Loc_name": "US_RoofTop",
            "Score": 100,
            "Match_addr": "971 Sylvan Cir, Naperville, IL, 60540",
            "House": "971",
            "Side": "L",
            "PreDir": "",
            "PreType": "",
            "StreetName": "Sylvan",
                :        :        :

Note the attribute "Loc_name" tells you that this candidate address came from the "US_RoofTop" subsidiary locator.

FieldValues holds the list of subsidiary locators whose results you want to display to your user.  In our try-it, e.g., the default address returns results from locators "US_RoofTop", "US_Streets", "US_StreetName", "US_Zipcode", and "US_CityState", but we only want to display results from "US_RoofTop" and "US_StreetName".

LocatorFields holds the name of the field that the locator service defines to accept a single-line address input parameter (i.e., one that doesn't have to be parsed by the app into street, city, etc., parameters). Our try-it uses the TA_Address_NA_10 service, which names this field "SingleLine". The newer World Geocoding Service also uses this name. (See also the ArcGIS API for JavaScript documentation for esri.tasks.Locator.addressToLocations().)
0 Kudos
JordanRogers
Regular Contributor
Thanks a lot Mike.  I have it working now.
0 Kudos