Changing Locator for My Gov. Services App 10.2

2339
6
09-18-2013 11:50 AM
JeremyWilliams
New Contributor II
I'd like to set my own geocoder for the My Government Services App (v10.2).  As I understand this is possible, as the configuration is there now in 10.2.

This is the standard code that the app comes with:
Locators: [{
            DisplayText: "Search Address",
            DefaultValue: "ADDRESS", // Set default address to search.
            LocatorParamaters: ["SingleLine"], // Set Locator fields (fields to be used for searching).
            LocatorURL: "http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer",
            CandidateFields: "Loc_name, Score, Match_addr",
            DisplayField: "${Match_addr}",
            AddressMatchScore: 80,
            LocatorFieldName: 'Loc_name',
            LocatorFieldValues: ["USA.StreetName", "USA.PointAddress", "USA.StreetAddress"]
             }]


I was thinking that I could just input my own locator service, and update the LocatorFieldValues so that it references the fields on my locator and be done, like this:
Locators: [{
            DisplayText: "Search Address",
            DefaultValue: "ADDRESS", // Set default address to search.
            LocatorParamaters: ["SingleLine"], // Set Locator fields (fields to be used for searching).
            LocatorURL: "http://MyServer/arcgis/rest/services/Whatever/GeocodeServer",  //My locator
            CandidateFields: "Loc_name, Score, Match_addr",
            DisplayField: "${Match_addr}",
            AddressMatchScore: 80,
            LocatorFieldName: 'Loc_name',
            LocatorFieldValues: ["StreetName", "HouseNumber", "StreetAddress"]  //References my locator
             }]


But it doesnt work...any suggestions?
0 Kudos
6 Replies
WilliamParco
New Contributor
Did you ever find a solution for this?

I'm having the same trouble getting our locators to work within these apps and cant's seem to find what might be wrong.
0 Kudos
JeremyWilliams
New Contributor II
No solution yet, but I am hoping that the next releases of these apps will allow for greater customization (especially for the geolocators).
0 Kudos
HeatherEisan1
New Contributor III
Jeremy,

Using the Local Government Information Model Composite Address Locator, I was able to create a geolocator service and use the service within My Government Services (10.2) application.

Like you did, I changed the LocatorURL to http://MyServer/arcgis/rest/services/Composite/GeocodeServer, as well as the LocatorFieldValues to �??SiteAddress�?�, �??DualRange�?�.

Are you able to use your locator from ArcMap or from your ArcGIS REST Services Directory? To test my locator in ArcMap I opened the Find tool and browsed to my Composite Address Locator. Then I searched for the default address in the configuration file (139 W Porter Ave, City of Naperville).

Heather
0 Kudos
WilliamParco
New Contributor
Thanks Heather

It was the LocatorFieldValues that were throwing me off.
I thought it wanted the type of locator, not the actual name. Working now for me

-Bill
0 Kudos
JeremyWilliams
New Contributor II
Hi Heather,
Thank you for your insight on the LocatorFieldValues.  I am still having an issue with this however, I was wondering if you could post the code that you are using?  Here is the experimental code that I am using, using the sample locator from the download.  The geolocator works in the REST and ArcMap so I know it is a working locator.

Thanks again!
DisplayText: "Search Address",
DefaultValue: "139 W Porter Ave, City of Naperville", // Set default address to search.
LocatorParamaters: ["SingleLine"], // Set Locator fields (fields to be used for searching).
LocatorURL: "http://MyServer/arcgis/rest/services/Sample_CompositeLocator/GeocodeServer",
CandidateFields: "Loc_name, Score, Match_addr",
DisplayField: "${Match_addr}",
AddressMatchScore: 80,
LocatorFieldName: 'Loc_name',
LocatorFieldValues: ["SiteAddress", "DualRange"]
0 Kudos
HeatherEisan1
New Contributor III
Hi Jeremy,

Here is the code that I am using.

        Locators: [{
            DisplayText: "Search Address",
            DefaultValue: "139 W Porter Ave Naperville IL 60540", // Set default address to search.
            LocatorParamaters: ["SingleLine"], // Set Locator fields (fields to be used for searching).
            LocatorURL: "http://MyServer/arcgis/rest/services/Composite/GeocodeServer",
            CandidateFields: "Loc_name, Score, Match_addr",
            DisplayField: "${Match_addr}",
            AddressMatchScore: 80,
            LocatorFieldName: 'Loc_name',
            LocatorFieldValues: ["SiteAddress", "DualRange"]


Hope this helps.
0 Kudos