<?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 Set visibility of geometry/feature from specific layer for JavaScript in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/set-visibility-of-geometry-feature-from-specific/m-p/1091761#M74392</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a set layers loaded in the scene and it depends of the selected layer, I would like to be able to set the visible&amp;nbsp;property to false or true of each geometry/feature, is it possible?&lt;/P&gt;&lt;P&gt;All information that I found is related to the layer, but at this point the layer contains geometries/features and my goal is to interact with these and leave the layer at the top of visibility to true.&lt;/P&gt;&lt;P&gt;I used the following lines&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;function setGeometriesVisibility(layer, ids) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;//ids =&amp;gt; contains an array of keys id&lt;BR /&gt;&amp;nbsp; &amp;nbsp;let query = layer.createQuery();&lt;BR /&gt;&amp;nbsp; &amp;nbsp;layer.queryFeatures(query).then(function (response) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;response.features.forEach((f) =&amp;gt; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;//GisId =&amp;gt; a custom property that defines an id&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;f.visible = ids.indexOf(f.attributes.GisId) &amp;gt; -1 ? true : false;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;layer.applyEdits({ updateFeatures: [f] }).then(function (results) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//Do nothing&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}).catch(error =&amp;gt; console.log(error));&lt;BR /&gt;&amp;nbsp; });&lt;BR /&gt;});&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I had an error that describes "&lt;SPAN&gt;Layer does not support updating features."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;is there any functionality that allows to set the visibility of the geometry/feature?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance for any kind of help&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Aug 2021 15:44:27 GMT</pubDate>
    <dc:creator>IDPDeveloper</dc:creator>
    <dc:date>2021-08-24T15:44:27Z</dc:date>
    <item>
      <title>Set visibility of geometry/feature from specific layer for JavaScript</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/set-visibility-of-geometry-feature-from-specific/m-p/1091761#M74392</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a set layers loaded in the scene and it depends of the selected layer, I would like to be able to set the visible&amp;nbsp;property to false or true of each geometry/feature, is it possible?&lt;/P&gt;&lt;P&gt;All information that I found is related to the layer, but at this point the layer contains geometries/features and my goal is to interact with these and leave the layer at the top of visibility to true.&lt;/P&gt;&lt;P&gt;I used the following lines&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;function setGeometriesVisibility(layer, ids) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;//ids =&amp;gt; contains an array of keys id&lt;BR /&gt;&amp;nbsp; &amp;nbsp;let query = layer.createQuery();&lt;BR /&gt;&amp;nbsp; &amp;nbsp;layer.queryFeatures(query).then(function (response) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;response.features.forEach((f) =&amp;gt; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;//GisId =&amp;gt; a custom property that defines an id&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;f.visible = ids.indexOf(f.attributes.GisId) &amp;gt; -1 ? true : false;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;layer.applyEdits({ updateFeatures: [f] }).then(function (results) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//Do nothing&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}).catch(error =&amp;gt; console.log(error));&lt;BR /&gt;&amp;nbsp; });&lt;BR /&gt;});&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I had an error that describes "&lt;SPAN&gt;Layer does not support updating features."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;is there any functionality that allows to set the visibility of the geometry/feature?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance for any kind of help&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 15:44:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/set-visibility-of-geometry-feature-from-specific/m-p/1091761#M74392</guid>
      <dc:creator>IDPDeveloper</dc:creator>
      <dc:date>2021-08-24T15:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Set visibility of geometry/feature from specific layer for JavaScript</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/set-visibility-of-geometry-feature-from-specific/m-p/1091780#M74393</link>
      <description>&lt;P&gt;You don't set the visibility of individual features in a layer. You can set a &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#definitionExpression" target="_self"&gt;definitionExpression&lt;/A&gt; to filter our features. This will limit what data is downloaded from the service. You can also apply &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/featurefilter-attributes/" target="_self"&gt;filters on the LayerView&lt;/A&gt; if you still want the features downloaded for other purposes, but just don't want them to display.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 16:20:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/set-visibility-of-geometry-feature-from-specific/m-p/1091780#M74393</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-08-24T16:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Set visibility of geometry/feature from specific layer for JavaScript</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/set-visibility-of-geometry-feature-from-specific/m-p/1092124#M74405</link>
      <description>&lt;P&gt;Thanks!&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the filter to approach my goal&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 08:42:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/set-visibility-of-geometry-feature-from-specific/m-p/1092124#M74405</guid>
      <dc:creator>IDPDeveloper</dc:creator>
      <dc:date>2021-08-25T08:42:27Z</dc:date>
    </item>
  </channel>
</rss>

