<?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 Using queryTask and zooming into a geometry in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-querytask-and-zooming-into-a-geometry/m-p/695785#M64748</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to get the geometry of the polygon using UNIQPOLYID. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;UNIQPOLYID is the display field.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;function searchGeometry(polyId){ &amp;nbsp;&amp;nbsp; queryTask = new esri.tasks.QueryTask(URLGoesHere); &amp;nbsp;&amp;nbsp; query = new esri.tasks.Query(); &amp;nbsp;&amp;nbsp; query.returnGeometry = true; &amp;nbsp;&amp;nbsp; query.text = polyId; &amp;nbsp;&amp;nbsp; queryTask.execute(query, queryResults); }&amp;nbsp; function queryResults(featureSet){ &amp;nbsp;&amp;nbsp; alert(featureSet.features); //undefined &amp;nbsp;&amp;nbsp; //Should get the geometry of the feature and zoom into it. }&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"featureSet.features" is undefined in my queryResults(featureSet). How should I get the the feature with the provided polyId so that I can zoom in to the geometry.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 May 2013 05:25:24 GMT</pubDate>
    <dc:creator>PrasannaRaghavendar</dc:creator>
    <dc:date>2013-05-28T05:25:24Z</dc:date>
    <item>
      <title>Using queryTask and zooming into a geometry</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-querytask-and-zooming-into-a-geometry/m-p/695785#M64748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to get the geometry of the polygon using UNIQPOLYID. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;UNIQPOLYID is the display field.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;function searchGeometry(polyId){ &amp;nbsp;&amp;nbsp; queryTask = new esri.tasks.QueryTask(URLGoesHere); &amp;nbsp;&amp;nbsp; query = new esri.tasks.Query(); &amp;nbsp;&amp;nbsp; query.returnGeometry = true; &amp;nbsp;&amp;nbsp; query.text = polyId; &amp;nbsp;&amp;nbsp; queryTask.execute(query, queryResults); }&amp;nbsp; function queryResults(featureSet){ &amp;nbsp;&amp;nbsp; alert(featureSet.features); //undefined &amp;nbsp;&amp;nbsp; //Should get the geometry of the feature and zoom into it. }&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"featureSet.features" is undefined in my queryResults(featureSet). How should I get the the feature with the provided polyId so that I can zoom in to the geometry.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 05:25:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-querytask-and-zooming-into-a-geometry/m-p/695785#M64748</guid>
      <dc:creator>PrasannaRaghavendar</dc:creator>
      <dc:date>2013-05-28T05:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: Using queryTask and zooming into a geometry</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-querytask-and-zooming-into-a-geometry/m-p/695786#M64749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Check with rest url , if you are getting results.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A class="jive-link-external-small" href="http://" rel="nofollow" target="_blank"&gt;http://&lt;/A&gt;&lt;SPAN&gt;&amp;lt;yourserver&amp;gt;/arcgis/rest/services/&amp;lt;Map_Service&amp;gt;/Mapserver/layerid&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 08:46:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-querytask-and-zooming-into-a-geometry/m-p/695786#M64749</guid>
      <dc:creator>VinayBansal</dc:creator>
      <dc:date>2013-05-28T08:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using queryTask and zooming into a geometry</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-querytask-and-zooming-into-a-geometry/m-p/695787#M64750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I got the geometry when I included layerId. &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function queryResults(featureSet){ 
 var resultSet = featureSet.features;
 var shape = resultSet[0].geometry;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(shape.type==='polygon'){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var featureExtent=shape.getExtent();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.setExtent(featureExtent);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }else{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert("Shape is not a polygon");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Though I set feature Extent to map extent. The slider zooms to the fullest and I get to see only "Map Data Not Available". Why is that? I want the slider to just zoom on the polygon.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:17:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-querytask-and-zooming-into-a-geometry/m-p/695787#M64750</guid>
      <dc:creator>PrasannaRaghavendar</dc:creator>
      <dc:date>2021-12-12T05:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using queryTask and zooming into a geometry</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-querytask-and-zooming-into-a-geometry/m-p/695788#M64751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you got your answer, then do mark the post as answered.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And regarding your second query, this may happen in many scenarios....&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;like projection of geometry is different than that of map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Map is zooming to location where base map is not available.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 10:31:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-querytask-and-zooming-into-a-geometry/m-p/695788#M64751</guid>
      <dc:creator>VinayBansal</dc:creator>
      <dc:date>2013-05-28T10:31:42Z</dc:date>
    </item>
  </channel>
</rss>

