<?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 Query a feature layer that is not shown until query is executed in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-a-feature-layer-that-is-not-shown-until/m-p/705303#M65639</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to query a feature layer that is not shown on the map until the query is actually executed.&amp;nbsp; I have a button that I am using to set off the query when it is clicked.&amp;nbsp; Here is the code that I am trying to use:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
on(dom.byId("mapshow"), "click", selectHistorical);
function selectHistorical(){
 var queryTask = new QueryTask(window.historicalUrl);
 var query = new Query();
 query.returnGeometry=true;
 query.outFields=window.historicalOutFields;
 query.text = dom.byId("mydropdown").value;
 query.outSpatialReference = {"wkid":2236};
 dojo.connect(queryTask, "onComplete", function(featureSet){
&amp;nbsp; map.graphics.clear();
&amp;nbsp; dojo.forEach(featureSet.features, function(feature){
&amp;nbsp;&amp;nbsp; var graphic = feature;
&amp;nbsp;&amp;nbsp; map.graphics.add(graphic);
&amp;nbsp; });
 });
 queryTask.execute(query);
}
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Am I missing something?&amp;nbsp; Is there a better way to go about doing this?&amp;nbsp; Any help is greatly appreciated, thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Michelle&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Feb 2014 19:57:04 GMT</pubDate>
    <dc:creator>MichelleRogers1</dc:creator>
    <dc:date>2014-02-28T19:57:04Z</dc:date>
    <item>
      <title>Query a feature layer that is not shown until query is executed</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-a-feature-layer-that-is-not-shown-until/m-p/705303#M65639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to query a feature layer that is not shown on the map until the query is actually executed.&amp;nbsp; I have a button that I am using to set off the query when it is clicked.&amp;nbsp; Here is the code that I am trying to use:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
on(dom.byId("mapshow"), "click", selectHistorical);
function selectHistorical(){
 var queryTask = new QueryTask(window.historicalUrl);
 var query = new Query();
 query.returnGeometry=true;
 query.outFields=window.historicalOutFields;
 query.text = dom.byId("mydropdown").value;
 query.outSpatialReference = {"wkid":2236};
 dojo.connect(queryTask, "onComplete", function(featureSet){
&amp;nbsp; map.graphics.clear();
&amp;nbsp; dojo.forEach(featureSet.features, function(feature){
&amp;nbsp;&amp;nbsp; var graphic = feature;
&amp;nbsp;&amp;nbsp; map.graphics.add(graphic);
&amp;nbsp; });
 });
 queryTask.execute(query);
}
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Am I missing something?&amp;nbsp; Is there a better way to go about doing this?&amp;nbsp; Any help is greatly appreciated, thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Michelle&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Feb 2014 19:57:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-a-feature-layer-that-is-not-shown-until/m-p/705303#M65639</guid>
      <dc:creator>MichelleRogers1</dc:creator>
      <dc:date>2014-02-28T19:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: Query a feature layer that is not shown until query is executed</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-a-feature-layer-that-is-not-shown-until/m-p/705304#M65640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Would a FeatureLayer in MODE_ONDEMAND or MODE_SELECTION meet your needs using the &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/jsapi/featurelayer-amd.html#selectfeatures"&gt;selectFeatures&lt;/A&gt;&lt;SPAN&gt; method?&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/javascript/jssamples/fl_selectfeatures.html"&gt;https://developers.arcgis.com/javascript/jssamples/fl_selectfeatures.html&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Mar 2014 16:12:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-a-feature-layer-that-is-not-shown-until/m-p/705304#M65640</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2014-03-01T16:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: Query a feature layer that is not shown until query is executed</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-a-feature-layer-that-is-not-shown-until/m-p/705305#M65641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Would a FeatureLayer in MODE_ONDEMAND or MODE_SELECTION meet your needs using the &lt;A href="https://developers.arcgis.com/javascript/jsapi/featurelayer-amd.html#selectfeatures"&gt;selectFeatures&lt;/A&gt; method?&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/javascript/jssamples/fl_selectfeatures.html"&gt;https://developers.arcgis.com/javascript/jssamples/fl_selectfeatures.html&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The feature layer is already included in the webpage in on demand mode.&amp;nbsp; What I am trying to do is query the layer so that the only items that show up from that layer are the items from a specific unit id.&amp;nbsp; I am posting a photo of the viewer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]31895[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The dropdown menu in the right panel has the unit id's for all police vehicles.&amp;nbsp; What I want is for the historical data (in the historical feature layer) to be shown for whatever specific unit id is selected when I click on the show on map button.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am fairly new to coding with esri, so any help is appreciated.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Mar 2014 11:34:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-a-feature-layer-that-is-not-shown-until/m-p/705305#M65641</guid>
      <dc:creator>MichelleRogers1</dc:creator>
      <dc:date>2014-03-03T11:34:14Z</dc:date>
    </item>
  </channel>
</rss>

