<?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: On a group layer in the sdk if visibilityMode is set to independent why does it not respect this in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/on-a-group-layer-in-the-sdk-if-visibilitymode-is/m-p/1508937#M85099</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/669035"&gt;@MikeBehan&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I'm sorry to hear that your users are finding it confusing.&amp;nbsp; I could be misunderstanding the question, but the `independent` visibility mode is designed to work in the way described.&amp;nbsp; The parent group layer and it's children's visibility are independent from each other.&amp;nbsp; Perhaps `inherited` would be a better choice for your use case.&amp;nbsp; This would match the visibility of the child layers to that of it's parent group layer, but with the disadvantage of not being able to control the individual child layer's visibility outside of that of the group layer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sage_Wall_0-1721774114628.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/110429iF99F7F8CAC1556D1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sage_Wall_0-1721774114628.png" alt="Sage_Wall_0-1721774114628.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html#visibilityMode" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html#visibilityMode&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 23 Jul 2024 22:43:08 GMT</pubDate>
    <dc:creator>Sage_Wall</dc:creator>
    <dc:date>2024-07-23T22:43:08Z</dc:date>
    <item>
      <title>On a group layer in the sdk if visibilityMode is set to independent why does it not respect this</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/on-a-group-layer-in-the-sdk-if-visibilitymode-is/m-p/1508712#M85091</link>
      <description>&lt;P&gt;On a group layer like below&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;            new GroupLayer({
              title: 'Example',
              visibilityMode: "independent",
              layers: featureLayers
            }&lt;/LI-CODE&gt;&lt;P&gt;In the follow screen shot if a user checks the eye of the whole group layer&amp;nbsp; to hide then go to a sublayer and check that to show nothing happens our users are find this confusing&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-07-23 at 5.43.22 PM.png" style="width: 335px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/110391i4B4F194C9DFE58E2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-07-23 at 5.43.22 PM.png" alt="Screenshot 2024-07-23 at 5.43.22 PM.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;version is 4.29 of the SDK&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 16:49:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/on-a-group-layer-in-the-sdk-if-visibilitymode-is/m-p/1508712#M85091</guid>
      <dc:creator>MikeBehan</dc:creator>
      <dc:date>2024-07-23T16:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: On a group layer in the sdk if visibilityMode is set to independent why does it not respect this</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/on-a-group-layer-in-the-sdk-if-visibilitymode-is/m-p/1508937#M85099</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/669035"&gt;@MikeBehan&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I'm sorry to hear that your users are finding it confusing.&amp;nbsp; I could be misunderstanding the question, but the `independent` visibility mode is designed to work in the way described.&amp;nbsp; The parent group layer and it's children's visibility are independent from each other.&amp;nbsp; Perhaps `inherited` would be a better choice for your use case.&amp;nbsp; This would match the visibility of the child layers to that of it's parent group layer, but with the disadvantage of not being able to control the individual child layer's visibility outside of that of the group layer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sage_Wall_0-1721774114628.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/110429iF99F7F8CAC1556D1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sage_Wall_0-1721774114628.png" alt="Sage_Wall_0-1721774114628.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html#visibilityMode" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html#visibilityMode&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 22:43:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/on-a-group-layer-in-the-sdk-if-visibilitymode-is/m-p/1508937#M85099</guid>
      <dc:creator>Sage_Wall</dc:creator>
      <dc:date>2024-07-23T22:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: On a group layer in the sdk if visibilityMode is set to independent why does it not respect this</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/on-a-group-layer-in-the-sdk-if-visibilitymode-is/m-p/1508955#M85100</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/669035"&gt;@MikeBehan&lt;/a&gt;&amp;nbsp;, If you do want to enable this kind of behavior where the child layer set's the parent to visible when it is visible you could likely add something like this in the &lt;A title="listItemCreatedFunction" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#listItemCreatedFunction" target="_blank" rel="noopener"&gt;listItemCreatedFunction&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/sagewall/pen/rNELgJa" target="_blank"&gt;https://codepen.io/sagewall/pen/rNELgJa&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;      listItemCreatedFunction: (event) =&amp;gt; {
        const { layer } = event.item;
        if (layer.type === "group") {
          layer.layers.forEach((layer) =&amp;gt; {
            reactiveUtils.watch(
              () =&amp;gt; layer.visible,
              (visible) =&amp;gt; {
                if (visible &amp;amp;&amp;amp; !layer.parent.visible) {
                  layer.parent.visible = true;
                }
              }
            );
          });
        }
      },&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 23:49:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/on-a-group-layer-in-the-sdk-if-visibilitymode-is/m-p/1508955#M85100</guid>
      <dc:creator>Sage_Wall</dc:creator>
      <dc:date>2024-07-23T23:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: On a group layer in the sdk if visibilityMode is set to independent why does it not respect this</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/on-a-group-layer-in-the-sdk-if-visibilitymode-is/m-p/1510928#M85125</link>
      <description>&lt;P&gt;Another option I've done previously, and if you're controlling the entire UX, is to disable the ability of the child layers to change their own visibility if the parent layer is not visible.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 23:34:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/on-a-group-layer-in-the-sdk-if-visibilitymode-is/m-p/1510928#M85125</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2024-07-26T23:34:16Z</dc:date>
    </item>
  </channel>
</rss>

