<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Get driving directions sample customization in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633367#M59152</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The locator you use has 4 address fields: Address, City, Postcode, County. So your code should look like:&lt;BR /&gt;var address ={};&lt;BR /&gt;address.Address ="123 sesame street";&lt;BR /&gt;address.City ="heaven";&lt;BR /&gt;address.Postcode="12345";&lt;BR /&gt;address.Country = "Sweden";&lt;BR /&gt;&lt;BR /&gt;The more detail you give, the better chance you will get a hit. &lt;BR /&gt;FYI. ArcGIS 10 allow you to put a single line of text like API stated: &lt;BR /&gt;var address = {"Single Line Input":"123 sesame street, heaven, 12345, Sweden "};&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Test your input on &lt;/SPAN&gt;&lt;A href="http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Address_EU/GeocodeServer/findAddressCandidates"&gt;http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Address_EU/GeocodeServer/findAddressCandidates&lt;/A&gt;&lt;SPAN&gt; to see whether your input is wrong or somewhere else in your code...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 May 2011 11:47:23 GMT</pubDate>
    <dc:creator>HemingZhu</dc:creator>
    <dc:date>2011-05-19T11:47:23Z</dc:date>
    <item>
      <title>Get driving directions sample customization</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633361#M59146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My aim is to create a web application where a user could click on the map or type in the address end and start points for the routing; the route will be calculated and shown on the map; the directions text will be shown on the html page to the user. This application I need exclusively for testing of the routing capabilities available via the ArcGIS Web API.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It seemed that the easiest way would be to customize the sample Get driving directions (&lt;/SPAN&gt;&lt;A href="http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jssamples_start.htm#jssamples/routetask_directions.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jssamples_start.htm#jssamples/routetask_directions.html&lt;/A&gt;&lt;SPAN&gt;) to use European geocoding and routing services.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have exchanged the locator and the routing services strings with the European services:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;locator = new esri.tasks.Locator("http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Address_EU/GeocodeServer");&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;routeTask = new esri.tasks.RouteTask("http://tasks.arcgisonline.com/ArcGIS/rest/services/NetworkAnalysis/ESRI_Route_EU/NAServer/Route");
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, when trying to get the directions, I get the error message from the browser: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;An error occured&lt;BR /&gt;Unable to complete&amp;nbsp; operation.&lt;BR /&gt;Required field '&amp;lt;i&amp;gt;Country&amp;lt;/i&amp;gt;' must be specified&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I understand that probably this coming from the code where the parsing of the input geocoding strings happen. I.e.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;//Parse and geocode "from" address
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var fromArr = dojo.byId("fromTxf").value.split(","),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fromAddress = { Address:fromArr[0], City:fromArr[1], State:fromArr[2], Zip:fromArr[3] };
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; locator.addressToLocations(fromAddress, ["Loc_name"], function(addressCandidates) { configureRoute(addressCandidates, "from"); });

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Parse and geocode "to" address
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var toArr = dojo.byId("toTxf").value.split(","),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; toAddress = { Address:toArr[0], City:toArr[1], State:toArr[2], Zip:toArr[3] };
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; locator.addressToLocations(toAddress, ["Loc_name"], function(addressCandidates) { configureRoute(addressCandidates, "to"); });
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, I am not sure how one is supposed to edit this piece of code (or maybe others, too!) in order to reflect the European geocoding parameters (I've looked a bit at &lt;/SPAN&gt;&lt;A href="http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Address_EU/GeocodeServer" rel="nofollow noopener noreferrer" target="_blank"&gt;http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Address_EU/GeocodeServer&lt;/A&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would appreciate if anyone could give me some tips what shall I look at. Maybe it is easier to customize the Find Route sample (&lt;/SPAN&gt;&lt;A href="http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jssamples_start.htm#jssamples/routetask_find_route.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jssamples_start.htm#jssamples/routetask_find_route.html&lt;/A&gt;&lt;SPAN&gt;) by implementing the routing directions there, but I am not that familiar with the JavaScript API.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:56:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633361#M59146</guid>
      <dc:creator>AlexeyTereshenkov</dc:creator>
      <dc:date>2021-12-12T02:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Get driving directions sample customization</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633362#M59147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;My aim is to create a web application where a user could click on the map or type in the address end and start points for the routing; the route will be calculated and shown on the map; the directions text will be shown on the html page to the user. This application I need exclusively for testing of the routing capabilities available via the ArcGIS Web API.&lt;BR /&gt;&lt;BR /&gt;It seemed that the easiest way would be to customize the sample Get driving directions (&lt;A href="http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jssamples_start.htm#jssamples/routetask_directions.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jssamples_start.htm#jssamples/routetask_directions.html&lt;/A&gt;) to use European geocoding and routing services.&lt;BR /&gt;&lt;BR /&gt;I have exchanged the locator and the routing services strings with the European services:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;locator = new esri.tasks.Locator("http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Address_EU/GeocodeServer");&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;and&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;routeTask = new esri.tasks.RouteTask("http://tasks.arcgisonline.com/ArcGIS/rest/services/NetworkAnalysis/ESRI_Route_EU/NAServer/Route");
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;However, when trying to get the directions, I get the error message from the browser: &lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;An error occured&lt;BR /&gt;Unable to complete&amp;nbsp; operation.&lt;BR /&gt;Required field '&amp;lt;i&amp;gt;Country&amp;lt;/i&amp;gt;' must be specified&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;I understand that probably this coming from the code where the parsing of the input geocoding strings happen. I.e.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;//Parse and geocode "from" address
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var fromArr = dojo.byId("fromTxf").value.split(","),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fromAddress = { Address:fromArr[0], City:fromArr[1], State:fromArr[2], Zip:fromArr[3] };
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; locator.addressToLocations(fromAddress, ["Loc_name"], function(addressCandidates) { configureRoute(addressCandidates, "from"); });

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Parse and geocode "to" address
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var toArr = dojo.byId("toTxf").value.split(","),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; toAddress = { Address:toArr[0], City:toArr[1], State:toArr[2], Zip:toArr[3] };
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; locator.addressToLocations(toAddress, ["Loc_name"], function(addressCandidates) { configureRoute(addressCandidates, "to"); });
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;However, I am not sure how one is supposed to edit this piece of code (or maybe others, too!) in order to reflect the European geocoding parameters (I've looked a bit at &lt;A href="http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Address_EU/GeocodeServer" rel="nofollow noopener noreferrer" target="_blank"&gt;http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Address_EU/GeocodeServer&lt;/A&gt;).&lt;BR /&gt;&lt;BR /&gt;I would appreciate if anyone could give me some tips what shall I look at. Maybe it is easier to customize the Find Route sample (&lt;A href="http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jssamples_start.htm#jssamples/routetask_find_route.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jssamples_start.htm#jssamples/routetask_find_route.html&lt;/A&gt;) by implementing the routing directions there, but I am not that familiar with the JavaScript API.&lt;BR /&gt;&lt;BR /&gt;Thank you.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If you looked at &lt;/SPAN&gt;&lt;A href="http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Address_EU/GeocodeServer" rel="nofollow noopener noreferrer" target="_blank"&gt;http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Address_EU/GeocodeServer&lt;/A&gt;&lt;SPAN&gt;, among the Address Fields, Country is required. So when you defined your address parameter, you have to include country name. Othervise, you will get the error. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var address ={}; address.Country =must have a value;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:56:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633362#M59147</guid>
      <dc:creator>HemingZhu</dc:creator>
      <dc:date>2021-12-12T02:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: Get driving directions sample customization</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633363#M59148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Heming,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the reply! So, I have to paste this line of code somewhere in the page, right?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have declared the variable address right after the creating an instance of the locator:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; locator = new esri.tasks.Locator("http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Address_EU/GeocodeServer");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.connect(locator, "onError", errorHandler);
&amp;nbsp; var address ={}; 
&amp;nbsp; address.Country = Sweden;&amp;nbsp; &lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now I don't get this error that country is required, but there is still no route generated and of course there are no directions shown either. In the textboxes, I am typing a string like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;Street HouseNumber City Postcode Country&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I guess the problem has something to do with the piece of code you gave me, I might have interpreted it incorrectly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you again for the help, Heming.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:56:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633363#M59148</guid>
      <dc:creator>AlexeyTereshenkov</dc:creator>
      <dc:date>2021-12-12T02:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Get driving directions sample customization</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633364#M59149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi Heming,&lt;BR /&gt;&lt;BR /&gt;Thanks for the reply! So, I have to paste this line of code somewhere in the page, right?&lt;BR /&gt;&lt;BR /&gt;I have declared the variable address right after the creating an instance of the locator:&lt;BR /&gt;&lt;BR /&gt; &lt;PRE class="lia-code-sample line-numbers language-none"&gt; locator = new esri.tasks.Locator("http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Address_EU/GeocodeServer");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.connect(locator, "onError", errorHandler);
&amp;nbsp; var address ={}; 
&amp;nbsp; address.Country = Sweden;&amp;nbsp; &lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;Now I don't get this error that country is required, but there is still no route generated and of course there are no directions shown either. In the textboxes, I am typing a string like:&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;Street HouseNumber City Postcode Country&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;I guess the problem has something to do with the piece of code you gave me, I might have interpreted it incorrectly.&lt;BR /&gt;&lt;BR /&gt;Thank you again for the help, Heming.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The locator you use has 4 address fields: Address, City, Postcode, County. So your code should look like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var address ={};&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;address.Address ="123 sesame street";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;address.City ="heaven";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;address.Postcode="12345";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;address.Country = "Sweden";&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The more detail you give, the better chance you will get a hit. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FYI. ArcGIS 10 allow you to put a single line of text like API stated: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var address = {"Single Line Input":"123 sesame street, heaven, 12345, Sweden "};&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:56:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633364#M59149</guid>
      <dc:creator>HemingZhu</dc:creator>
      <dc:date>2021-12-12T02:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Get driving directions sample customization</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633365#M59150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Heming,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you so much for the reply. Unfortunately, I was not able to make the script work. I still get the message the the Country is required.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the bunch of code I've used:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp; locator = new esri.tasks.Locator("http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Address_EU/GeocodeServer");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.connect(locator, "onError", errorHandler);
&amp;nbsp; 
&amp;nbsp; var address ={};
&amp;nbsp; address.Address ="5 SomeNameStreet";
&amp;nbsp; address.City ="SomeCityName";
&amp;nbsp; address.Postcode="SomePostalcode";
&amp;nbsp; address.Country = "Sweden";&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is the only thing I have changed in the whole sample (plus geocoding and routing REST URLs). What do you think is missing then?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:56:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633365#M59150</guid>
      <dc:creator>AlexeyTereshenkov</dc:creator>
      <dc:date>2021-12-12T02:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: Get driving directions sample customization</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633366#M59151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Heming,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you so much for the reply. Unfortunately, I was not able to make the script work. I still get the message that the Country is required.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the bunch of code I've used:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp; locator = new esri.tasks.Locator("http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Address_EU/GeocodeServer");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.connect(locator, "onError", errorHandler);
&amp;nbsp; 
&amp;nbsp; var address ={};
&amp;nbsp; address.Address ="5 SomeNameStreet";
&amp;nbsp; address.City ="SomeCityName";
&amp;nbsp; address.Postcode="SomePostalcode";
&amp;nbsp; address.Country = "Sweden";&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is the only thing I have changed in the whole sample ( plus geocoding and routing REST URLs). What do you think is missing then?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:56:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633366#M59151</guid>
      <dc:creator>AlexeyTereshenkov</dc:creator>
      <dc:date>2021-12-12T02:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: Get driving directions sample customization</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633367#M59152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The locator you use has 4 address fields: Address, City, Postcode, County. So your code should look like:&lt;BR /&gt;var address ={};&lt;BR /&gt;address.Address ="123 sesame street";&lt;BR /&gt;address.City ="heaven";&lt;BR /&gt;address.Postcode="12345";&lt;BR /&gt;address.Country = "Sweden";&lt;BR /&gt;&lt;BR /&gt;The more detail you give, the better chance you will get a hit. &lt;BR /&gt;FYI. ArcGIS 10 allow you to put a single line of text like API stated: &lt;BR /&gt;var address = {"Single Line Input":"123 sesame street, heaven, 12345, Sweden "};&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Test your input on &lt;/SPAN&gt;&lt;A href="http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Address_EU/GeocodeServer/findAddressCandidates"&gt;http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Address_EU/GeocodeServer/findAddressCandidates&lt;/A&gt;&lt;SPAN&gt; to see whether your input is wrong or somewhere else in your code...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2011 11:47:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633367#M59152</guid>
      <dc:creator>HemingZhu</dc:creator>
      <dc:date>2011-05-19T11:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Get driving directions sample customization</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633368#M59153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Heming,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you. I have tested the input and I have got several results, so it should be no problem in here. Any other suggestions?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2011 13:12:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633368#M59153</guid>
      <dc:creator>AlexeyTereshenkov</dc:creator>
      <dc:date>2011-05-19T13:12:58Z</dc:date>
    </item>
    <item>
      <title>Re: Get driving directions sample customization</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633369#M59154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi Heming,&lt;BR /&gt;&lt;BR /&gt;Thank you. I have tested the input and I have got several results, so it should be no problem in here. Any other suggestions?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Then you might have to look into your code (i can take a look if you don't mind posting your code).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2011 13:44:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633369#M59154</guid>
      <dc:creator>HemingZhu</dc:creator>
      <dc:date>2011-05-19T13:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: Get driving directions sample customization</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633371#M59156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;&lt;BLOCKQUOTE&gt;tereshenkov;103217 wrote:&lt;BR /&gt;Heming,&lt;/BLOCKQUOTE&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That is very nice of you. The code is the exact copy of the sample page one can get from the Resource Center apart from the REST URL for the geocoding and routing services (now European) plus those address variable parameters you have helped me to declare.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The address you defined has to match with the locator's Address Fields listed on the locator service directory. I modified several lines in ESRI's driving directions to use the EU locator and Router you mention. Please pay attention to how to define the address object in the code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Code attached&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2011 18:58:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633371#M59156</guid>
      <dc:creator>HemingZhu</dc:creator>
      <dc:date>2011-05-19T18:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: Get driving directions sample customization</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633372#M59157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Heming,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you very much for your help, I appreciate this. I have got the&amp;nbsp; "from" point geocoded now and zoomed to on the map, but it seems that driving directions do not work properly yet.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please see the code page with the address modified in the input text boxes (I have not changed anything apart from the input addresses):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;input type="text" id="fromTxf" value="1 Kungsgatan, Stockholm, 11143, Sweden" size="30" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input type="text" id="toTxf" value="10 Parkvagen, Gavle, 80267, Sweden" size="30" /&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The application treats the input start point to be the end point as well, so I do not get any route calculated, since the start and the end point coincide.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have looked into the syntax and did not find any typo or alike, so my guess is that it has something to do with the syntax. I know that it is very hard to debug the JavaScript code (you get Intellisense in Aptana and that is basically it), but I would be beholden to you if you could take a look at the code when you get a chance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:56:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633372#M59157</guid>
      <dc:creator>AlexeyTereshenkov</dc:creator>
      <dc:date>2021-12-12T02:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: Get driving directions sample customization</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633373#M59158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Heming,&lt;BR /&gt;&lt;BR /&gt;Thank you very much for your help, I appreciate this. I have got the&amp;nbsp; "from" point geocoded now and zoomed to on the map, but it seems that driving directions do not work properly yet.&lt;BR /&gt;&lt;BR /&gt;Please see the code page with the address modified in the input text boxes (I have not changed anything apart from the input addresses):&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;input type="text" id="fromTxf" value="1 Kungsgatan, Stockholm, 11143, Sweden" size="30" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input type="text" id="toTxf" value="10 Parkvagen, Gavle, 80267, Sweden" size="30" /&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;The application treats the input start point to be the end point as well, so I do not get any route calculated, since the start and the end point coincide.&lt;BR /&gt;&lt;BR /&gt;I have looked into the syntax and did not find any typo or alike, so my guess is that it has something to do with the syntax. I know that it is very hard to debug the JavaScript code (you get Intellisense in Aptana and that is basically it), but I would be beholden to you if you could take a look at the code when you get a chance.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I think there is a bug the ESRI has to look into. It all has something to do with the Json expression of the address object (looked at the this thread: &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/23457-Geocoding-Service-Not-returning-Candidates-to-quot-Application-quot?p=77554#post77554" rel="nofollow noopener noreferrer" target="_blank"&gt;http://forums.arcgis.com/threads/23457-Geocoding-Service-Not-returning-Candidates-to-quot-Application-quot?p=77554#post77554&lt;/A&gt;&lt;SPAN&gt;). So i changed the address Json object to Object. For anyone who has struggled with Json expression of the object (subset of javascript object), use javascript object. I have tried, it is more flexible(no order to follow!) and&amp;nbsp; never failed me.&amp;nbsp; Attached is the code.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:56:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633373#M59158</guid>
      <dc:creator>HemingZhu</dc:creator>
      <dc:date>2021-12-12T02:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: Get driving directions sample customization</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633374#M59159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Heming,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you very much for the help! Now it works as required. The only thing that is left is to figure out how the routing can work based on the address and not only on the postcode. I guess you have not noticed that if you choose to route between addresses with the same postcode, the route is not calculated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You might try to enter as an input and an output points the addresses below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;20 Parkvagen, Gavle, 80267, Sweden&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1 Parkvagen, Gavle, 80267, Sweden&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As you'd see in the Directions window, the route starts at 80267 and ends at 80267. That is, the solver does not parse the addresses properly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you could take a look at this problem, I would really appreciate this. But, again, this is not a big deal, that is still good enough for testing purposes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you again for the help, Heming, much appreciated.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2011 14:04:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633374#M59159</guid>
      <dc:creator>AlexeyTereshenkov</dc:creator>
      <dc:date>2011-05-20T14:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: Get driving directions sample customization</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633375#M59160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi Heming,&lt;BR /&gt;&lt;BR /&gt;Thank you very much for the help! Now it works as required. The only thing that is left is to figure out how the routing can work based on the address and not only on the postcode. I guess you have not noticed that if you choose to route between addresses with the same postcode, the route is not calculated.&lt;BR /&gt;&lt;BR /&gt;You might try to enter as an input and an output points the addresses below:&lt;BR /&gt;20 Parkvagen, Gavle, 80267, Sweden&lt;BR /&gt;and&lt;BR /&gt;1 Parkvagen, Gavle, 80267, Sweden&lt;BR /&gt;&lt;BR /&gt;As you'd see in the Directions window, the route starts at 80267 and ends at 80267. That is, the solver does not parse the addresses properly.&lt;BR /&gt;&lt;BR /&gt;If you could take a look at this problem, I would really appreciate this. But, again, this is not a big deal, that is still good enough for testing purposes.&lt;BR /&gt;&lt;BR /&gt;Thank you again for the help, Heming, much appreciated.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It's rather the locator then the solver (you can debug it). One work around is replace the begin and end directions description with from and end address (The begin and end stop point are accurate address points. i recalled this is what i did in one of my project).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2011 14:16:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633375#M59160</guid>
      <dc:creator>HemingZhu</dc:creator>
      <dc:date>2011-05-20T14:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: Get driving directions sample customization</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633376#M59161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am wondering if there is a way to add direction map tools to a map I already have created. I have an asp.net mvc 4 application with a map that I need to add a direction widget too. I have been trying to follow your forum for help and also this documentation but I am not having any luck. &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jssamples/widget_directions_basic.html"&gt;https://developers.arcgis.com/en/javascript/jssamples/widget_directions_basic.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt; I am quite new to this coding but I am thinking I just need to modify or replace some of the code. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any advice or support would be greatly appreciated. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thank you in advance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 17:33:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633376#M59161</guid>
      <dc:creator>AlanaD_Andrea</dc:creator>
      <dc:date>2013-09-10T17:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: Get driving directions sample customization</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633370#M59155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Heming,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That is very nice of you. The code is the exact copy of the sample page one can get from the Resource Center apart from the REST URL for the geocoding and routing services (now European) plus those address variable parameters you have helped me to declare.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
&amp;nbsp;&amp;nbsp; "http://www.w3.org/TR/html4/strict.dtd"&amp;gt;

&amp;lt;html lang="en"&amp;gt;
&amp;nbsp; &amp;lt;head&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" /&amp;gt;
&amp;nbsp;&amp;nbsp; 
 &amp;lt;!--The viewport meta tag is used to improve the presentation and behavior of the samples 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on iOS devices--&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;title&amp;gt;Directions&amp;lt;/title&amp;gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.3/js/dojo/dijit/themes/claro/claro.css"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.3"&amp;gt;&amp;lt;/script&amp;gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;style type="text/css" media="screen"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .segment { cursor:pointer; padding-top:3px; padding-bottom:3px; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/style&amp;gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;script type="text/javascript"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.require("esri.map");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.require("esri.tasks.locator");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.require("esri.tasks.route");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.require("esri.utils");

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var map, locator, routeTask, routeParams, routes = [];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var fromSymbol, toSymbol, routeSymbol, segmentSymbol;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var from, to, directions, directionFeatures, segmentGraphic;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function init() {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esri.config.defaults.io.proxyUrl = "/proxy/proxy.ashx";

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map = new esri.Map("map", {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; extent: new esri.geometry.Extent({"xmin":-13279958,"ymin":3856610,"xmax":-12546163,"ymax":4345807,"spatialReference":{"wkid":102100}})
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.addLayer(new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"));

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; locator = new esri.tasks.Locator("http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Address_EU/GeocodeServer");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.connect(locator, "onError", errorHandler);

// variable for the required address geocoding field
 var address ={}; 
&amp;nbsp; address.Address ="1 Kungsgatan";
&amp;nbsp; address.City ="Stockholm";
&amp;nbsp; address.Postcode="11143";
&amp;nbsp; address.Country = "Sweden";

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; routeTask = new esri.tasks.RouteTask("http://tasks.arcgisonline.com/ArcGIS/rest/services/NetworkAnalysis/ESRI_Route_EU/NAServer/Route");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; routeParams = new esri.tasks.RouteParameters();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; routeParams.stops = new esri.tasks.FeatureSet();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; routeParams.returnRoutes = false;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; routeParams.returnDirections = true;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; routeParams.directionsLengthUnits = esri.Units.MILES;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; routeParams.outSpatialReference = new esri.SpatialReference({ wkid:102100 });

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.connect(routeTask, "onSolveComplete", showRoute);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.connect(routeTask, "onError", errorHandler);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Configure symbols to be used for destinations and route segments
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fromSymbol = new esri.symbol.SimpleMarkerSymbol().setColor(new dojo.Color([0,255,0]));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; toSymbol = new esri.symbol.SimpleMarkerSymbol().setColor(new dojo.Color([255,0,0]));

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; routeSymbol = new esri.symbol.SimpleLineSymbol().setColor(new dojo.Color([0,0,255,0.5])).setWidth(4);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; segmentSymbol = new esri.symbol.SimpleLineSymbol().setColor(new dojo.Color([255,0,0,0.5])).setWidth(8);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.addOnLoad(init);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function getDirections() {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; routeParams.stops.features = [];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.graphics.clear();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; segmentGraphic = null;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Parse and geocode "from" address
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var fromArr = dojo.byId("fromTxf").value.split(","),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fromAddress = { Address:fromArr[0], City:fromArr[1], State:fromArr[2], Zip:fromArr[3] };
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; locator.addressToLocations(fromAddress, ["Loc_name"], function(addressCandidates) { configureRoute(addressCandidates, "from"); });

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Parse and geocode "to" address
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var toArr = dojo.byId("toTxf").value.split(","),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; toAddress = { Address:toArr[0], City:toArr[1], State:toArr[2], Zip:toArr[3] };
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; locator.addressToLocations(toAddress, ["Loc_name"], function(addressCandidates) { configureRoute(addressCandidates, "to"); });
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function configureRoute(addressCandidates, type) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var stop = null, score = 0;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Get the address match with the top score
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.forEach(addressCandidates, function(candidate) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (candidate.score &amp;gt; score &amp;amp;&amp;amp; candidate.attributes.Loc_name === "US_RoofTop") {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stop = candidate;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; score = candidate.score;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //convert the locations to web mercator to display on map
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var location = esri.geometry.geographicToWebMercator(stop.location);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Set the best address match as a stop on the route
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (type === "from") {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; routeParams.stops.features[0] = map.graphics.add(new esri.Graphic(location, fromSymbol, { address:stop.address, score:stop.score }));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if (type === "to") {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; routeParams.stops.features[1] = map.graphics.add(new esri.Graphic(location, toSymbol, { address:stop.address, score:stop.score }));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //If both the "to" and the "from" addresses are set, solve the route
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (routeParams.stops.features.length === 2) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; routeTask.solve(routeParams);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function showRoute(solveResult) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; directions = solveResult.routeResults[0].directions;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; directionFeatures = directions.features;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Add route to the map
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.graphics.add(new esri.Graphic(directions.mergedGeometry, routeSymbol));

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Display the total time and distance of the route
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.byId("summary").innerHTML = "&amp;lt;br /&amp;gt; &amp;nbsp; Total distance: " + formatDistance(directions.totalLength, "miles") + "&amp;lt;br /&amp;gt; &amp;nbsp; Total time: " + formatTime(directions.totalTime);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //List the directions and create hyperlinks for each route segment
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var dirStrings = ["&amp;lt;ol&amp;gt;"];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.forEach(solveResult.routeResults[0].directions.features, function(feature, i) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dirStrings.push("&amp;lt;li onclick='zoomToSegment(" + i + "); return false;' class=\"segment\"&amp;gt;&amp;lt;a href=\"#\"&amp;gt;" + feature.attributes.text + " (" + formatDistance(feature.attributes.length ,"miles") + ", " + formatTime(feature.attributes.time) + ")&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dirStrings.push("&amp;lt;/ol&amp;gt;");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.byId("directions").innerHTML = dirStrings.join("");

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zoomToFullRoute();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Display any errors that were caught when attempting to solve the rotue
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function errorHandler(err) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert("An error occured\n" + err.message + "\n" + err.details.join("\n"));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Zoom to the appropriate segment when the user clicks a hyperlink in the directions list
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function zoomToSegment(index) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var segment = directionFeatures[index];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.setExtent(segment.geometry.getExtent(), true);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (! segmentGraphic) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; segmentGraphic = map.graphics.add(new esri.Graphic(segment.geometry, segmentSymbol));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; segmentGraphic.setGeometry(segment.geometry);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function zoomToFullRoute() {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.graphics.remove(segmentGraphic);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; segmentGraphic = null;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.setExtent(directions.extent, true);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Format the time as hours and minutes
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function formatTime(time) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var hr = Math.floor(time / 60), //Important to use math.floor with hours
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; min = Math.round(time % 60);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (hr &amp;lt; 1 &amp;amp;&amp;amp; min &amp;lt; 1) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if (hr &amp;lt; 1) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return min + " minute(s)";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return hr + " hour(s) " + min + " minute(s)";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Round the distance to the nearest hundredth of a unit
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function formatDistance(dist, units) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var d = Math.round(dist * 100) / 100;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (d === 0) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return d + " " + units;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/script&amp;gt;

&amp;nbsp; &amp;lt;/head&amp;gt;
&amp;nbsp; &amp;lt;body class="claro"&amp;gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input type="text" id="fromTxf" value="380 New York St, Redlands, CA, 92373" size="30" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input type="text" id="toTxf" value="111 W Harbor Dr, San Diego, CA, 92101" size="30" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;button onclick="getDirections();"&amp;gt;Get Directions&amp;lt;/button&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;table&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;tbody&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;tr&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td&amp;gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div id="map" style="width:600px; height:400px; border:1px solid #000;"&amp;gt;&amp;lt;/div&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/td&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td valign="top"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div style="width:400px; height:400px; overflow:auto; border:1px solid #000;"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div id="summary" onclick="zoomToFullRoute();" class="segment"&amp;gt;&amp;lt;/div&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div id="directions"&amp;gt;&amp;lt;/div&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/td&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/tr&amp;gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/tbody&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/table&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ol&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;li&amp;gt;Enter from/to address (format: &amp;amp;lt;Street, City, State, Zip&amp;amp;gt;).&amp;lt;/li&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;li&amp;gt;Click the 'Get Directions' to get directions.&amp;lt;/li&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;li&amp;gt;Click an item in the directions to zoom to that segment.&amp;lt;/li&amp;gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/ol&amp;gt;
&amp;nbsp; &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:56:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-driving-directions-sample-customization/m-p/633370#M59155</guid>
      <dc:creator>AlexeyTereshenkov</dc:creator>
      <dc:date>2021-12-12T02:56:52Z</dc:date>
    </item>
  </channel>
</rss>

