<?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: Measurement Widget (Only show most recent distance) in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-widget-only-show-most-recent-distance/m-p/1001550#M70815</link>
    <description>&lt;P&gt;I do not see a documented way to access that value.&lt;/P&gt;&lt;P&gt;As a workaround, it does seem like there is a "result" property is available on the "measurement" widget object. &lt;EM&gt;&lt;U&gt;&lt;STRONG&gt;This is not documented, so use at your own risk!&lt;/STRONG&gt;&lt;/U&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;It looks like it does not convert units that the widget has chosen, but instead shows the units of the map (meters for web mercator). So you can access the value there, save it, and do what you need. It seems like it's not populated until after some asynchronous amount of time, so you need to use a setTimeout to get the value too (not very consistent - again, use at your own risk and only if you know what you're doing). Example here: &lt;A href="https://codepen.io/gavinr/pen/eYzxjmJ?editors=0010" target="_blank"&gt;https://codepen.io/gavinr/pen/eYzxjmJ?editors=0010&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If there's something I'm missing and there's a better, documented way to do this that someone else will post later, please use that - this is not an ideal solution.&lt;/P&gt;</description>
    <pubDate>Sat, 14 Nov 2020 18:44:28 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2020-11-14T18:44:28Z</dc:date>
    <item>
      <title>Measurement Widget (Only show most recent distance)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-widget-only-show-most-recent-distance/m-p/1000931#M70793</link>
      <description>&lt;P&gt;Using Javascript 3.34&lt;/P&gt;&lt;P&gt;Is there a simple way to only show the most recent distance measured with the measurement widget instead of having the distance added to the previous distance every time you click? If not, is there a simple way to store the current value into a variable? I'm having a hard time tracking down where I can either find or calculate that value.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 22:18:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-widget-only-show-most-recent-distance/m-p/1000931#M70793</guid>
      <dc:creator>khanley</dc:creator>
      <dc:date>2020-11-12T22:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Measurement Widget (Only show most recent distance)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-widget-only-show-most-recent-distance/m-p/1001550#M70815</link>
      <description>&lt;P&gt;I do not see a documented way to access that value.&lt;/P&gt;&lt;P&gt;As a workaround, it does seem like there is a "result" property is available on the "measurement" widget object. &lt;EM&gt;&lt;U&gt;&lt;STRONG&gt;This is not documented, so use at your own risk!&lt;/STRONG&gt;&lt;/U&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;It looks like it does not convert units that the widget has chosen, but instead shows the units of the map (meters for web mercator). So you can access the value there, save it, and do what you need. It seems like it's not populated until after some asynchronous amount of time, so you need to use a setTimeout to get the value too (not very consistent - again, use at your own risk and only if you know what you're doing). Example here: &lt;A href="https://codepen.io/gavinr/pen/eYzxjmJ?editors=0010" target="_blank"&gt;https://codepen.io/gavinr/pen/eYzxjmJ?editors=0010&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If there's something I'm missing and there's a better, documented way to do this that someone else will post later, please use that - this is not an ideal solution.&lt;/P&gt;</description>
      <pubDate>Sat, 14 Nov 2020 18:44:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-widget-only-show-most-recent-distance/m-p/1001550#M70815</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-11-14T18:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: Measurement Widget (Only show most recent distance)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-widget-only-show-most-recent-distance/m-p/1002649#M70849</link>
      <description>&lt;P&gt;This is perfect. Thank you so much!&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2020 18:45:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/measurement-widget-only-show-most-recent-distance/m-p/1002649#M70849</guid>
      <dc:creator>khanley</dc:creator>
      <dc:date>2020-11-18T18:45:14Z</dc:date>
    </item>
  </channel>
</rss>

