<?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: How do I get my layer checkboxes to update layer visibility? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33535#M2731</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try checking to see what the value is for &lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #f6f6f6;"&gt;dom.byId(&lt;/SPAN&gt;&lt;SPAN class="string" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: blue; background-color: #f6f6f6;"&gt;"lyrSigns"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000; background-color: #f6f6f6;"&gt;) and dom.byId("lyrSupports"). If you set a breakpoint in the code at that line and check the values are they correct? &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 May 2015 19:33:11 GMT</pubDate>
    <dc:creator>KellyHutchins</dc:creator>
    <dc:date>2015-05-01T19:33:11Z</dc:date>
    <item>
      <title>How do I get my layer checkboxes to update layer visibility?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33534#M2730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to use this sample to toggle layers: &lt;A href="https://developers.arcgis.com/javascript/jssamples/map_explicitlayerlist.html" title="https://developers.arcgis.com/javascript/jssamples/map_explicitlayerlist.html" rel="nofollow noopener noreferrer" target="_blank"&gt;Toggle layer visibility | ArcGIS API for JavaScript&lt;/A&gt;&amp;nbsp; but I receive this error message: &lt;/P&gt;&lt;P class="section expanded" style="margin: 0 0 0 12px !important;"&gt;&lt;/P&gt;&lt;DIV class="header monospace" style="padding: 0 8px 0 0;"&gt;&lt;DIV class="title" style="color: #222222;"&gt;&lt;SPAN class="console-object-preview" style="font-style: italic;"&gt;TypeError: Cannot read property 'on' of null {&lt;SPAN class="name" style="color: #881391;"&gt;stack&lt;/SPAN&gt;: &lt;SPAN class="properties-calculate-value-button" title="Invoke property getter"&gt;(...)&lt;/SPAN&gt;, &lt;SPAN class="name" style="color: #881391;"&gt;message&lt;/SPAN&gt;: &lt;SPAN class="console-formatted-string" style="color: #c41a16;"&gt;"Cannot read property 'on' of null"&lt;/SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN class="object-info-state-note" style="color: white; text-align: center; margin: 0 6px; font-size: 9px; background-color: #b3cbf7;" title="Object state below is captured upon first expansion"&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;OL class="monospace properties properties-tree" style="padding-right: 6px; padding-bottom: 2px; list-style: none; padding-left: 0 !important;"&gt;&lt;LI&gt;&lt;SPAN class="name dimmed" style="color: #881391;"&gt;message&lt;/SPAN&gt;&lt;SPAN class="separator"&gt;: &lt;/SPAN&gt;&lt;SPAN class="value console-formatted-string" style="color: #c41a16;" title="Cannot read property 'on' of null"&gt;"Cannot read property 'on' of null"&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="name properties-accessor-property-name dimmed" style="font-style: italic; color: #881391;"&gt;stack&lt;/SPAN&gt;&lt;SPAN class="separator"&gt;: &lt;/SPAN&gt;(...)&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="name" style="color: #881391;"&gt;get stack&lt;/SPAN&gt;&lt;SPAN class="separator"&gt;: &lt;/SPAN&gt;&lt;SPAN class="value console-formatted-function" title="function () { [native code] }"&gt;function () { [native code] }&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="name" style="color: #881391;"&gt;set stack&lt;/SPAN&gt;&lt;SPAN class="separator"&gt;: &lt;/SPAN&gt;&lt;SPAN class="value console-formatted-function" title="function () { [native code] }"&gt;function () { [native code] }&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="name dimmed" style="color: #881391;"&gt;__proto__&lt;/SPAN&gt;&lt;SPAN class="separator"&gt;: &lt;/SPAN&gt;&lt;SPAN class="value console-formatted-object" style="color: inherit;" title="Error"&gt;Error&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-family: Consolas, 'Lucida Console', monospace; font-size: 12px;"&gt; &lt;/SPAN&gt;&lt;SPAN class="source-code" style="font-family: Consolas, 'Lucida Console', monospace; font-size: 12px; color: #ff0000;"&gt;"&lt;SPAN class="console-formatted-string source-code" style="color: #c41a16;"&gt;in domReady callback&lt;/SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-family: Consolas, 'Lucida Console', monospace; font-size: 12px;"&gt; &lt;/SPAN&gt;&lt;SPAN class="source-code" style="font-family: Consolas, 'Lucida Console', monospace; font-size: 12px; color: #ff0000;"&gt;"&lt;SPAN class="console-formatted-string source-code" style="color: #c41a16;"&gt;TypeError: Cannot read property 'on' of null&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and here is my code:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var visibleLayerIds = [];
