<?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 How can I filter the travel modes displayed in the Directions widget? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-filter-the-travel-modes-displayed-in-the/m-p/275716#M25443</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;I have an NAServer with several travel modes defined on the Network Dataset and I'm using that service in a JS app with the Directions widget. Enabling the showTravelModesOption shows the travel modes menu, and everything works fine.&lt;BR /&gt;Now I need to restrict the number of displayed modes: The JS app is fired up with a country code parameter, and it is always using the same NAServer. Not all travel modes apply for every country, so I need to filter out some of the travel modes before showing them in the Directions Widget.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #303030;"&gt;&lt;BR /&gt;Here's what I tried:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="color: #303030;"&gt;Find a setter to apply the filtered l&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;ist. But there seems to be no setter: The Directions widget offers getSupportedTravelModeNames(), the RouteTask offers getServiceDescription(), which returns a Deferred object, that gives me supportedTravelModes. There is nothing for the complete list in the RouteParameters. &lt;BR /&gt;=&amp;gt; &lt;SPAN style="color: #303030; font-family: arial, helvetica, sans-serif;"&gt;Getters only for the complete list. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #303030;"&gt;DOM manipulation. dojo.query(".esriTravelModesTypeName") gives me the node where the travel modes menu appears, but I only get the one that is visible at the beginning. The others only appear when the user opens the menu, and that it too late to hide some child elements (or would at least result in an ugly effect).&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;BR /&gt;Does someone have an idea?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 May 2016 10:45:08 GMT</pubDate>
    <dc:creator>NiklasKöhn</dc:creator>
    <dc:date>2016-05-19T10:45:08Z</dc:date>
    <item>
      <title>How can I filter the travel modes displayed in the Directions widget?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-filter-the-travel-modes-displayed-in-the/m-p/275716#M25443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;I have an NAServer with several travel modes defined on the Network Dataset and I'm using that service in a JS app with the Directions widget. Enabling the showTravelModesOption shows the travel modes menu, and everything works fine.&lt;BR /&gt;Now I need to restrict the number of displayed modes: The JS app is fired up with a country code parameter, and it is always using the same NAServer. Not all travel modes apply for every country, so I need to filter out some of the travel modes before showing them in the Directions Widget.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #303030;"&gt;&lt;BR /&gt;Here's what I tried:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="color: #303030;"&gt;Find a setter to apply the filtered l&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;ist. But there seems to be no setter: The Directions widget offers getSupportedTravelModeNames(), the RouteTask offers getServiceDescription(), which returns a Deferred object, that gives me supportedTravelModes. There is nothing for the complete list in the RouteParameters. &lt;BR /&gt;=&amp;gt; &lt;SPAN style="color: #303030; font-family: arial, helvetica, sans-serif;"&gt;Getters only for the complete list. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #303030;"&gt;DOM manipulation. dojo.query(".esriTravelModesTypeName") gives me the node where the travel modes menu appears, but I only get the one that is visible at the beginning. The others only appear when the user opens the menu, and that it too late to hide some child elements (or would at least result in an ugly effect).&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;BR /&gt;Does someone have an idea?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2016 10:45:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-filter-the-travel-modes-displayed-in-the/m-p/275716#M25443</guid>
      <dc:creator>NiklasKöhn</dc:creator>
      <dc:date>2016-05-19T10:45:08Z</dc:date>
    </item>
  </channel>
</rss>

