Hi Robert,
Yes, you should be able to set the geocoderOptions on the constructor parameters with a default of Geocoder settings. They can be these settings:
https://developers.arcgis.com/javascript/jsapi/geocoder-amd.html#geocoder1
I believe that geocoders on the directions widget is just a property.
Let me know if that works.
Thanks
Robert,
Could you post an example of how you set this up?
Thanks
Sorry about the delay.
For development purposes, we were geocoding on one machine and routing on another but it certainly works if both services are on the same machine.
var locatorURL = | ||
"http://geocodeserver:6080/arcgis/rest/services/address_comp/GeocodeServer"; |
var routeURL = | |||
"http://routeserver:6080/arcgis/rest/services/route_service/NAServer/Route"; |
sr = new SpatialReference(4326);
var directionsOptions = {
arcgisGeocoder : false,
geocoders :[{
url : locatorURL,
singleLineFieldName: "SingleLine",
name: "Logisys Geocoder",
outSpatialReference : sr,
wkid : wkid,
outFields : "Loc_name"}]
};
rp = new RouteParameters();
rp.outSpatialReference = {"wkid":wkid};
rp.returnRoutes = false;
rp.returnDirections = true;
var directions = new Directions({
map : map,
geocoderOptions : directionsOptions,
routeTaskUrl : routeURL,
routeParameters : rp,
directionsLengthUnits : Units.MILES
}, "directions");
directions.startup();