<?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 Change the attribute visible of layer when click on checkbok? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-the-attribute-visible-of-layer-when-click/m-p/319430#M29434</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i have this code to detect change on my checkbox.&lt;/P&gt;&lt;P&gt;if is true turn on layer if is not true turn off layer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in my map service the layer have id 14&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$(document).ready(function() {&lt;/P&gt;&lt;P&gt;$('#checkboxOrtofoto10m').change(function() {&lt;BR /&gt; if(this.checked) {&lt;BR /&gt; Layers.findSublayerById(14).labelsVisible = true;&lt;BR /&gt; }&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in console mark this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-emoji image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/462269_error.JPG" /&gt;&lt;/P&gt;&lt;PRE class="" data-placeholder="Traducción" dir="ltr" style="color: #222222; background-color: #f8f9fa; border: none; font-size: 28px; margin: -2px 0px; padding: 2px 0.14em 2px 0px;"&gt;&lt;SPAN lang="en"&gt;any suggestions?&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Oct 2019 19:04:43 GMT</pubDate>
    <dc:creator>UlisesTabares</dc:creator>
    <dc:date>2019-10-18T19:04:43Z</dc:date>
    <item>
      <title>Change the attribute visible of layer when click on checkbok?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-the-attribute-visible-of-layer-when-click/m-p/319430#M29434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i have this code to detect change on my checkbox.&lt;/P&gt;&lt;P&gt;if is true turn on layer if is not true turn off layer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in my map service the layer have id 14&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$(document).ready(function() {&lt;/P&gt;&lt;P&gt;$('#checkboxOrtofoto10m').change(function() {&lt;BR /&gt; if(this.checked) {&lt;BR /&gt; Layers.findSublayerById(14).labelsVisible = true;&lt;BR /&gt; }&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in console mark this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-emoji image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/462269_error.JPG" /&gt;&lt;/P&gt;&lt;PRE class="" data-placeholder="Traducción" dir="ltr" style="color: #222222; background-color: #f8f9fa; border: none; font-size: 28px; margin: -2px 0px; padding: 2px 0.14em 2px 0px;"&gt;&lt;SPAN lang="en"&gt;any suggestions?&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2019 19:04:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-the-attribute-visible-of-layer-when-click/m-p/319430#M29434</guid>
      <dc:creator>UlisesTabares</dc:creator>
      <dc:date>2019-10-18T19:04:43Z</dc:date>
    </item>
    <item>
      <title>Re: Change the attribute visible of layer when click on checkbok?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-the-attribute-visible-of-layer-when-click/m-p/319431#M29435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a sample that toggles sublayer visibility:&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/latest/sample-code/layers-mapimagelayer-sublayers/index.html" title="https://developers.arcgis.com/javascript/latest/sample-code/layers-mapimagelayer-sublayers/index.html"&gt;MapImageLayer - Toggle sublayer visibility | ArcGIS API for JavaScript 4.13&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2019 19:44:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-the-attribute-visible-of-layer-when-click/m-p/319431#M29435</guid>
      <dc:creator>BenElan</dc:creator>
      <dc:date>2019-10-18T19:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: Change the attribute visible of layer when click on checkbok?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-the-attribute-visible-of-layer-when-click/m-p/319432#M29436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmm, I tested this functionality as a sanity check, and it is possible to do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Test app (toggle state labels on and off with the button at the bottom)&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://codepen.io/noash/pen/MWWbWZy" title="https://codepen.io/noash/pen/MWWbWZy"&gt;https://codepen.io/noash/pen/MWWbWZy&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps the&amp;nbsp;MapServer you're using doesn't support dynamic layers? You need it to in order to make changes dynamically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you inspect the MapServer from REST, do you see:&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000000; background-color: #ffffff; font-size: 14.4px;"&gt;Supports Dynamic Layers:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: 14.4px;"&gt;true&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: 14.4px;"&gt;?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2019 19:46:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-the-attribute-visible-of-layer-when-click/m-p/319432#M29436</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2019-10-18T19:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: Change the attribute visible of layer when click on checkbok?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-the-attribute-visible-of-layer-when-click/m-p/319433#M29437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for answering if it supports Dynamic Layers, my quick stop solution that works for me is to load the map again, for now I will stay with this solution later I will see the performance.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2019 19:57:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-the-attribute-visible-of-layer-when-click/m-p/319433#M29437</guid>
      <dc:creator>UlisesTabares</dc:creator>
      <dc:date>2019-10-18T19:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Change the attribute visible of layer when click on checkbok?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-the-attribute-visible-of-layer-when-click/m-p/319434#M29438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the solution i only need&amp;nbsp;findSublayerById function .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$('#checkbox').change(function(event) {&lt;BR /&gt; var idcheck = event.target.getAttribute("data-id");&lt;BR /&gt; if(idcheck){&lt;BR /&gt; var sublayer = Layers.findSublayerById(parseInt(idcheck));&lt;BR /&gt; sublayer.visible = !sublayer.visible;&lt;BR /&gt; &lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; });&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2019 18:36:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-the-attribute-visible-of-layer-when-click/m-p/319434#M29438</guid>
      <dc:creator>UlisesTabares</dc:creator>
      <dc:date>2019-10-21T18:36:18Z</dc:date>
    </item>
  </channel>
</rss>

