<?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 ZoomToResolution in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/zoomtoresolution/m-p/555565#M14261</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to set the slider to zoom the map.&amp;nbsp; I'm trying to set the ZoomToResolution Method. Can anyone provide some insight. In the API reference the method is declared first, I'm stuck at this declaration and the specifc execution.&amp;nbsp; I'm thinking I should use the Slider private void "Value Changed"; in this method assign each pixel value to its corresponding slider value (0-22) Using a Switch. We have extra cached layers . &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be much appreciated this is insanely frustrating&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ARCGIS API:&lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/api_start.htm"&gt;http://help.arcgis.com/en/webapi/silverlight/apiref/api_start.htm&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Sep 2011 12:10:52 GMT</pubDate>
    <dc:creator>NigelAlford</dc:creator>
    <dc:date>2011-09-20T12:10:52Z</dc:date>
    <item>
      <title>ZoomToResolution</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/zoomtoresolution/m-p/555565#M14261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to set the slider to zoom the map.&amp;nbsp; I'm trying to set the ZoomToResolution Method. Can anyone provide some insight. In the API reference the method is declared first, I'm stuck at this declaration and the specifc execution.&amp;nbsp; I'm thinking I should use the Slider private void "Value Changed"; in this method assign each pixel value to its corresponding slider value (0-22) Using a Switch. We have extra cached layers . &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be much appreciated this is insanely frustrating&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ARCGIS API:&lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/api_start.htm"&gt;http://help.arcgis.com/en/webapi/silverlight/apiref/api_start.htm&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Sep 2011 12:10:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/zoomtoresolution/m-p/555565#M14261</guid>
      <dc:creator>NigelAlford</dc:creator>
      <dc:date>2011-09-20T12:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: ZoomToResolution</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/zoomtoresolution/m-p/555566#M14262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;In the API reference the method is declared first, I'm stuck at this declaration and the specifc execution.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What do you mean exactly?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; &lt;BR /&gt; I'm thinking I should use the Slider private void "Value Changed"; &lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Couldn't you use the &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client.Toolkit~ESRI.ArcGIS.Client.Toolkit.Navigation.html"&gt;toolkit navigation control &lt;/A&gt;&lt;SPAN&gt;and customize it to your need? Or do you have very specific need?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Sep 2011 13:55:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/zoomtoresolution/m-p/555566#M14262</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2011-09-20T13:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: ZoomToResolution</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/zoomtoresolution/m-p/555567#M14263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have gotten the "ZoomToResolution" method to work not with a slider, but as the user clicks a point or the user clicks a row in a "FeatureDataGrid".&amp;nbsp; This is how I do it:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I use Bing Maps as a background; and it is Bing Maps resolution that guides all the values below.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. I had to find out the map minimun resolution; mine is 0.0988998672921598.&amp;nbsp; The Bing map for my region does not show any thing below this number.&amp;nbsp; So there is not point allowing the user to zoom beyond this resolution.&amp;nbsp; Your minimun map resolution may be higher or smaller, depending on the quality of your data.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Next, I determined what my optimun zoom resolution would be.&amp;nbsp; Mine is 2.09612619755423.&amp;nbsp; When the user clicks a point on the map or a row on the "FeatureDataGrid", I check if the current map resolution is less than my optimun resolution:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// XAML&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;esri:FeatureDataGrid&amp;nbsp; x:Name="MyDataGrid"SelectionChanged="MyDataGrid_SelectionChanged" /&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// Event handler for FeatureDataGrid SelectionChanged&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;private void MyDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs args)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// Retrieve current selected point from map or from FeatureDataGrid&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IEnumerable&amp;lt;Graphic&amp;gt; myGraphics = MyDataGrid.SelectedGraphics;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Graphic graphic = myGraphics.Last&amp;lt;Graphic&amp;gt;();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// Create a point&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MapPoint pt = new MapPoint(graphic.Geometry.Extent.XMin, graphic.Geometry.Extent.YMin);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// Set zoom resolution parameters&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;double zoomResolution = 2.09612619755423; // this is read-only property in my application&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;int mapResolution = Convert.ToInt32(MyMap.Resolution);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;int zoomResolution = Convert.ToInt32(zoomResolution);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// Zoom to my optimun map resolution, if current map's resolution is higher&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if (mapResolution &amp;gt; zoomResolution) MyMap.ZoomToResolution(ZoomResolution, pt);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// Is point inside envelope / map extent? It is, do not pan.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// The global field "currentEnvelope" is set at the map extent changed event:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// _currentEnvelope = e.NewExtent;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if (pt.Extent.Intersects(_currentEnvelope)) return;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/* The point falls outside the map viewable window.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; * Pan to it preserving the current map zoom extent.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;*/&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Envelope env = new Envelope(pt.X - ZoomXRadius, pt.Y - ZoomYRadius, pt.X + ZoomXRadius, pt.Y + ZoomYRadius);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; // Do pan to the point&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; MyMap.PanTo(env);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The properties ZoomXRadius and ZoomXRadius are read-only.&amp;nbsp; These are set at the constructor.&amp;nbsp; These hold the actual meter distance from the center of the optimun zoom resolution (envelope) of step 2.&amp;nbsp; In my case, ZoomXRadius =1750 meters and ZoomXRadius = 950 meters.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my case, I need to use "MyMap.PanTo" as well, for I want the map to display the selected point at the optimun zoom resolution.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope it helps.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hugo.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Sep 2011 14:04:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/zoomtoresolution/m-p/555567#M14263</guid>
      <dc:creator>HugoCardenas</dc:creator>
      <dc:date>2011-09-20T14:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: ZoomToResolution</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/zoomtoresolution/m-p/555568#M14264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dominique- I'm using those controls for the button functionality and they work great. But yes this is specific, I'm building an in-house silverlight SDK. The "Value Changed" is the on click event associated with slider.&amp;nbsp; The "Value" in this case ranges from 0-22 depending on the slider position on its line.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hugo- I'll try to adapt your method, because the map is constantly being panned the specified Map point has be to flexible. Thanks I'll let reply back with the verdict on your method.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Sep 2011 14:26:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/zoomtoresolution/m-p/555568#M14264</guid>
      <dc:creator>NigelAlford</dc:creator>
      <dc:date>2011-09-20T14:26:16Z</dc:date>
    </item>
  </channel>
</rss>

