<?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: Hide DistanceMeasurement2D-layer in LayerList in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hide-distancemeasurement2d-layer-in-layerlist/m-p/608150#M56876</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, i just checked it and can confirm the layer doesn't show up in the Layerlist anymore.&amp;nbsp;Was just moving to 4.11 while in the process of trying to hide that item.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Mar 2019 18:08:08 GMT</pubDate>
    <dc:creator>MichaelLodes2</dc:creator>
    <dc:date>2019-03-29T18:08:08Z</dc:date>
    <item>
      <title>Hide DistanceMeasurement2D-layer in LayerList</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hide-distancemeasurement2d-layer-in-layerlist/m-p/608148#M56874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;(API 4.11)&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;as in the title i am trying to hide the layer, that the DistanceMeasureMent2D widget saves its Graphics on, in the LayerList widget. As i have no access to the layer i cannot set&amp;nbsp; the listMode to hide (listMode: "hide").&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defining the operationalItems in the layerList is not the optimal solution as we wan't to change the layers dynamically via php.&lt;/P&gt;&lt;P&gt;A small workaround i found in the GeoNet would be to not allow any Graphicslayers in the Layerlist widget:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; layerList &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;LayerList&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
  view&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; view&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
  container&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; document&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;createElement&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"div"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
  listItemCreatedFunction&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; defineActions
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

layerList&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;operationalItems&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;on&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"before-add"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;event&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
  &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;event&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;item&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;type &lt;SPAN class="operator token"&gt;===&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"graphics"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    event&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;preventDefault&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
  &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;That works fine for the moment but maybe in the Future we might want to have graphicslayers included.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Changing the LayerListView.js is also not an option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tl;dr: How to access and hide the DistanceMeasurement2D-layer in the LayerList widget?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:02:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hide-distancemeasurement2d-layer-in-layerlist/m-p/608148#M56874</guid>
      <dc:creator>MichaelLodes2</dc:creator>
      <dc:date>2021-12-12T02:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: Hide DistanceMeasurement2D-layer in LayerList</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hide-distancemeasurement2d-layer-in-layerlist/m-p/608149#M56875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael, I'm pretty sure we fixed this at 4.11 to be the default behavior. Here is a sample app that demonstrates how the 2D area and distance measurements are not added to the LayerList widget:&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/noash/pen/MRgJvK"&gt;https://codepen.io/noash/pen/MRgJvK&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Mar 2019 17:49:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hide-distancemeasurement2d-layer-in-layerlist/m-p/608149#M56875</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2019-03-29T17:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: Hide DistanceMeasurement2D-layer in LayerList</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hide-distancemeasurement2d-layer-in-layerlist/m-p/608150#M56876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, i just checked it and can confirm the layer doesn't show up in the Layerlist anymore.&amp;nbsp;Was just moving to 4.11 while in the process of trying to hide that item.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Mar 2019 18:08:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hide-distancemeasurement2d-layer-in-layerlist/m-p/608150#M56876</guid>
      <dc:creator>MichaelLodes2</dc:creator>
      <dc:date>2019-03-29T18:08:08Z</dc:date>
    </item>
  </channel>
</rss>

