<?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: Silverlight Equivalent to Flex API's map.extent.containsExtent Method in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-equivalent-to-flex-api-s-map-extent/m-p/148870#M3722</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the workaround Jennifer, I really appreciate the code sample.&amp;nbsp; That will get me where I need to be on this.&amp;nbsp; It would be great though if there were more similarities between methods in the Flex and Silverlight APIs.&amp;nbsp; You would think the two would have a ton of the same type of functionality.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Oct 2010 14:27:29 GMT</pubDate>
    <dc:creator>AndyWright</dc:creator>
    <dc:date>2010-10-29T14:27:29Z</dc:date>
    <item>
      <title>Silverlight Equivalent to Flex API's map.extent.containsExtent Method</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-equivalent-to-flex-api-s-map-extent/m-p/148868#M3720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a situation where after the user performs a search, I automatically zoom to the location of the selected feature at a pre-defined scale.&amp;nbsp; Every once in a while the extent of the polygon feature is larger than the map extent after it has been zoomed to the pre-defined scale.&amp;nbsp; In the Flex API there was a nice method on the map extent called containsExtent.&amp;nbsp; You passed in another extent to that method and it would return a boolean saying whether or not the current map extent fully contained the passed in map extent.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I could run this code that would let me know if the extent of my selected polygon was not contained by the current map extent.&amp;nbsp; Then I could back the map's level out a notch so the current map view would display my selected feature in its entirety.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if (!map.extent.containsExtent(selectedFeatureExtent))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.level--;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The only semi-valuable property I see on envelope objects in the Silverlight API is intersects, but this won't perform the same type of function that containsExtent does.&amp;nbsp; Can anyone provide me with a nudge in the right direction on this one?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks a ton ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Andy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Oct 2010 21:39:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-equivalent-to-flex-api-s-map-extent/m-p/148868#M3720</guid>
      <dc:creator>AndyWright</dc:creator>
      <dc:date>2010-10-28T21:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: Silverlight Equivalent to Flex API's map.extent.containsExtent Method</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-equivalent-to-flex-api-s-map-extent/m-p/148869#M3721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can call Map.ZoomTo(Geometry geometry) to zoom to the feature's geometry.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To check whether the feature's geometry is within the map's extent, you can do where env is the graphic's Geometry.Extent&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp; private bool IsWithin(Envelope env)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; return (env.XMin &amp;gt;= Map.Extent.XMin &amp;amp;&amp;amp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; env.XMax &amp;lt;= Map.Extent.XMax &amp;amp;&amp;amp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; env.YMin &amp;gt;= Map.Extent.YMin &amp;amp;&amp;amp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; env.YMax &amp;lt;= Map.Extent.YMax);
&amp;nbsp; }
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:03:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-equivalent-to-flex-api-s-map-extent/m-p/148869#M3721</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2021-12-11T08:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: Silverlight Equivalent to Flex API's map.extent.containsExtent Method</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-equivalent-to-flex-api-s-map-extent/m-p/148870#M3722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the workaround Jennifer, I really appreciate the code sample.&amp;nbsp; That will get me where I need to be on this.&amp;nbsp; It would be great though if there were more similarities between methods in the Flex and Silverlight APIs.&amp;nbsp; You would think the two would have a ton of the same type of functionality.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Oct 2010 14:27:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-equivalent-to-flex-api-s-map-extent/m-p/148870#M3722</guid>
      <dc:creator>AndyWright</dc:creator>
      <dc:date>2010-10-29T14:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: Silverlight Equivalent to Flex API's map.extent.containsExtent Method</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-equivalent-to-flex-api-s-map-extent/m-p/148871#M3723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I failed to mention about Intersects method &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Geometry.Envelope~Intersects.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Geometry.Envelope~Intersects.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To figure out if the graphic's geometry belongs in the map's extent you can use this check:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
 if (graphic.Geometry.Extent.Intersects(Map.Extent)) 
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Intersects also check for the SpatialReference.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:03:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-equivalent-to-flex-api-s-map-extent/m-p/148871#M3723</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2021-12-11T08:03:34Z</dc:date>
    </item>
  </channel>
</rss>

