<?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: MapViewAutomationPeer zoom based on rectangle size? in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/mapviewautomationpeer-zoom-based-on-rectangle-size/m-p/581903#M7107</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to use based on a rectangle, convert the rectangle to an Envelope in map units ( MapView.LocationToScreen(...) ), and use the SetViewpointGeometryAsync(Envelope).&lt;BR /&gt;&lt;BR /&gt;You could also use the sketch editor to draw that rectangle, and then just pass it straight to the setviewpoint method&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Dec 2019 23:24:22 GMT</pubDate>
    <dc:creator>dotMorten_esri</dc:creator>
    <dc:date>2019-12-03T23:24:22Z</dc:date>
    <item>
      <title>MapViewAutomationPeer zoom based on rectangle size?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/mapviewautomationpeer-zoom-based-on-rectangle-size/m-p/581900#M7104</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 am trying to build basic navigation control on map.On button click I want to draw rectangle and perform zoom in/out&amp;nbsp;operation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found&amp;nbsp;MapViewAutomationPeer clss to control map zoom but it doesn't work as expected.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ZoomInAnimated/ZoomOutAnimated only zoom to center point. No option for scale.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the best approach to zoom using rectangle size? i.e. if the rectangle is bigger than zoom to less scale else on higher side.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using WPF &lt;STRONG&gt;100.6&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prashant&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Nov 2019 03:52:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/mapviewautomationpeer-zoom-based-on-rectangle-size/m-p/581900#M7104</guid>
      <dc:creator>PrashantKirpan</dc:creator>
      <dc:date>2019-11-29T03:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: MapViewAutomationPeer zoom based on rectangle size?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/mapviewautomationpeer-zoom-based-on-rectangle-size/m-p/581901#M7105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using the Shift key in conjunction with the mouse provides&amp;nbsp;the ability to draw a box and zoom in. To zoom out, use the Shift+Control keys and the mouse.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Dec 2019 23:32:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/mapviewautomationpeer-zoom-based-on-rectangle-size/m-p/581901#M7105</guid>
      <dc:creator>MichaelBranscomb</dc:creator>
      <dc:date>2019-12-02T23:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: MapViewAutomationPeer zoom based on rectangle size?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/mapviewautomationpeer-zoom-based-on-rectangle-size/m-p/581902#M7106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Michael for reply,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am migrating my app esri runtime 10.7 to 100.6 and would like to keep consistent behavior. Application is mainly used for data capturing and hosted on windows motion tablet so&amp;nbsp;I am looking for both options.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Out of the box navigation is working fine but just wanted to know&amp;nbsp;is it not possible to zoom in/out using mouse + drawing rectangle without shift key?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prashant Kirpan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Dec 2019 00:04:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/mapviewautomationpeer-zoom-based-on-rectangle-size/m-p/581902#M7106</guid>
      <dc:creator>PrashantKirpan</dc:creator>
      <dc:date>2019-12-03T00:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: MapViewAutomationPeer zoom based on rectangle size?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/mapviewautomationpeer-zoom-based-on-rectangle-size/m-p/581903#M7107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to use based on a rectangle, convert the rectangle to an Envelope in map units ( MapView.LocationToScreen(...) ), and use the SetViewpointGeometryAsync(Envelope).&lt;BR /&gt;&lt;BR /&gt;You could also use the sketch editor to draw that rectangle, and then just pass it straight to the setviewpoint method&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Dec 2019 23:24:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/mapviewautomationpeer-zoom-based-on-rectangle-size/m-p/581903#M7107</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2019-12-03T23:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: MapViewAutomationPeer zoom based on rectangle size?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/mapviewautomationpeer-zoom-based-on-rectangle-size/m-p/581904#M7108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Morten,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, this is working in case of &lt;STRONG&gt;zoom-In&lt;/STRONG&gt; but how to implement&amp;nbsp;&lt;STRONG&gt;zoom-Out&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to below code for zoom out but not sure how to determine zoom level i.e. for small rectangle zoom out to lowest zoom level.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Geometry geometry = await MpView.SketchEditor.StartAsync(SketchCreationMode.Rectangle, false);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; var point = MpView.LocationToScreen(geometry.Extent.GetCenter());&lt;BR /&gt; Esri.ArcGISRuntime.UI.Controls.MapViewAutomationPeer peer = Esri.ArcGISRuntime.UI.Controls.MapViewAutomationPeer.FromElement(MpView) as Esri.ArcGISRuntime.UI.Controls.MapViewAutomationPeer;&lt;BR /&gt; peer.ZoomOutAnimated(point);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Working zoom in code as you suggested:&lt;/STRONG&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&amp;nbsp; Geometry geometry = await MpView.SketchEditor.StartAsync(SketchCreationMode.Rectangle, false);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;await MpView.SetViewpointGeometryAsync(geometry.Extent);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prashant&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Dec 2019 23:46:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/mapviewautomationpeer-zoom-based-on-rectangle-size/m-p/581904#M7108</guid>
      <dc:creator>PrashantKirpan</dc:creator>
      <dc:date>2019-12-03T23:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: MapViewAutomationPeer zoom based on rectangle size?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/mapviewautomationpeer-zoom-based-on-rectangle-size/m-p/581905#M7109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For zoom-out you'd have to calculate the 'opposite' rectangle, which granted isn't straight-forward. Typically you'd expand around&amp;nbsp;a location inside the rectangle by a certain amount relative to the size of the rectangle (a smaller rectangle would typically mean zoom out more). It's a bit of math, but not horrible, so play with a few values and see what works for you. The simplest would be just to take the current map-scale, and multiple it by the relative width between the view size and the rectangle size, and then zoom to that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Dec 2019 01:10:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/mapviewautomationpeer-zoom-based-on-rectangle-size/m-p/581905#M7109</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2019-12-04T01:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: MapViewAutomationPeer zoom based on rectangle size?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/mapviewautomationpeer-zoom-based-on-rectangle-size/m-p/581906#M7110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Morten,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to calculate values to zoom out rectangle but not working as expected. Is it possible for you to provide any sample formula for below solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;SPAN style="background-color: #ffffff;"&gt;The simplest would be just to take the current map-scale, and multiple it by the relative width between the view size and the rectangle size, and then zoom to that.&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated,&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prashant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Dec 2019 01:46:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/mapviewautomationpeer-zoom-based-on-rectangle-size/m-p/581906#M7110</guid>
      <dc:creator>PrashantKirpan</dc:creator>
      <dc:date>2019-12-17T01:46:06Z</dc:date>
    </item>
  </channel>
</rss>

