<?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: HowTo set Default widget for ArcGIS Maps SDK for JavaScript 4 in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/howto-set-default-widget-for-arcgis-maps-sdk-for/m-p/1363137#M83177</link>
    <description>My solution was to change the widget to esri/widget/Measurement2D, which does not have the undesired behavior. I still would like to see how to set the activeTool programmatically.&lt;BR /&gt;</description>
    <pubDate>Wed, 20 Dec 2023 17:23:49 GMT</pubDate>
    <dc:creator>RichardDaniels</dc:creator>
    <dc:date>2023-12-20T17:23:49Z</dc:date>
    <item>
      <title>HowTo set Default widget for ArcGIS Maps SDK for JavaScript 4</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/howto-set-default-widget-for-arcgis-maps-sdk-for/m-p/1362355#M83159</link>
      <description>&lt;P&gt;I'm creating a new&amp;nbsp;ArcGIS Maps SDK for JavaScript 4.28 web application and have been going through and adding each needed widget in sequence (and testing). However, after adding the Measurement widget the mouse now defaults to the measure tool. How do I change the mouse 'back' to the default (Arrow) icon used for panning-zooming? I only want the measure tool to be active after the user clicks the Measurement button.&lt;/P&gt;&lt;DIV&gt;//add the measurement widget&lt;/DIV&gt;&lt;DIV&gt;var measurement = new Measurement({&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; view: view,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; activeTool: "distance",&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; linearUnit: "imperial"&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; });&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;var bgExpand4 = new Expand({&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;expandIcon: "measure",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;view:view,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;content: measurement,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;label: "Measurement"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;);&lt;/DIV&gt;&lt;DIV&gt;view.ui.add(bgExpand4, "top-right");&lt;/DIV&gt;</description>
      <pubDate>Tue, 19 Dec 2023 00:12:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/howto-set-default-widget-for-arcgis-maps-sdk-for/m-p/1362355#M83159</guid>
      <dc:creator>RichardDaniels</dc:creator>
      <dc:date>2023-12-19T00:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: HowTo set Default widget for ArcGIS Maps SDK for JavaScript 4</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/howto-set-default-widget-for-arcgis-maps-sdk-for/m-p/1363132#M83176</link>
      <description>&lt;P&gt;You are setting the activeTool when you are initializing the widget, you can either set it to null or just remove it all together.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const measurement = new Measurement({
  view: view,
  linearUnit: "imperial"
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2023 17:16:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/howto-set-default-widget-for-arcgis-maps-sdk-for/m-p/1363132#M83176</guid>
      <dc:creator>Justin_Greco</dc:creator>
      <dc:date>2023-12-20T17:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: HowTo set Default widget for ArcGIS Maps SDK for JavaScript 4</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/howto-set-default-widget-for-arcgis-maps-sdk-for/m-p/1363137#M83177</link>
      <description>My solution was to change the widget to esri/widget/Measurement2D, which does not have the undesired behavior. I still would like to see how to set the activeTool programmatically.&lt;BR /&gt;</description>
      <pubDate>Wed, 20 Dec 2023 17:23:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/howto-set-default-widget-for-arcgis-maps-sdk-for/m-p/1363137#M83177</guid>
      <dc:creator>RichardDaniels</dc:creator>
      <dc:date>2023-12-20T17:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: HowTo set Default widget for ArcGIS Maps SDK for JavaScript 4</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/howto-set-default-widget-for-arcgis-maps-sdk-for/m-p/1363156#M83178</link>
      <description>&lt;P&gt;Have you looked at the sample for the &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/widgets-measurement/" target="_self"&gt;Measurement&lt;/A&gt; widget? The Measurement widget really is just a way to wrap the distance and area measurement widgets into one widget.&amp;nbsp; You do need to build the button UI yourself, the sample there is a distance, area, and clear button.&amp;nbsp; On the button click event is when you would set the active tool.&amp;nbsp; The sample is geared toward an app where you can switch between 2D and 3D, since it sounds. like you are just working in 2D, I simplified it below.&lt;/P&gt;&lt;P&gt;Though if you are just looking to have a distance measurement and no area measurement, you're good just using the DistanceMeasurement2D widget.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;        distanceButton.addEventListener("click", () =&amp;gt; {
          distanceMeasurement();
        });

        function distanceMeasurement() {
          measurement.activeTool = "distance";
          distanceButton.classList.add("active");
          areaButton.classList.remove("active");
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2023 17:46:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/howto-set-default-widget-for-arcgis-maps-sdk-for/m-p/1363156#M83178</guid>
      <dc:creator>Justin_Greco</dc:creator>
      <dc:date>2023-12-20T17:46:47Z</dc:date>
    </item>
  </channel>
</rss>

