<?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: handle/listen Layer visibility events in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/handle-listen-layer-visibility-events/m-p/1275846#M80767</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/672415"&gt;@davizuco666&lt;/a&gt;&amp;nbsp;there is also a sample that shows how to take advantage of reactiveUtils and watch for when the map's layer visibility changes:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/watch-for-changes-reactiveutils/" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/sample-code/watch-for-changes-reactiveutils/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is recommended to use reactiveUtils - here's a blog that discusses the topic more:&amp;nbsp;&lt;A href="https://www.esri.com/arcgis-blog/products/js-api-arcgis/developers/reactiveutils-and-why-you-should-be-using-them-instead-of-watchutils-with-the-arcgis-maps-sdk-for-javascript/" target="_blank"&gt;https://www.esri.com/arcgis-blog/products/js-api-arcgis/developers/reactiveutils-and-why-you-should-be-using-them-instead-of-watchutils-with-the-arcgis-maps-sdk-for-javascript/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 05 Apr 2023 15:52:37 GMT</pubDate>
    <dc:creator>LaurenBoyd</dc:creator>
    <dc:date>2023-04-05T15:52:37Z</dc:date>
    <item>
      <title>handle/listen Layer visibility events</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/handle-listen-layer-visibility-events/m-p/1275671#M80759</link>
      <description>&lt;P&gt;I need to listen to layer visibility changes, but can´t figure out how to do it with Javascript 4.x SDK.&lt;/P&gt;&lt;P&gt;LayerList "trigger-action" never triggers on layer visibility changes.&lt;/P&gt;&lt;P&gt;I Tryed like:&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LayerList.on" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/67302i1CDF9A399C6394C9/image-size/large?v=v2&amp;amp;px=999" role="button" title="imagen.png" alt="LayerList.on" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;LayerList.on&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But just working on "load" event..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also triyed to see all events to find the right one, with no success.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="imagen.png" style="width: 721px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/67303i06276CF175D6796D/image-size/large?v=v2&amp;amp;px=999" role="button" title="imagen.png" alt="imagen.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2023 09:40:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/handle-listen-layer-visibility-events/m-p/1275671#M80759</guid>
      <dc:creator>davizuco666</dc:creator>
      <dc:date>2023-04-05T09:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: handle/listen Layer visibility events</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/handle-listen-layer-visibility-events/m-p/1275690#M80761</link>
      <description>&lt;P&gt;Auto awnser:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;layer.watch('visible', (visibility, a, eventName,layer) =&amp;gt; {
                console.log("visible: ", visibility);
                console.log(layer, eventName, a);
            });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't understand why there is no mention of this in the documentation, watch is not even in the list of methods.&lt;/P&gt;&lt;P&gt;You just have to guess...&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2023 10:34:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/handle-listen-layer-visibility-events/m-p/1275690#M80761</guid>
      <dc:creator>davizuco666</dc:creator>
      <dc:date>2023-04-05T10:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: handle/listen Layer visibility events</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/handle-listen-layer-visibility-events/m-p/1275743#M80764</link>
      <description>&lt;P&gt;Have you seen this &lt;A href="https://developers.arcgis.com/javascript/latest/programming-patterns/#watching-for-property-changes" target="_self"&gt;section&lt;/A&gt; in the Programming patterns page that discusses watching for property changes?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2023 13:38:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/handle-listen-layer-visibility-events/m-p/1275743#M80764</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2023-04-05T13:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: handle/listen Layer visibility events</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/handle-listen-layer-visibility-events/m-p/1275835#M80766</link>
      <description>&lt;P&gt;No I didn´t &lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;, it was quite hidden. &lt;span class="lia-unicode-emoji" title=":thinking_face:"&gt;🤔&lt;/span&gt;&amp;nbsp; Thank you for the link! &lt;span class="lia-unicode-emoji" title=":winking_face_with_tongue:"&gt;😜&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2023 15:27:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/handle-listen-layer-visibility-events/m-p/1275835#M80766</guid>
      <dc:creator>davizuco666</dc:creator>
      <dc:date>2023-04-05T15:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: handle/listen Layer visibility events</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/handle-listen-layer-visibility-events/m-p/1275846#M80767</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/672415"&gt;@davizuco666&lt;/a&gt;&amp;nbsp;there is also a sample that shows how to take advantage of reactiveUtils and watch for when the map's layer visibility changes:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/watch-for-changes-reactiveutils/" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/sample-code/watch-for-changes-reactiveutils/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is recommended to use reactiveUtils - here's a blog that discusses the topic more:&amp;nbsp;&lt;A href="https://www.esri.com/arcgis-blog/products/js-api-arcgis/developers/reactiveutils-and-why-you-should-be-using-them-instead-of-watchutils-with-the-arcgis-maps-sdk-for-javascript/" target="_blank"&gt;https://www.esri.com/arcgis-blog/products/js-api-arcgis/developers/reactiveutils-and-why-you-should-be-using-them-instead-of-watchutils-with-the-arcgis-maps-sdk-for-javascript/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2023 15:52:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/handle-listen-layer-visibility-events/m-p/1275846#M80767</guid>
      <dc:creator>LaurenBoyd</dc:creator>
      <dc:date>2023-04-05T15:52:37Z</dc:date>
    </item>
  </channel>
</rss>

