AnsweredAssumed Answered

Directions and Sources: Error when using world geocode service

Question asked by dcoley on Jun 1, 2016
Latest reply on Jun 3, 2016 by dcoley


Hi - I'm trying to use the world geocoder as my locator source in the Directions widget, along with a feature layer as a second source (3.16).  I've set up the sources array as such:

sources: [{
        locator: new Locator("https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer"),
        singleLineFieldName: "SingleLine",
        name: "Search by Address",
        localSearchOptions: {
            minScale: 300000,
            distance: 100
        },
        placeholder: "Search by Address",
        maxResults: 3,
        maxSuggestions: 3,
        enableSuggestions: true,
        minCharacters: 0,
  },
  {
       featureLayer: lyrBldg,
        searchFields: ["FACILITYNAME"],
        displayField: "FACILITYNAME",
        exactMatch: false,
        outFields: bldgFlds,
        name: "Search by Facility",
        localSearchOptions: {
            minScale: 300000,
            distance: 1000
        },
        placeholder: "Search for Facilities",
        maxResults: 3,
        maxSuggestions: 3,
        enableSuggestions: true,
        minCharacters: 0
  }],

 

but when entering an address (regardless whether the 'All' or 'Search by Address' search option is selected), the widget will place the stop A icon on map and then clear the address from the search input.  When entering a second address, the stop B icon is placed on the map, but again the input search box is cleared instantly.

 

As such, the icons remain on the map at their correct locations, but no route can be solved.

 

When using the world geocode service as the only source (i.e not in a sources array) I have no issues-

 

Suggestions?

Thanks,

David

Outcomes