<?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 Catch Directions widget stops changes (v4.32) in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/catch-directions-widget-stops-changes-v4-32/m-p/1605719#M86928</link>
    <description>&lt;P&gt;Hi gents,&lt;BR /&gt;I am (unsuccessfully) trying to detect when start and end position are set into the Direction Widget.&lt;BR /&gt;Even if I add positions on map through the widget, I never get the expected message in the console.&lt;/P&gt;&lt;P&gt;It drives me mad ! Could you help please&amp;nbsp; ?&lt;BR /&gt;&lt;BR /&gt;Here is the code (need an API Key to run) :&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;html lang="fr"&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;head&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;meta charset="UTF-8"&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;title&amp;gt;Carte de France - Widget Directions avec Route Layer&amp;lt;/title&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;script src="&lt;A href="https://js.arcgis.com/4.32/" target="_blank"&gt;https://js.arcgis.com/4.32/&lt;/A&gt;"&amp;gt;&amp;lt;/script&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;link rel="stylesheet" href="&lt;A href="https://js.arcgis.com/4.32/esri/themes/light/main.css" target="_blank"&gt;https://js.arcgis.com/4.32/esri/themes/light/main.css&lt;/A&gt;"&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;style&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;html, body, #viewDiv {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;height: 100%;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;margin: 0;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;padding: 0;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;/style&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;/head&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;body&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;div id="viewDiv"&amp;gt;&amp;lt;/div&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;script&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;require([&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"esri/Map",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"esri/views/MapView",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"esri/widgets/Directions",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"esri/layers/RouteLayer",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"esri/core/reactiveUtils"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;], function (Map, MapView, Directions, RouteLayer, reactiveUtils) {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;const apiKey = "YOUR_API_KEY";&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;// Initialisation de la carte&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;const routeLayer = new RouteLayer(); // Création d'une couche pour l'itinéraire&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;const map = new Map({&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;basemap: "streets-vector",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;layers: [routeLayer] // Ajout de la couche d'itinéraire à la carte&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;});&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;const view = new MapView({&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;container: "viewDiv",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;map: map,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;center: [2.21, 46.5], // Centré sur la France&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;zoom: 6&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;});&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;// Widget Directions avec RouteLayer attribué&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;const directionsWidget = new Directions({&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;view: view,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;apiKey: apiKey,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;layer: routeLayer, // Attribution de la couche d'itinéraire&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;visibleElements: {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;directions: true, // Afficher les directions&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;layerDetailsLink: false&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;});&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;view.ui.add(directionsWidget, "top-right");&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;// Surveiller les arrêts pour afficher un message dans la console&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;reactiveUtils.watch(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;() =&amp;gt; directionsWidget.viewModel.stops.length,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;(length) =&amp;gt; {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;if (length &amp;gt; 0) {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;const stops = directionsWidget.viewModel.stops.toArray();&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;stops.forEach((stop, index) =&amp;gt; {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;if (stop.name) {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;console.log(`Adresse ${index === 0 ? "de départ" : "d'arrivée"} confirmée : ${stop.name}`);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;});&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;});&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;/script&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;/body&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;/html&amp;gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Apr 2025 17:02:19 GMT</pubDate>
    <dc:creator>MarcStationsGPL</dc:creator>
    <dc:date>2025-04-14T17:02:19Z</dc:date>
    <item>
      <title>Catch Directions widget stops changes (v4.32)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/catch-directions-widget-stops-changes-v4-32/m-p/1605719#M86928</link>
      <description>&lt;P&gt;Hi gents,&lt;BR /&gt;I am (unsuccessfully) trying to detect when start and end position are set into the Direction Widget.&lt;BR /&gt;Even if I add positions on map through the widget, I never get the expected message in the console.&lt;/P&gt;&lt;P&gt;It drives me mad ! Could you help please&amp;nbsp; ?&lt;BR /&gt;&lt;BR /&gt;Here is the code (need an API Key to run) :&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;html lang="fr"&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;head&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;meta charset="UTF-8"&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;title&amp;gt;Carte de France - Widget Directions avec Route Layer&amp;lt;/title&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;script src="&lt;A href="https://js.arcgis.com/4.32/" target="_blank"&gt;https://js.arcgis.com/4.32/&lt;/A&gt;"&amp;gt;&amp;lt;/script&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;link rel="stylesheet" href="&lt;A href="https://js.arcgis.com/4.32/esri/themes/light/main.css" target="_blank"&gt;https://js.arcgis.com/4.32/esri/themes/light/main.css&lt;/A&gt;"&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;style&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;html, body, #viewDiv {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;height: 100%;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;margin: 0;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;padding: 0;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;/style&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;/head&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;body&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;div id="viewDiv"&amp;gt;&amp;lt;/div&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;script&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;require([&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"esri/Map",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"esri/views/MapView",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"esri/widgets/Directions",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"esri/layers/RouteLayer",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"esri/core/reactiveUtils"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;], function (Map, MapView, Directions, RouteLayer, reactiveUtils) {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;const apiKey = "YOUR_API_KEY";&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;// Initialisation de la carte&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;const routeLayer = new RouteLayer(); // Création d'une couche pour l'itinéraire&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;const map = new Map({&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;basemap: "streets-vector",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;layers: [routeLayer] // Ajout de la couche d'itinéraire à la carte&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;});&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;const view = new MapView({&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;container: "viewDiv",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;map: map,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;center: [2.21, 46.5], // Centré sur la France&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;zoom: 6&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;});&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;// Widget Directions avec RouteLayer attribué&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;const directionsWidget = new Directions({&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;view: view,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;apiKey: apiKey,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;layer: routeLayer, // Attribution de la couche d'itinéraire&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;visibleElements: {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;directions: true, // Afficher les directions&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;layerDetailsLink: false&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;});&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;view.ui.add(directionsWidget, "top-right");&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;// Surveiller les arrêts pour afficher un message dans la console&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;reactiveUtils.watch(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;() =&amp;gt; directionsWidget.viewModel.stops.length,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;(length) =&amp;gt; {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;if (length &amp;gt; 0) {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;const stops = directionsWidget.viewModel.stops.toArray();&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;stops.forEach((stop, index) =&amp;gt; {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;if (stop.name) {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;console.log(`Adresse ${index === 0 ? "de départ" : "d'arrivée"} confirmée : ${stop.name}`);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;});&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;});&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;/script&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;/body&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;/html&amp;gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Apr 2025 17:02:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/catch-directions-widget-stops-changes-v4-32/m-p/1605719#M86928</guid>
      <dc:creator>MarcStationsGPL</dc:creator>
      <dc:date>2025-04-14T17:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: Catch Directions widget stops changes (v4.32)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/catch-directions-widget-stops-changes-v4-32/m-p/1605909#M86936</link>
      <description>&lt;P&gt;&lt;SPAN&gt;directionsWidget.viewModel does not have "stops" property. You should&amp;nbsp;&lt;/SPAN&gt;watch &lt;SPAN&gt;directionsWidget.&lt;/SPAN&gt;lastRoute.&lt;/P&gt;&lt;P&gt;lastRoute also contains a lot of other information, like route lines, travel times, distance, barriers, etc.&lt;/P&gt;&lt;P&gt;Docs:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#lastRoute" target="_blank"&gt;Directions | API Reference | ArcGIS Maps SDK for JavaScript 4.32 | Esri Developer&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;reactiveUtils.watch(
  () =&amp;gt; directionsWidget.lastRoute,
  (lastRoute) =&amp;gt; {
    const stops = lastRoute.stops;
    stops.forEach((stop, index) =&amp;gt; {
      if (stop.name) {
        console.log(`Adresse ${index === 0 ? "de départ" : "d'arrivée"} confirmée : ${stop.name}`);
      }
    });
  }
);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Apr 2025 07:49:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/catch-directions-widget-stops-changes-v4-32/m-p/1605909#M86936</guid>
      <dc:creator>Edvinas_S</dc:creator>
      <dc:date>2025-04-15T07:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: Catch Directions widget stops changes (v4.32)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/catch-directions-widget-stops-changes-v4-32/m-p/1606155#M86947</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/900084"&gt;@MarcStationsGPL&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/413145"&gt;@Edvinas_S&lt;/a&gt;&amp;nbsp;is correct. &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html" target="_self"&gt;DirectionsViewModel&lt;/A&gt; no longer has a `stops` property. Current stops are accessible from either the underlying &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#layer" target="_self"&gt;route layer&lt;/A&gt; or via &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#lastRoute" target="_self"&gt;lastRoute&lt;/A&gt; which contains a reference to the solved route.&lt;/P&gt;&lt;P&gt;In the snippet below, the collection of stops in the route layer are "watched" for additions. Additionally, the code watches for changes in stop geometry (e.g. when a stop is "located" or moved).&lt;/P&gt;&lt;P&gt;As noted &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html" target="_self"&gt;here&lt;/A&gt;, when if an empty route layer is assigned to the Directions widget, two stops without a name or geometry are added to the layer. This is why `monitorStopLocationChanges` is called immediately after the widget is created below.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const directions = new Directions({ apiKey, view, layer });
view.ui.add(directions, "top-right");

for (const stop of directions.layer.stops) {
  monitorStopLocationChanges(stop);
}

reactiveUtils.on(
  () =&amp;gt; directions.layer.stops,
  "change",
  (e) =&amp;gt; {
    console.log("Stops added", e.added);
    for (const stop of e.added) {
      monitorStopLocationChanges(stop);
    }
  }
)

function monitorStopLocationChanges(stop) {
  reactiveUtils.watch(
    () =&amp;gt; stop.geometry,
    (geometry) =&amp;gt; {
      console.log("Stop location changed", geometry);
    }
  );
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Apr 2025 00:34:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/catch-directions-widget-stops-changes-v4-32/m-p/1606155#M86947</guid>
      <dc:creator>RichieCarmichael</dc:creator>
      <dc:date>2025-04-16T00:34:49Z</dc:date>
    </item>
  </channel>
</rss>

