<?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 coincident points - extent in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/coincident-points-extent/m-p/615935#M57557</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to check for coincident points being returned from a FindTask, in order to zoom to the proper extent.&amp;nbsp; I am currently zooming using a centerAndZoom for single points, and using a setExtent for lines, polygons and multiple points.&amp;nbsp; But this will not work properly if the results set is a pair of coincident points, for example.&amp;nbsp; Below is a sample of my current zoom code, but I need a solution for this coincident point scenario.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone solved this kind of problem?&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (graphictype == "point" &amp;amp;&amp;amp; map.graphics.graphics.length == 1) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; map.centerAndZoom(map.graphics.graphics[0].geometry,20);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;else {&lt;/P&gt;&lt;P&gt;&amp;nbsp; var extent = esri.graphicsExtent(map.graphics.graphics);&lt;/P&gt;&lt;P&gt;&amp;nbsp; map.setExtent(extent.expand(2), true);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Mar 2015 14:15:54 GMT</pubDate>
    <dc:creator>PeggyCorey</dc:creator>
    <dc:date>2015-03-10T14:15:54Z</dc:date>
    <item>
      <title>coincident points - extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/coincident-points-extent/m-p/615935#M57557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to check for coincident points being returned from a FindTask, in order to zoom to the proper extent.&amp;nbsp; I am currently zooming using a centerAndZoom for single points, and using a setExtent for lines, polygons and multiple points.&amp;nbsp; But this will not work properly if the results set is a pair of coincident points, for example.&amp;nbsp; Below is a sample of my current zoom code, but I need a solution for this coincident point scenario.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone solved this kind of problem?&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (graphictype == "point" &amp;amp;&amp;amp; map.graphics.graphics.length == 1) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; map.centerAndZoom(map.graphics.graphics[0].geometry,20);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;else {&lt;/P&gt;&lt;P&gt;&amp;nbsp; var extent = esri.graphicsExtent(map.graphics.graphics);&lt;/P&gt;&lt;P&gt;&amp;nbsp; map.setExtent(extent.expand(2), true);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2015 14:15:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/coincident-points-extent/m-p/615935#M57557</guid>
      <dc:creator>PeggyCorey</dc:creator>
      <dc:date>2015-03-10T14:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: coincident points - extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/coincident-points-extent/m-p/615936#M57558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Peggy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; So does the coincident points produce an extent using graphicsExtent? if they do then you can check the width of the extent and if it does not return a predetermined size then fallback to using centerAndZoom. If the coincident points&amp;nbsp; do not produce an extent using graphicsExtent then same thing fallback to centerAndZoom.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2015 14:41:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/coincident-points-extent/m-p/615936#M57558</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2015-03-10T14:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: coincident points - extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/coincident-points-extent/m-p/615937#M57559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the suggestions Robert.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No, the coincident points do not produce and extent using graphicsExtent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know how to use centerAndZoom to zoom to 1 graphic.&amp;nbsp; But how do I use it to zoom to multiples?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I check for coincidence?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2015 15:02:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/coincident-points-extent/m-p/615937#M57559</guid>
      <dc:creator>PeggyCorey</dc:creator>
      <dc:date>2015-03-10T15:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: coincident points - extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/coincident-points-extent/m-p/615938#M57560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Peggy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Try something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;if (graphictype == "point" &amp;amp;&amp;amp; map.graphics.graphics.length == 1) {
&amp;nbsp; map.centerAndZoom(map.graphics.graphics[0].geometry,20);
} else if (graphictype == "point" &amp;amp;&amp;amp; map.graphics.graphics.length &amp;gt; 1 &amp;amp;&amp;amp; !esri.graphicsExtent(map.graphics.graphics)){
&amp;nbsp; map.centerAndZoom(map.graphics.graphics[0].geometry,20);
} else {
&amp;nbsp; var extent = esri.graphicsExtent(map.graphics.graphics);
&amp;nbsp; map.setExtent(extent.expand(2), true);
}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:19:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/coincident-points-extent/m-p/615938#M57560</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-12T02:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: coincident points - extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/coincident-points-extent/m-p/615939#M57561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks... that worked perfectly!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2015 17:10:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/coincident-points-extent/m-p/615939#M57561</guid>
      <dc:creator>PeggyCorey</dc:creator>
      <dc:date>2015-03-10T17:10:08Z</dc:date>
    </item>
  </channel>
</rss>

