<?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 Calculating map scale in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/calculating-map-scale/m-p/808485#M2278</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a geometry (an Envelope) defined by 2 lat/lon points.&amp;nbsp; I'm having trouble wrapping my head around the concept of the camera scale (in 2D) needed to exactly encapsulate that envelope.&amp;nbsp; I know that if I zoom the current view to the envelope then I will get the scale I'm looking for.&amp;nbsp; However, this also changes the actual view in the scene.&amp;nbsp; I'm looking to determine the Scale in a way that does not affect the users view.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;MapView view= MapView.Active;
await QueuedTask.Run(() =&amp;gt;
{
   // This works, but changes the user's view. Not good!
   view.ZoomTo(envelope);
   Debug.WriteLine("Scale: " + view.Camera.Scale);
});&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to manually calculate that scale value, or, to determine it somehow without affecting the view for the user?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 16:56:35 GMT</pubDate>
    <dc:creator>DerekVince</dc:creator>
    <dc:date>2021-12-12T16:56:35Z</dc:date>
    <item>
      <title>Calculating map scale</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/calculating-map-scale/m-p/808485#M2278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a geometry (an Envelope) defined by 2 lat/lon points.&amp;nbsp; I'm having trouble wrapping my head around the concept of the camera scale (in 2D) needed to exactly encapsulate that envelope.&amp;nbsp; I know that if I zoom the current view to the envelope then I will get the scale I'm looking for.&amp;nbsp; However, this also changes the actual view in the scene.&amp;nbsp; I'm looking to determine the Scale in a way that does not affect the users view.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;MapView view= MapView.Active;
await QueuedTask.Run(() =&amp;gt;
{
   // This works, but changes the user's view. Not good!
   view.ZoomTo(envelope);
   Debug.WriteLine("Scale: " + view.Camera.Scale);
});&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to manually calculate that scale value, or, to determine it somehow without affecting the view for the user?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:56:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/calculating-map-scale/m-p/808485#M2278</guid>
      <dc:creator>DerekVince</dc:creator>
      <dc:date>2021-12-12T16:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating map scale</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/calculating-map-scale/m-p/1026096#M6169</link>
      <description>&lt;P&gt;It is an old post but maybe it would help someone. You might need to insert the last line in another QueuedTask&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;await QueuedTask.Run(() =&amp;gt;
{
   //1st get the current envelope, so you can go back to it later after calc
   Envelope currentExtent = MapView.Active.Extent;
   currentExtGeometry = currentExtent.Clone();
   
   // Get your scale for the envelope
   view.ZoomTo(envelope);
   Debug.WriteLine("Scale: " + view.Camera.Scale);
   
   //Goback to previous extent
   MapView.Active.ZoomTo(currentExtGeometry);
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2021 22:35:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/calculating-map-scale/m-p/1026096#M6169</guid>
      <dc:creator>Amadeus111</dc:creator>
      <dc:date>2021-02-11T22:35:34Z</dc:date>
    </item>
  </channel>
</rss>

