<?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: JavaScript 4.x - looking to have the map scale update on Extent Change in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-4-x-looking-to-have-the-map-scale/m-p/268447#M24745</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks you for the input:&amp;nbsp; I did try the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Watch for the Scale on the Extent Change&lt;BR /&gt;&amp;nbsp; &amp;nbsp;mapView.watch('extent', function(){&lt;BR /&gt;&amp;nbsp; &amp;nbsp;console.log("Watch for the current scale: ", mapView.scale);&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I am wanting &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;.&amp;nbsp; Each time the extent changes, the scale refreshes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/441248_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Apr 2019 21:34:03 GMT</pubDate>
    <dc:creator>IanPeebles</dc:creator>
    <dc:date>2019-04-04T21:34:03Z</dc:date>
    <item>
      <title>JavaScript 4.x - looking to have the map scale update on Extent Change</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-4-x-looking-to-have-the-map-scale/m-p/268445#M24743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Has anyone been successful getting the map scale to update in console.log when an extent change is performed (through zooming with the mouse event: "zoom-end")?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am looking for a method in the 4.x API that is similar to the following methods using the 3.x API:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will update when "&lt;STRONG&gt;zoom-end&lt;/STRONG&gt;" is completed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;getScale()&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;getZoom()&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do have this working in the 3.x environment, but not having much luck using the 4.x API reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a block of code I used for the 3.x API and it works well:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Return Map Scale Results to Application - Calculation (/12) based on Feet NOT Meters&lt;BR /&gt;&amp;nbsp; map.on("zoom-end", function() {&lt;BR /&gt;&amp;nbsp; var returnZoomResult = document.getElementById("zoomToScaleResults");&lt;BR /&gt;&amp;nbsp; var scale = map.getScale()/12;&lt;BR /&gt;&amp;nbsp; var roundScale = Math.round(scale);&lt;BR /&gt;&amp;nbsp; returnZoomResult.innerHTML = roundScale + " feet";&lt;BR /&gt; });&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Apr 2019 20:29:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-4-x-looking-to-have-the-map-scale/m-p/268445#M24743</guid>
      <dc:creator>IanPeebles</dc:creator>
      <dc:date>2019-04-04T20:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript 4.x - looking to have the map scale update on Extent Change</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-4-x-looking-to-have-the-map-scale/m-p/268446#M24744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; In 4.x events are not used very much instead you watch properties, like the view stationary property using watchUtils.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#stationary"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#stationary&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Apr 2019 20:34:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-4-x-looking-to-have-the-map-scale/m-p/268446#M24744</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2019-04-04T20:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript 4.x - looking to have the map scale update on Extent Change</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-4-x-looking-to-have-the-map-scale/m-p/268447#M24745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks you for the input:&amp;nbsp; I did try the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Watch for the Scale on the Extent Change&lt;BR /&gt;&amp;nbsp; &amp;nbsp;mapView.watch('extent', function(){&lt;BR /&gt;&amp;nbsp; &amp;nbsp;console.log("Watch for the current scale: ", mapView.scale);&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I am wanting &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;.&amp;nbsp; Each time the extent changes, the scale refreshes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/441248_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Apr 2019 21:34:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-4-x-looking-to-have-the-map-scale/m-p/268447#M24745</guid>
      <dc:creator>IanPeebles</dc:creator>
      <dc:date>2019-04-04T21:34:03Z</dc:date>
    </item>
  </channel>
</rss>