&amp;nbsp;&amp;nbsp;&amp;nbsp; on(dom.byId("lyrSigns"), "change", updateLayerVisibility);
&amp;nbsp;&amp;nbsp;&amp;nbsp; on(dom.byId("lyrSupports"), "change", updateLayerVisibility);


&amp;nbsp;&amp;nbsp;&amp;nbsp; function updateLayerVisibility() {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var inputs = query(".list_item");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var inputCount = inputs.length;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (var i = 0; i &amp;lt; inputCount; i++) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (inputs&lt;I&gt;.checked) {&lt;/I&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; visibleLayerIds.push(inputs&lt;I&gt;.value);&lt;/I&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (visibleLayerIds.length === 0) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; visibleLayerIds.push(-1);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layer.setVisibleLayers(visibleLayerIds);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And here is my project on github: &lt;A href="https://github.com/csergent45/streetSigns" title="https://github.com/csergent45/streetSigns" rel="nofollow noopener noreferrer" target="_blank"&gt;csergent45/streetSigns · GitHub&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:18:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33534#M2730</guid>
      <dc:creator>ChrisSergent</dc:creator>
      <dc:date>2021-12-10T21:18:40Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get my layer checkboxes to update layer visibility?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33535#M2731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try checking to see what the value is for &lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #f6f6f6;"&gt;dom.byId(&lt;/SPAN&gt;&lt;SPAN class="string" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: blue; background-color: #f6f6f6;"&gt;"lyrSigns"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000; background-color: #f6f6f6;"&gt;) and dom.byId("lyrSupports"). If you set a breakpoint in the code at that line and check the values are they correct? &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 May 2015 19:33:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33535#M2731</guid>
      <dc:creator>KellyHutchins</dc:creator>
      <dc:date>2015-05-01T19:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get my layer checkboxes to update layer visibility?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33536#M2732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your input's id is actually lyrSupport but you're looking for lyrSupports.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In index.html:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&amp;lt;input type="checkbox" id="lyrSupport" checked value="1" /&amp;gt;&amp;nbsp; &amp;nbsp; Supports&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change lyrSupport to lyrSupports.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 May 2015 19:39:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33536#M2732</guid>
      <dc:creator>roemhildtg</dc:creator>
      <dc:date>2015-05-01T19:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get my layer checkboxes to update layer visibility?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33537#M2733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just replied to your other post and then saw this one.&amp;nbsp; Here was my response:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;I checked out your toggle layer code and the code that you pulled from is using DynamicMapService found here &lt;A class="jive-link-external-small" href="https://developers.arcgis.com/javascript/jssamples/map_explicitlayerlist.html" rel="nofollow" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #287433;" target="_blank"&gt;Toggle layer visibility | ArcGIS API for JavaScript&lt;/A&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;In your application you are using feature layers.&amp;nbsp; I am using feature layers and toggling like this:&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;/P&gt;&lt;DIV class="bar" style="font-weight: inherit; font-style: inherit; font-size: 11.9999990463257px; font-family: inherit;"&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14305105045934027" data-renderedposition="158.15972900390625_7.986111640930176_911_303" jivemacro_uid="_14305105045934027" modifiedtitle="true"&gt;&lt;OL class="dp-c" start="1" style="font-weight: inherit; font-style: inherit; font-size: 11.9999990463257px; font-family: inherit;"&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt; layer1 = &lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt; FeatureLayer(&lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit;"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://myurl/MapServer/1" rel="nofollow" target="_blank"&gt;https://myurl/MapServer/1&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;,{&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mode: FeatureLayer.MODE_ONDEMAND,&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outFields: [&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit;"&gt;"*"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;],&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infoTemplate: template&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt; checkBox = &lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt; CheckBox({&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&amp;nbsp; name: &lt;SPAN class="string" style="font-weight: inherit; font-style: inherit;"&gt;"checkBox1"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;,&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&amp;nbsp; value: &lt;SPAN class="string" style="font-weight: inherit; font-style: inherit;"&gt;"agreed"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;,&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&amp;nbsp; checked: &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit;"&gt;false&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;,&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&amp;nbsp; onChange: &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit;"&gt;function&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;(b){&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt; (b == &lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit;"&gt;true&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;) {&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&amp;nbsp; map.addLayer(layer1);&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&amp;nbsp; } &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt; {&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&amp;nbsp; map.removeLayer(layer1);&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&amp;nbsp; } }&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&amp;nbsp; }, &lt;SPAN class="string" style="font-weight: inherit; font-style: inherit;"&gt;"checkBox1"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;).startup();&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Be sure to call the "dijit/form/CheckBox", module with function(CheckBox)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="bar" style="font-weight: inherit; font-style: inherit; font-size: 11.9999990463257px; font-family: inherit;"&gt;&lt;/P&gt;&lt;OL class="dp-c" start="1" style="font-weight: inherit; font-style: inherit; font-size: 11.9999990463257px; font-family: inherit;"&gt;&lt;LI&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="_jivemacro_uid_14305105103028811 jive_macro_code jive_text_macro" data-renderedposition="525.7291870117188_37.986114501953125_881_18" jivemacro_uid="_14305105103028811"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&amp;lt;input type=&lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit;"&gt;'checkbox' id='checkBox1'&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt; value=&lt;/SPAN&gt;&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt; /&amp;gt;Layer1&amp;lt;br /&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Hope this helps you out with that issue.&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Steven&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 May 2015 20:01:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33537#M2733</guid>
      <dc:creator>StevenGraf1</dc:creator>
      <dc:date>2015-05-01T20:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get my layer checkboxes to update layer visibility?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33538#M2734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ignore the &amp;lt;span&amp;gt; &amp;lt;/span&amp;gt;....It put that in there because I copied my original post.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 May 2015 20:03:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33538#M2734</guid>
      <dc:creator>StevenGraf1</dc:creator>
      <dc:date>2015-05-01T20:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get my layer checkboxes to update layer visibility?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33539#M2735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am receiving this error immediately:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="section expanded" style="margin: 0 0 0 12px !important;"&gt;&lt;/P&gt;&lt;DIV class="header monospace" style="padding: 0 8px 0 0;"&gt;&lt;DIV class="title" style="color: #222222;"&gt;&lt;SPAN class="console-object-preview" style="font-style: italic;"&gt;TypeError: Cannot read property 'call' of undefined {&lt;SPAN class="name" style="color: #881391;"&gt;stack&lt;/SPAN&gt;: &lt;SPAN class="properties-calculate-value-button" title="Invoke property getter"&gt;(...)&lt;/SPAN&gt;, &lt;SPAN class="name" style="color: #881391;"&gt;message&lt;/SPAN&gt;: &lt;SPAN class="console-formatted-string" style="color: #c41a16;"&gt;"Cannot read property 'call' of undefined"&lt;/SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN class="object-info-state-note" style="color: white; text-align: center; margin: 0 6px; font-size: 9px; background-color: #b3cbf7;" title="Object state below is captured upon first expansion"&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;OL class="monospace properties properties-tree" style="padding-right: 6px; padding-bottom: 2px; list-style: none; padding-left: 0 !important;"&gt;&lt;LI&gt;&lt;SPAN class="name dimmed" style="color: #881391;"&gt;message&lt;/SPAN&gt;&lt;SPAN class="separator"&gt;: &lt;/SPAN&gt;&lt;SPAN class="value console-formatted-string" style="color: #c41a16;" title="Cannot read property 'call' of undefined"&gt;"Cannot read property 'call' of undefined"&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="name properties-accessor-property-name dimmed" style="font-style: italic; color: #881391;"&gt;stack&lt;/SPAN&gt;&lt;SPAN class="separator"&gt;: &lt;/SPAN&gt;(...)&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="name" style="color: #881391;"&gt;get stack&lt;/SPAN&gt;&lt;SPAN class="separator"&gt;: &lt;/SPAN&gt;&lt;SPAN class="value console-formatted-function" title="function () { [native code] }"&gt;function () { [native code] }&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="name" style="color: #881391;"&gt;set stack&lt;/SPAN&gt;&lt;SPAN class="separator"&gt;: &lt;/SPAN&gt;&lt;SPAN class="value console-formatted-function" title="function () { [native code] }"&gt;function () { [native code] }&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="name dimmed" style="color: #881391;"&gt;__proto__&lt;/SPAN&gt;&lt;SPAN class="separator"&gt;: &lt;/SPAN&gt;&lt;SPAN class="value console-formatted-object" style="color: inherit;" title="Error"&gt;Error&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-family: Consolas, 'Lucida Console', monospace; font-size: 12px;"&gt; &lt;/SPAN&gt;&lt;SPAN class="source-code" style="font-family: Consolas, 'Lucida Console', monospace; font-size: 12px; color: #ff0000;"&gt;"&lt;SPAN class="console-formatted-string source-code" style="color: #c41a16;"&gt;in domReady callback&lt;/SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-family: Consolas, 'Lucida Console', monospace; font-size: 12px;"&gt; &lt;/SPAN&gt;&lt;SPAN class="source-code" style="font-family: Consolas, 'Lucida Console', monospace; font-size: 12px; color: #ff0000;"&gt;"&lt;SPAN class="console-formatted-string source-code" style="color: #c41a16;"&gt;TypeError: Cannot read property 'call' of undefined at Function.k.parse (&lt;A class="webkit-html-resource-link" href="http://js.arcgis.com/3.13compact/init.js" style="color: #545454; text-decoration: underline;" title="http://js.arcgis.com/3.13compact/init.js"&gt;http://js.arcgis.com/3.13compact/init.js:218:362&lt;/A&gt;) at k (&lt;A class="webkit-html-resource-link" href="http://js.arcgis.com/3.13compact/init.js" style="color: #545454; text-decoration: underline;" title="http://js.arcgis.com/3.13compact/init.js"&gt;http://js.arcgis.com/3.13compact/init.js:218:47&lt;/A&gt;) at &lt;A class="webkit-html-resource-link" href="http://localhost:50548/app/main.js" style="color: #545454; text-decoration: underline;" title="http://localhost:50548/app/main.js"&gt;http://localhost:50548/app/main.js:130:52&lt;/A&gt; at ha (&lt;A class="webkit-html-resource-link" href="http://js.arcgis.com/3.13compact/init.js" style="color: #545454; text-decoration: underline;" title="http://js.arcgis.com/3.13compact/init.js"&gt;http://js.arcgis.com/3.13compact/init.js:32:473&lt;/A&gt;) at ha (&lt;A class="webkit-html-resource-link" href="http://js.arcgis.com/3.13compact/init.js" style="color: #545454; text-decoration: underline;" title="http://js.arcgis.com/3.13compact/init.js"&gt;http://js.arcgis.com/3.13compact/init.js:32:184&lt;/A&gt;) at &lt;A class="webkit-html-resource-link" href="http://js.arcgis.com/3.13compact/init.js" style="color: #545454; text-decoration: underline;" title="http://js.arcgis.com/3.13compact/init.js"&gt;http://js.arcgis.com/3.13compact/init.js:33:202&lt;/A&gt; at ia (&lt;A class="webkit-html-resource-link" href="http://js.arcgis.com/3.13compact/init.js" style="color: #545454; text-decoration: underline;" title="http://js.arcgis.com/3.13compact/init.js"&gt;http://js.arcgis.com/3.13compact/init.js:33:89&lt;/A&gt;) at fa (&lt;A class="webkit-html-resource-link" href="http://js.arcgis.com/3.13compact/init.js" style="color: #545454; text-decoration: underline;" title="http://js.arcgis.com/3.13compact/init.js"&gt;http://js.arcgis.com/3.13compact/init.js:33:144&lt;/A&gt;) at b (&lt;A class="webkit-html-resource-link" href="http://js.arcgis.com/3.13compact/init.js" style="color: #545454; text-decoration: underline;" title="http://js.arcgis.com/3.13compact/init.js"&gt;http://js.arcgis.com/3.13compact/init.js:34:122&lt;/A&gt;) at e (&lt;A class="webkit-html-resource-link" href="http://js.arcgis.com/3.13compact/init.js" style="color: #545454; text-decoration: underline;" title="http://js.arcgis.com/3.13compact/init.js"&gt;http://js.arcgis.com/3.13compact/init.js:170:442&lt;/A&gt;)&lt;/SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I just added these two line to try to get the value of the checkboxes:&lt;/P&gt;&lt;P&gt;on(dom.byId("lyrSigns"), "change", console.log(on(dom.byId("lyrSigns").value)));&lt;/P&gt;&lt;P&gt;on(dom.byId("lyrSupports"), "change", console.log(on(dom.byId("lyrSupports").value)));&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2015 16:01:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33539#M2735</guid>
      <dc:creator>ChrisSergent</dc:creator>
      <dc:date>2015-05-04T16:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get my layer checkboxes to update layer visibility?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33540#M2736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I modified the code as follows:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var checkBox = new CheckBox({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name: "lyrSigns",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value: "agreed",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; checked: false,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; onChange: function (b) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (b == true) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; app.map.addLayer("signLayerUrl");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; app.map.removeLayer("signLayerUrl");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }, "lyrSigns").startup();&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I get the following error: Uncaught lang.hitch: scope["onLoad"] is null (scope="[object Window]")&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:18:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33540#M2736</guid>
      <dc:creator>ChrisSergent</dc:creator>
      <dc:date>2021-12-10T21:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get my layer checkboxes to update layer visibility?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33541#M2737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you try &lt;A href="https://community.esri.com/migrated-users/38220"&gt;Gregg Roemhildt&lt;/A&gt;​'s suggestion because I suspect that its the solution to this issue. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2015 19:29:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33541#M2737</guid>
      <dc:creator>KellyHutchins</dc:creator>
      <dc:date>2015-05-04T19:29:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get my layer checkboxes to update layer visibility?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33542#M2738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried &lt;A href="https://community.esri.com/migrated-users/38220" target="_blank"&gt;Gregg Roemhildt&lt;/A&gt; 's solution by entering the following:&lt;/P&gt;&lt;P&gt;var visibleLayerIds = [];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp; on(dom.byId("lyrSigns"), "change", updateLayerVisibility);
&amp;nbsp;&amp;nbsp;&amp;nbsp; //on(dom.byId("lyrSupports"), "change", updateLayerVisibility);


&amp;nbsp;&amp;nbsp;&amp;nbsp; function updateLayerVisibility() {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var inputs = query(".list_item");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var inputCount = inputs.length;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; visibleLayerIds = [0];


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (var i = 0; i &amp;lt; inputCount; i++) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (inputs&lt;I&gt;.checked) {&lt;/I&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; visibleLayerIds.push(inputs&lt;I&gt;.value);&lt;/I&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (visibleLayerIds.length === 0) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; visibleLayerIds.push(-1);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; signLayerUrl.setVisibleLayers(visibleLayerIds);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been referencing this sample: &lt;A href="https://developers.arcgis.com/javascript/jssamples/map_explicitlayerlist.html" rel="nofollow noopener noreferrer" target="_blank"&gt;https://developers.arcgis.com/javascript/jssamples/map_explicitlayerlist.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I wondered, since I am working with two separate feature layers, do I need to work with them individually as the example just uses a single dynamic layer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Either way, when I update the code from above I get the following error: ncaught ReferenceError: signLayerUrl is not defined&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it's defined in the config section of the page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have updated my code with this modification on github: &lt;A href="https://github.com/csergent45/streetSigns" rel="nofollow noopener noreferrer" target="_blank"&gt;https://github.com/csergent45/streetSigns&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:18:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33542#M2738</guid>
      <dc:creator>ChrisSergent</dc:creator>
      <dc:date>2021-12-10T21:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get my layer checkboxes to update layer visibility?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33543#M2739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are using feature layers you will want to use the feature layer's &lt;A href="https://developers.arcgis.com/javascript/jsapi/featurelayer-amd.html#setvisibility"&gt;setVisibility&lt;/A&gt; method instead of setVisibleLayers. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The error saying the variable (signLayerUrl) is not defined generally means that the variable you are using isn't available.&amp;nbsp; Perhaps there's a typo in your app or maybe its a scope issue.&amp;nbsp; Try setting a breakpoint in your app at line 22 and inspect the signLayerUrl variable to see if its undefined.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2015 20:04:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33543#M2739</guid>
      <dc:creator>KellyHutchins</dc:creator>
      <dc:date>2015-05-04T20:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get my layer checkboxes to update layer visibility?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33544#M2740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Line 22? I have that as my require statements. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2015 20:38:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33544#M2740</guid>
      <dc:creator>ChrisSergent</dc:creator>
      <dc:date>2015-05-04T20:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get my layer checkboxes to update layer visibility?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33545#M2741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;line 22 in your code snippet above not in your source.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2015 20:39:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33545#M2741</guid>
      <dc:creator>KellyHutchins</dc:creator>
      <dc:date>2015-05-04T20:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get my layer checkboxes to update layer visibility?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33546#M2742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have updated it as follows and there are no errors, but nothing is happening:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var visibleLayerIds = [];
&amp;nbsp;&amp;nbsp; 


&amp;nbsp;&amp;nbsp;&amp;nbsp; on(dom.byId("lyrSigns"), "change", updateLayerVisibility);
&amp;nbsp;&amp;nbsp;&amp;nbsp; //on(dom.byId("lyrSupports"), "change", updateLayerVisibility);


&amp;nbsp;&amp;nbsp;&amp;nbsp; function updateLayerVisibility() {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var inputs = query(".list_item");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var inputCount = inputs.length;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; visibleLayerIds = [0];


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (var i = 0; i &amp;lt; inputCount; i++) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (inputs&lt;I&gt;.checked) {&lt;/I&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; visibleLayerIds.push(inputs&lt;I&gt;.value);&lt;/I&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (visibleLayerIds.length === 0) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; visibleLayerIds.push(-1);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; app.signLayer.setVisibility(visibleLayerIds);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;P&gt;But app.signLayer does define as my sign layer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:18:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33546#M2742</guid>
      <dc:creator>ChrisSergent</dc:creator>
      <dc:date>2021-12-10T21:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get my layer checkboxes to update layer visibility?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33547#M2743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In your updated sample you are setting the featureLayer.setVisiblity to an array of ids which is not valid for that method. The &lt;A href="https://developers.arcgis.com/javascript/jsapi/featurelayer-amd.html#setvisibility"&gt;setVisiblity&lt;/A&gt; method accepts&amp;nbsp; true or false. So your code should be something like: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myLayer.setVisibility(false);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2015 23:55:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33547#M2743</guid>
      <dc:creator>KellyHutchins</dc:creator>
      <dc:date>2015-05-04T23:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get my layer checkboxes to update layer visibility?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33548#M2744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Add in the following module &lt;A href="http://dojotoolkit.org/reference-guide/1.10/dojo/_base/lang.html" title="http://dojotoolkit.org/reference-guide/1.10/dojo/_base/lang.html"&gt;dojo/_base/lang — The Dojo Toolkit - Reference Guide&lt;/A&gt;&amp;nbsp; and see if that corrects the error.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2015 00:00:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33548#M2744</guid>
      <dc:creator>StevenGraf1</dc:creator>
      <dc:date>2015-05-05T00:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get my layer checkboxes to update layer visibility?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33549#M2745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I appreciate everyone's help. Thanks to everyone for your help. I clicked like and helpful to give you all points. Here is the final code that I came up with:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;on(dom.byId("lyrSigns"), "change", updateSignLayerVisibility);
&amp;nbsp;&amp;nbsp;&amp;nbsp; on(dom.byId("lyrSupports"), "change", updateSupportLayerVisibility);





&amp;nbsp;&amp;nbsp;&amp;nbsp; function updateSignLayerVisibility() {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (document.getElementById('lyrSigns').checked) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; app.signLayer.setVisibility(true);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; app.signLayer.setVisibility(false);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }


&amp;nbsp;&amp;nbsp;&amp;nbsp; function updateSupportLayerVisibility() {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (document.getElementById('lyrSupports').checked) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; app.supportLayer.setVisibility(true);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; app.supportLayer.setVisibility(false);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was hoping for a single loop, but this works. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:18:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33549#M2745</guid>
      <dc:creator>ChrisSergent</dc:creator>
      <dc:date>2021-12-10T21:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get my layer checkboxes to update layer visibility?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33550#M2746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Seems like you could lessen your code a little by doing this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; on(dom.byId("lyrSigns"), "change", updateLayerVisibility); 
&amp;nbsp;&amp;nbsp;&amp;nbsp; on(dom.byId("lyrSupports"), "change", updateLayerVisibility); 

&amp;nbsp;&amp;nbsp;&amp;nbsp; function updateLayerVisibility() { 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (document.getElementById('lyrSigns').checked) { 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; app.signLayer.setVisibility(true); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else { 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; app.signLayer.setVisibility(false); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (document.getElementById('lyrSupports').checked) { 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; app.supportLayer.setVisibility(true); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else { 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; app.supportLayer.setVisibility(false); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:18:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33550#M2746</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-10T21:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get my layer checkboxes to update layer visibility?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33551#M2747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Awesome! That worked nicely.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2015 13:30:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33551#M2747</guid>
      <dc:creator>ChrisSergent</dc:creator>
      <dc:date>2015-05-05T13:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get my layer checkboxes to update layer visibility?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33552#M2748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Even better:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; on(dom.byId("lyrSigns"), "change", updateLayerVisibility); 
&amp;nbsp;&amp;nbsp;&amp;nbsp; on(dom.byId("lyrSupports"), "change", updateLayerVisibility); 

&amp;nbsp;&amp;nbsp;&amp;nbsp; function updateLayerVisibility() { 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; app.signLayer.setVisibility(document.getElementById('lyrSigns').checked);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; app.supportLayer.setVisibility(document.getElementById('lyrSupports').checked); 
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:18:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33552#M2748</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-10T21:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get my layer checkboxes to update layer visibility?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33553#M2749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Very nice. So this is setting visibility based on the value of checked. Is that correct?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2015 13:47:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-get-my-layer-checkboxes-to-update-layer/m-p/33553#M2749</guid>
      <dc:creator>ChrisSergent</dc:creator>
      <dc:date>2015-05-05T13:47:17Z</dc:date>
    </item>
  </channel>
</rss>

