<?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: Remove layer definitions expression after searchWidget.on(&amp;quot;select-result&amp;quot;) - API 4.7 in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/remove-layer-definitions-expression-after/m-p/514607#M48016</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mathew,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;You would have to loop through the&amp;nbsp;layerViews collection and get the layer property from the LayerView and set the&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;definitionExpression&lt;SPAN&gt;&amp;nbsp; to an empty string.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Jun 2018 19:07:10 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2018-06-05T19:07:10Z</dc:date>
    <item>
      <title>Remove layer definitions expression after searchWidget.on("select-result") - API 4.7</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/remove-layer-definitions-expression-after/m-p/514606#M48015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using API 4.7&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When my web map is loaded, I'm handling the loading of the feature layers and filtering the graphics displayed with the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;webMapView.on("layerview-create", function(event) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (layerTitle === "Toxic Release")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;layer.definitionExpression = "State_code = '" + state + "'";&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else if (layerTitle === "Region 3 Boundary") {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;layer.definitionExpression = "STUSPS = '" + state + "'";&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;layer.definitionExpression = "STATE = '" + state + "'";&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return function queryLayerData() {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var layerQuery = layer.createQuery();&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return layer.queryFeatures(layerQuery).then(function (response) {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;layerGeometries = response.features.map(function (feature) {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return feature.geometry;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;});&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return layerGeometries;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;});&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When an item is searched using the Search Widget, I want the feature layer to show the&amp;nbsp;feature but there are cases when the&amp;nbsp;feature is not show because of the filtering above.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How would I remove the filtering that takes place during the layerview-create process?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jun 2018 16:09:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/remove-layer-definitions-expression-after/m-p/514606#M48015</guid>
      <dc:creator>MathewMullan1</dc:creator>
      <dc:date>2018-06-05T16:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: Remove layer definitions expression after searchWidget.on("select-result") - API 4.7</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/remove-layer-definitions-expression-after/m-p/514607#M48016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mathew,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;You would have to loop through the&amp;nbsp;layerViews collection and get the layer property from the LayerView and set the&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;definitionExpression&lt;SPAN&gt;&amp;nbsp; to an empty string.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jun 2018 19:07:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/remove-layer-definitions-expression-after/m-p/514607#M48016</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-06-05T19:07:10Z</dc:date>
    </item>
  </channel>
</rss>

