<?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 Get the current scale for sceneView in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-the-current-scale-for-sceneview/m-p/173153#M16025</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am currently updating nliu's TOC for version 3.16 here: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.arcgis.com/home/item.html?id=9b6280a6bfb0430f8d1ebc969276b109" title="https://www.arcgis.com/home/item.html?id=9b6280a6bfb0430f8d1ebc969276b109"&gt;https://www.arcgis.com/home/item.html?id=9b6280a6bfb0430f8d1ebc969276b109&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to be compatible with V 4.x. I have made some good progress, but am stuck on the scale property of the view.&amp;nbsp; In version 3.x, the map object had the method .getScale() to get the current scale. The TOC calls this method to know whether to display/block out scale dependent layers. However, the scene view has no such property, but in the documentation it claims:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'&lt;SPAN style="color: #4c4c4c; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17px;"&gt;Traditional 2D mapping properties, such as &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale" style="color: #0079c1; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17px;"&gt;scale&lt;/A&gt;&lt;SPAN style="color: #4c4c4c; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17px;"&gt;, &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom" style="color: #0079c1; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17px;"&gt;zoom&lt;/A&gt;&lt;SPAN style="color: #4c4c4c; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17px;"&gt;, &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center" style="color: #0079c1; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17px;"&gt;center&lt;/A&gt;&lt;SPAN style="color: #4c4c4c; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17px;"&gt; and &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent" style="color: #0079c1; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17px;"&gt;extent&lt;/A&gt;&lt;SPAN style="color: #4c4c4c; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17px;"&gt; do not always work well in 3D. For example, a map's &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale" style="color: #0079c1; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17px;"&gt;scale&lt;/A&gt;&lt;SPAN style="color: #4c4c4c; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17px;"&gt; is not clear when viewed in the context of a globe. The SceneView therefore supports these properties on a best effort basis, with certain limitations'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17px;"&gt;Any ideas on how to get the value being used as 'scale' on the zoom event?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Jun 2016 19:50:14 GMT</pubDate>
    <dc:creator>MichaelHeirendt</dc:creator>
    <dc:date>2016-06-01T19:50:14Z</dc:date>
    <item>
      <title>Get the current scale for sceneView</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-the-current-scale-for-sceneview/m-p/173153#M16025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am currently updating nliu's TOC for version 3.16 here: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.arcgis.com/home/item.html?id=9b6280a6bfb0430f8d1ebc969276b109" title="https://www.arcgis.com/home/item.html?id=9b6280a6bfb0430f8d1ebc969276b109"&gt;https://www.arcgis.com/home/item.html?id=9b6280a6bfb0430f8d1ebc969276b109&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to be compatible with V 4.x. I have made some good progress, but am stuck on the scale property of the view.&amp;nbsp; In version 3.x, the map object had the method .getScale() to get the current scale. The TOC calls this method to know whether to display/block out scale dependent layers. However, the scene view has no such property, but in the documentation it claims:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'&lt;SPAN style="color: #4c4c4c; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17px;"&gt;Traditional 2D mapping properties, such as &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale" style="color: #0079c1; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17px;"&gt;scale&lt;/A&gt;&lt;SPAN style="color: #4c4c4c; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17px;"&gt;, &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom" style="color: #0079c1; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17px;"&gt;zoom&lt;/A&gt;&lt;SPAN style="color: #4c4c4c; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17px;"&gt;, &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center" style="color: #0079c1; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17px;"&gt;center&lt;/A&gt;&lt;SPAN style="color: #4c4c4c; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17px;"&gt; and &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent" style="color: #0079c1; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17px;"&gt;extent&lt;/A&gt;&lt;SPAN style="color: #4c4c4c; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17px;"&gt; do not always work well in 3D. For example, a map's &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale" style="color: #0079c1; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17px;"&gt;scale&lt;/A&gt;&lt;SPAN style="color: #4c4c4c; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17px;"&gt; is not clear when viewed in the context of a globe. The SceneView therefore supports these properties on a best effort basis, with certain limitations'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17px;"&gt;Any ideas on how to get the value being used as 'scale' on the zoom event?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jun 2016 19:50:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-the-current-scale-for-sceneview/m-p/173153#M16025</guid>
      <dc:creator>MichaelHeirendt</dc:creator>
      <dc:date>2016-06-01T19:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: Get the current scale for sceneView</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-the-current-scale-for-sceneview/m-p/173154#M16026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="color: #606060;"&gt;&amp;gt; &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;However, the scene view has no such property&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SceneView does have this property. See the documentation here - &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale" title="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale" rel="nofollow noopener noreferrer" target="_blank"&gt;SceneView | API Reference | ArcGIS API for JavaScript 4.0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can access the scale by simply referencing the property:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var view = new SceneView({
map: map,
container: "viewDiv"
});
console.log(view.scale);&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can even set the scale in the constructor:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var view = new SceneView({
map: map,
container: "viewDiv",
scale: 24000
});
console.log(view.scale);&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also watch the scale and do something with it each time it changes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var view = new SceneView({
map: map,
container: "viewDiv"
});
view.watch("scale", function(newScale){
console.log("scale: ", newScale);
});&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&amp;gt; &lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="font-size: 17px; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #4c4c4c;"&gt;Traditional 2D mapping properties, such as &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fdevelopers.arcgis.com%2Fjavascript%2Flatest%2Fapi-reference%2Fesri-views-SceneView.html%23scale" style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #287433;" target="_blank"&gt;scale&lt;/A&gt;&lt;SPAN style="font-size: 17px; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #4c4c4c;"&gt;, &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fdevelopers.arcgis.com%2Fjavascript%2Flatest%2Fapi-reference%2Fesri-views-SceneView.html%23zoom" style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #287433;" target="_blank"&gt;zoom&lt;/A&gt;&lt;SPAN style="font-size: 17px; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #4c4c4c;"&gt;, &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fdevelopers.arcgis.com%2Fjavascript%2Flatest%2Fapi-reference%2Fesri-views-SceneView.html%23center" style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #287433;" target="_blank"&gt;center&lt;/A&gt;&lt;SPAN style="font-size: 17px; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #4c4c4c;"&gt; and &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fdevelopers.arcgis.com%2Fjavascript%2Flatest%2Fapi-reference%2Fesri-views-SceneView.html%23extent" style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #287433;" target="_blank"&gt;extent&lt;/A&gt;&lt;SPAN style="font-size: 17px; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #4c4c4c;"&gt; do not always work well in 3D. For example, a map's &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fdevelopers.arcgis.com%2Fjavascript%2Flatest%2Fapi-reference%2Fesri-views-SceneView.html%23scale" style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #287433;" target="_blank"&gt;scale&lt;/A&gt;&lt;SPAN style="font-size: 17px; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #4c4c4c;"&gt; is not clear when viewed in the context of a globe. The SceneView therefore supports these properties on a best effort basis, with certain limitations'&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN style="font-size: 17px; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #4c4c4c;"&gt;This is talking about how a SceneView's actual scale will be different at any given point in the view. When we say SceneView.scale, what that actually refers to is the scale at the center of the view. This number does not reflect the scale at any other point in the view because of the earth's curvature. That's why working with scale in 3D can be problematic. Using SceneView.scale is still valid, but you should be aware of the issues surrounding scale in 3D.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:57:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-the-current-scale-for-sceneview/m-p/173154#M16026</guid>
      <dc:creator>KristianEkenes</dc:creator>
      <dc:date>2021-12-11T08:57:35Z</dc:date>
    </item>
  </channel>
</rss>

