<?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 Extent.intersects() method returns incorrect value in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/extent-intersects-method-returns-incorrect-value/m-p/505096#M46895</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am using the esri.geometry.Extent.intersects() method which is returning a boolean true or false based on whether or not the extent intersects the other extent.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The documentation states that it should return the actual intersection extent:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi_start.htm#jsapi/extent.htm#intersects" rel="nofollow" target="_blank"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi_start.htm#jsapi/extent.htm#intersects&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this a case of the documentation being incorrect or the API being incorrect?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Sep 2012 14:59:30 GMT</pubDate>
    <dc:creator>SamLarsen</dc:creator>
    <dc:date>2012-09-03T14:59:30Z</dc:date>
    <item>
      <title>Extent.intersects() method returns incorrect value</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/extent-intersects-method-returns-incorrect-value/m-p/505096#M46895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am using the esri.geometry.Extent.intersects() method which is returning a boolean true or false based on whether or not the extent intersects the other extent.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The documentation states that it should return the actual intersection extent:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi_start.htm#jsapi/extent.htm#intersects" rel="nofollow" target="_blank"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi_start.htm#jsapi/extent.htm#intersects&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this a case of the documentation being incorrect or the API being incorrect?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2012 14:59:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/extent-intersects-method-returns-incorrect-value/m-p/505096#M46895</guid>
      <dc:creator>SamLarsen</dc:creator>
      <dc:date>2012-09-03T14:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: Extent.intersects() method returns incorrect value</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/extent-intersects-method-returns-incorrect-value/m-p/505097#M46896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It appears that the API is correct and the documentation is incorrect or out of date.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For those looking for an actual intersection extent i have extended the API to generate the extent:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;dojo.extend(esri.geometry.Extent,{&amp;nbsp; intersection: function(/*esri.geometry.Extent*/ extent) { &amp;nbsp; //&amp;nbsp; summary:&amp;nbsp; &amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp; Calculate the intersection extent of two extents &amp;nbsp; //&amp;nbsp; returns: &amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp; The intersection extent &amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp; esri.geometry.Extent || null &amp;nbsp; var overlap = null; &amp;nbsp; if(this.intersects(extent)){ &amp;nbsp;&amp;nbsp; //&amp;nbsp; create a new intersection geometry &amp;nbsp;&amp;nbsp; overlap = new esri.geometry.Extent( &amp;nbsp;&amp;nbsp;&amp;nbsp; this.xmin &amp;gt; extent.xmin ? this.xmin : extent.xmin, &amp;nbsp;&amp;nbsp;&amp;nbsp; this.ymin &amp;gt; extent.ymin ? this.ymin : extent.ymin, &amp;nbsp;&amp;nbsp;&amp;nbsp; this.xmax &amp;lt; extent.xmax ? this.xmax : extent.xmax, &amp;nbsp;&amp;nbsp;&amp;nbsp; this.ymax &amp;lt; extent.ymax ? this.ymax : extent.ymax, &amp;nbsp;&amp;nbsp;&amp;nbsp; this.spatialReference &amp;nbsp;&amp;nbsp; ); &amp;nbsp; } &amp;nbsp; return overlap;&amp;nbsp; } });&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2012 15:44:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/extent-intersects-method-returns-incorrect-value/m-p/505097#M46896</guid>
      <dc:creator>SamLarsen</dc:creator>
      <dc:date>2012-09-03T15:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: Extent.intersects() method returns incorrect value</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/extent-intersects-method-returns-incorrect-value/m-p/505098#M46897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Sam,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;esri.geometry.Extent.intersects does return an extent when an extent is passed to it and the two extents intersect. Here's a test case:&amp;nbsp; &lt;/SPAN&gt;&lt;A href="http://jsfiddle.net/w45HY/"&gt;http://jsfiddle.net/w45HY/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you're not passing an extent to extent.intersects() (that is, you pass some other geometry type like Point or Polygon), you get a boolean back. Can you confirm that this works on your end?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit:&amp;nbsp; we'll update the docs to say that a boolean is returned if a non-extent geometry is passed to extent.intersects().&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2012 14:53:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/extent-intersects-method-returns-incorrect-value/m-p/505098#M46897</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2012-09-05T14:53:21Z</dc:date>
    </item>
  </channel>
</rss>

