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.
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();
Robert,
Could you post an example of how you set this up?
Thanks
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#geocoder1I believe that geocoders on the directions widget is just a property.Let me know if that works.Thanks
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.