AnsweredAssumed Answered

Limit Search Results for Stops in Directions Widget

Question asked by andrewjwhittaker on May 3, 2018

I have a map created with Esri's ArcGIS for JavaScript API, version 3.23. I want to limit the search results for the Stops in the Directions Widget to a single state in the USA. Is there a way to do this?

 

I've discovered that it's possible to limit the searchOptions property of the Directions widget to have defined to "US" as seen below. However, you can still see suggestions for locations in other countries, so I'm not sure what it's really doing. Any help would be greatly appreciated.

 

self.map.directions = new Directions({      
    map: self.map,     
    autoSolve: true,     
    routeTaskUrl: appConfig.map.services.routeTaskUrl,     
    geometryTaskUrl: appConfig.map.services.geocodeTaskUrl,     
    searchOptions: {        
        countryCode: "US",         
        enableInfoWindow: true     
    } 
}, "dir");

Outcomes