<?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 to Hide and Show ClusterLayer on Demand in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-hide-and-show-clusterlayer-on-demand/m-p/149140#M13897</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Behrouz,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of using show() and hide() have you tried using the .setVisibility method?&amp;nbsp; I took a look at the CrimeMapper example and that is the method they used to toggle the visibility.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can look at the reference here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/jsapi/graphicslayer-amd.html#setvisibility" title="https://developers.arcgis.com/javascript/jsapi/graphicslayer-amd.html#setvisibility"&gt;GraphicsLayer | API Reference | ArcGIS API for JavaScript&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Sep 2015 00:15:33 GMT</pubDate>
    <dc:creator>TomSellsted</dc:creator>
    <dc:date>2015-09-09T00:15:33Z</dc:date>
    <item>
      <title>How to Hide and Show ClusterLayer on Demand</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-hide-and-show-clusterlayer-on-demand/m-p/149138#M13895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I followed &lt;A href="https://developers.arcgis.com/javascript/jssamples/layers_point_clustering.html" rel="nofollow noopener noreferrer" target="_blank"&gt;This API Tutorial &lt;/A&gt;to create Cluster Points on the map. Now I would like to have a function to hide them. I already tried like?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;clusterLayer.hide();&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it didn't work! I also tried to bind the clusterLayer to a &lt;STRONG&gt;GraphicsLayer &lt;/STRONG&gt;like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp; var clayer = new esri.layers.GraphicsLayer();
&amp;nbsp; clayer.add(clusterLayer);
&amp;nbsp; clayer.hide();&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but still not working&lt;/P&gt;&lt;P&gt;After hours of working I find a sample on google at &lt;A href="http://maps.esri.com/SP_DEMOS/crimemapper/index.html" rel="nofollow noopener noreferrer" target="_blank"&gt;this Demo&lt;/A&gt; doing the job of switching between Points and Cluster but it is supper complicated to me!&lt;/P&gt;&lt;P&gt;Can you please let me know how I can hide and show the cluster layer on demand?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:04:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-hide-and-show-clusterlayer-on-demand/m-p/149138#M13895</guid>
      <dc:creator>BruceGreen</dc:creator>
      <dc:date>2021-12-11T08:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to Hide and Show ClusterLayer on Demand</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-hide-and-show-clusterlayer-on-demand/m-p/149139#M13896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suspect clusterLayer.hide() is not working for you because the clusterLayer variable is declared within the anonymous function called by ready(function () { var clusterLayer; // only available within this function }).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A simple fix within the sample is to declare clusterLayer as a global along with map; then clusterLayer.hide() will work OR add the layer toggling logic within the aforementioned function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Sep 2015 22:30:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-hide-and-show-clusterlayer-on-demand/m-p/149139#M13896</guid>
      <dc:creator>BenFousek</dc:creator>
      <dc:date>2015-09-08T22:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to Hide and Show ClusterLayer on Demand</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-hide-and-show-clusterlayer-on-demand/m-p/149140#M13897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Behrouz,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of using show() and hide() have you tried using the .setVisibility method?&amp;nbsp; I took a look at the CrimeMapper example and that is the method they used to toggle the visibility.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can look at the reference here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/jsapi/graphicslayer-amd.html#setvisibility" title="https://developers.arcgis.com/javascript/jsapi/graphicslayer-amd.html#setvisibility"&gt;GraphicsLayer | API Reference | ArcGIS API for JavaScript&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Sep 2015 00:15:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-hide-and-show-clusterlayer-on-demand/m-p/149140#M13897</guid>
      <dc:creator>TomSellsted</dc:creator>
      <dc:date>2015-09-09T00:15:33Z</dc:date>
    </item>
  </channel>
</rss>

