<?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: How to set extent of the map as per feature definition in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-set-extent-of-the-map-as-per-feature/m-p/283232#M26153</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But this approach requires the featureLayer graphics to be visible in the current map extent.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 May 2016 12:11:20 GMT</pubDate>
    <dc:creator>FC_Basson</dc:creator>
    <dc:date>2016-05-19T12:11:20Z</dc:date>
    <item>
      <title>How to set extent of the map as per feature definition</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-set-extent-of-the-map-as-per-feature/m-p/283229#M26150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a state layer in which counties exists. i have definied the layer by which the layer only showing the counties existing in a particular state as below. but how can make this defined state to be as a map extent. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var featureLayer1 = new FeatureLayer("XYZ",{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mode: FeatureLayer.MODE_ONDEMAND,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outFields: ["*"],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //minScale : 800000,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //maxScale : 0,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infoTemplate: template&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureLayer1.setDefinitionExpression("sde.sde.TS_Const.dname = '" + distname + "'");&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2016 11:10:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-set-extent-of-the-map-as-per-feature/m-p/283229#M26150</guid>
      <dc:creator>SatyanarayanaNarmala</dc:creator>
      <dc:date>2016-05-19T11:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to set extent of the map as per feature definition</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-set-extent-of-the-map-as-per-feature/m-p/283230#M26151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Once the featureLayer is loaded and the definition expression is defined, you can zoom to the graphics with:&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_1463658728654831 jive_text_macro" data-renderedposition="34_8_1315_16" jivemacro_uid="_1463658728654831"&gt;&lt;P&gt;map.setExtent(esri.graphicsExtent(featureLayer.graphics));&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2016 11:52:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-set-extent-of-the-map-as-per-feature/m-p/283230#M26151</guid>
      <dc:creator>FC_Basson</dc:creator>
      <dc:date>2016-05-19T11:52:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to set extent of the map as per feature definition</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-set-extent-of-the-map-as-per-feature/m-p/283231#M26152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The best option would be to get the extent of the definition expression features with the featureLayer queryExtent function after load:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;featureLayer.on('load', function(){&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; var query = new esri.tasks.Query();
&amp;nbsp;&amp;nbsp; query.where = "sde.sde.TS_Const.dname = '" + distname + "'";
&amp;nbsp;&amp;nbsp; featureLayer.queryExtent(query,function(result){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.setExtent(result.extent);
&amp;nbsp;&amp;nbsp; })
})&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:42:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-set-extent-of-the-map-as-per-feature/m-p/283231#M26152</guid>
      <dc:creator>FC_Basson</dc:creator>
      <dc:date>2021-12-11T13:42:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to set extent of the map as per feature definition</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-set-extent-of-the-map-as-per-feature/m-p/283232#M26153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But this approach requires the featureLayer graphics to be visible in the current map extent.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2016 12:11:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-set-extent-of-the-map-as-per-feature/m-p/283232#M26153</guid>
      <dc:creator>FC_Basson</dc:creator>
      <dc:date>2016-05-19T12:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to set extent of the map as per feature definition</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-set-extent-of-the-map-as-per-feature/m-p/283233#M26154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please note, this does not work if your feature layer is hosted in ArcGIS Server, unless it is v10.3.1+:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; background-color: #ffffff;"&gt;Get the extent of features that satisfy the input query. The count of features that satisfy the input query is returned as well. This is valid only for hosted feature services on arcgis.com and for ArcGIS Server 10.3.1 and later.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM style="color: #4d4d4d;"&gt;(Added at v3.9)&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Feb 2018 22:06:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-set-extent-of-the-map-as-per-feature/m-p/283233#M26154</guid>
      <dc:creator>ChrisSmith7</dc:creator>
      <dc:date>2018-02-16T22:06:34Z</dc:date>
    </item>
  </channel>
</rss>

