Custom Address Locator on ArcGIS Online

6083
3
Jump to solution
08-14-2014 12:12 PM
deleted-user-RAnWn8DDSd1P
New Contributor III

I have my own address suggestion service that returns the format necessary to handle /findAddressCandidates? calls such that it works with the geocoder widget on default settings.  I added a faked out root-level json call so I could get it added to our organization's geocoders under Edit Settings > Utility Services.  I do not see any calls challenging the service in the web logs, other than the root-level one, when I add the geocoder, load a webmap in the online viewer, or use the embed code on our website, but the geocoder will not get loaded in the widget.  As far as I can tell this is the same js geocoder widget being used, but the geocoders array has only one entry for our ArcGIS Server service.  Does anyone know what it might be checking for that prevents it from being loaded in the widget?

Service URL:  http://www.portlandmaps.com/locator‌ [/findAddressCandidates?<params>]

Geocoder Widget Example: http://www.portlandmaps.com/geocoder

ArcGIS Online WebMap Viewer: http://pdx.maps.arcgis.com/home/webmap/viewer.html?webmap=0ef42379c5c540e8b7cc356c88933f6b

Embed Code Example: http://www.portlandmaps.com/embed

Portland Locator is the one that hits our ArcGIS Server compound locator service.

Suggest is the one that is missing from the widget

agol_geocoders.png

0 Kudos
1 Solution

Accepted Solutions
deleted-user-RAnWn8DDSd1P
New Contributor III

Ok so I found the filter in http://pdx.maps.arcgis.com/home/webmap/templates/OnePane/basicviewer/javascript/layout.js

1467: //only use geocoders with a singleLineFieldName that allow placefinding unless its custom

    geocoders = dojo.filter(geocoders, function (geocoder) {

        if(geocoder.name && geocoder.name === "Custom"){

            return (esri.isDefined(geocoder.singleLineFieldName));

        }else{

         return (esri.isDefined(geocoder.singleLineFieldName) && esri.isDefined(geocoder.placefinding) && geocoder.placefinding);

        }

    });

So, making the geocoder name "Custom" or checking Place Finding makes it show up, however the geocoder widget options needs to have autoComplete: true to display suggestions while typing.

UPDATE:  the online viewer does suggest results but the embed code version does not.

UPDATE 2: embed code has autoComplete: hasEsri so adding ESRI World geocoder as a third option then sets autoComplete: true

View solution in original post

0 Kudos
3 Replies
deleted-user-RAnWn8DDSd1P
New Contributor III

Ok so I found the filter in http://pdx.maps.arcgis.com/home/webmap/templates/OnePane/basicviewer/javascript/layout.js

1467: //only use geocoders with a singleLineFieldName that allow placefinding unless its custom

    geocoders = dojo.filter(geocoders, function (geocoder) {

        if(geocoder.name && geocoder.name === "Custom"){

            return (esri.isDefined(geocoder.singleLineFieldName));

        }else{

         return (esri.isDefined(geocoder.singleLineFieldName) && esri.isDefined(geocoder.placefinding) && geocoder.placefinding);

        }

    });

So, making the geocoder name "Custom" or checking Place Finding makes it show up, however the geocoder widget options needs to have autoComplete: true to display suggestions while typing.

UPDATE:  the online viewer does suggest results but the embed code version does not.

UPDATE 2: embed code has autoComplete: hasEsri so adding ESRI World geocoder as a third option then sets autoComplete: true

0 Kudos
KellyHutchins
Esri Frequent Contributor

Aaron,

Looks like an issue we should look at in the embed code. I'll look into modifying the embed code so that it can enable autoComplete when the world geocoder isn't displayed.

0 Kudos
JeffRogers
Esri Contributor

Aaron, it looks like this would be much simpler if ArcGIS locators supported suggestions offering the same out of the box capabilities as the ArcGIS World Geocoding Service.  Esri is actively working on adding suggestions capabilities for locators organizations build from their own address data.  Look for this new capability for locators built with ArcGIS 10.3 and hosted with ArcGIS Server 10.3.

Jeff

0 Kudos