<?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 GoTo some extent when featureset is empty in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/goto-some-extent-when-featureset-is-empty/m-p/493593#M45848</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How do I get a default or initial extent from my ArcGIS without hard-coding it?&amp;nbsp;For example, whenever a FeatureSet is not populated after executing a QueryTask, the mapview goes to the middle of the ocean instead of somewhere in my map area. If I can get the&amp;nbsp;extent then I could zoom to it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (featureSet.features &amp;amp;&amp;amp; !featureSet.features.length &amp;gt; 0) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;view.goTo({&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; target: view.extent&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }, ZoomOptions);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The returned extent from the zero results query doesn't have a valid extent, obviously.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;type:"extent"&lt;BR /&gt;width:0&lt;BR /&gt;xmax:0&lt;BR /&gt;xmin:0&lt;BR /&gt;ymax:9688.393335133032&lt;BR /&gt;ymin:-9688.393335133032&lt;BR /&gt;zmax:undefined&lt;BR /&gt;zmin:undefined&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want the exent from here&lt;/P&gt;&lt;P&gt;&lt;A href="https://gis.manateepao.com/arcgis/rest/services/Website/WebLayers/MapServer/256"&gt;https://gis.manateepao.com/arcgis/rest/services/Website/WebLayers/MapServer/256&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Dec 2019 17:41:35 GMT</pubDate>
    <dc:creator>GregoryBologna</dc:creator>
    <dc:date>2019-12-06T17:41:35Z</dc:date>
    <item>
      <title>GoTo some extent when featureset is empty</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/goto-some-extent-when-featureset-is-empty/m-p/493593#M45848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How do I get a default or initial extent from my ArcGIS without hard-coding it?&amp;nbsp;For example, whenever a FeatureSet is not populated after executing a QueryTask, the mapview goes to the middle of the ocean instead of somewhere in my map area. If I can get the&amp;nbsp;extent then I could zoom to it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (featureSet.features &amp;amp;&amp;amp; !featureSet.features.length &amp;gt; 0) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;view.goTo({&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; target: view.extent&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }, ZoomOptions);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The returned extent from the zero results query doesn't have a valid extent, obviously.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;type:"extent"&lt;BR /&gt;width:0&lt;BR /&gt;xmax:0&lt;BR /&gt;xmin:0&lt;BR /&gt;ymax:9688.393335133032&lt;BR /&gt;ymin:-9688.393335133032&lt;BR /&gt;zmax:undefined&lt;BR /&gt;zmin:undefined&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want the exent from here&lt;/P&gt;&lt;P&gt;&lt;A href="https://gis.manateepao.com/arcgis/rest/services/Website/WebLayers/MapServer/256"&gt;https://gis.manateepao.com/arcgis/rest/services/Website/WebLayers/MapServer/256&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Dec 2019 17:41:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/goto-some-extent-when-featureset-is-empty/m-p/493593#M45848</guid>
      <dc:creator>GregoryBologna</dc:creator>
      <dc:date>2019-12-06T17:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: GoTo some extent when featureset is empty</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/goto-some-extent-when-featureset-is-empty/m-p/493594#M45849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gregory,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;The extent used in the goTo method has to have the same spatial reference as the map view does. So you would need to re-project that extent info before you use it in the goTo method.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Dec 2019 18:34:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/goto-some-extent-when-featureset-is-empty/m-p/493594#M45849</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2019-12-06T18:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: GoTo some extent when featureset is empty</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/goto-some-extent-when-featureset-is-empty/m-p/493595#M45850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. Setting the initial long\lat to specific location when a featureset is not found is working out for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var view = new MapView({&lt;BR /&gt; map: map,&lt;BR /&gt;center: [-82.414233, 27.491344]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Dec 2019 18:42:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/goto-some-extent-when-featureset-is-empty/m-p/493595#M45850</guid>
      <dc:creator>GregoryBologna</dc:creator>
      <dc:date>2019-12-06T18:42:11Z</dc:date>
    </item>
  </channel>
</rss>

