Change the Routing GeoCoder service of Directions widget

97
2
10-27-2021 04:28 AM
benchikh
New Contributor III

How can I change the Directions GeoCoder Service to let him point on my own Geocoder service

I have declared My directions as below, with the routeTaskURL

   var directionsW = new Directions({
            map: map,
            routeTaskUrl: 
             "https://xxxxxxxxx/arcgis/rest/services/CALCUL_ITINERAIRE/NAServer/Route"
           
        }, "dir");

and now I want to point on my own GeoCoder Service ? I know that I can do it with searchOptions's Parameter, but could you please let me know with a sample of code that would be very helpful.

0 Kudos
2 Replies
ReneRubalcava
Frequent Contributor

You can update the searchProperties of the Directions widget.

https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#searchPro...

Like the Search widget, you can turn off the default Search source and add your own.

https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchPro...

You can look at the search sample for more details on adding a new source.

https://developers.arcgis.com/javascript/latest/sample-code/widgets-search-multiplesource/

 

benchikh
New Contributor III

I have already checked the links but better is there is a sample that would be mucg appreciated

0 Kudos