<?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: Clear a basemap from the application. in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/clear-a-basemap-from-the-application/m-p/182792#M16973</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you want to hide the basemap(s)? &amp;nbsp;If so this will hide all basemap layers:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;// ES6&lt;/SPAN&gt;
map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;basemapLayerIds&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;forEach&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;id &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp; map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;id&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;hide&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="comment token"&gt;//ES5&lt;/SPAN&gt;
map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;basemapLayerIds&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;forEach&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;id&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp; map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;id&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;hide&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="comment token"&gt;// use .show() to show the layer&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;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To actually remove the layer you can do this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;basemapLayerIds&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;forEach&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;id &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp; map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;removeLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;id&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure the best way to go about adding this functionality&amp;nbsp;to the basemap widget.&amp;nbsp; I agree that it would be nice if the gallery included this option, but aside from some DOM manipulation, I think your best bet would be locating this functionality somewhere else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oh, I may have misunderstood. &amp;nbsp;If the goal is to clear the basemap, you can do this with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;basemapGallery&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;remove&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;id&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;of&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;layer&lt;SPAN class="operator token"&gt;&amp;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="comment token"&gt;// ids are basemap_0 -&amp;gt; basemap_N&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It looks like basemaps are displayed in reverse order: so basemap_0 will be the ID of the bottom-right basemap in the widget.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 09:18:57 GMT</pubDate>
    <dc:creator>ThomasSolow</dc:creator>
    <dc:date>2021-12-11T09:18:57Z</dc:date>
    <item>
      <title>Clear a basemap from the application.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/clear-a-basemap-from-the-application/m-p/182790#M16971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;By using the basemap widget, the user selects one base map and can change the base maps. Now, the user wants to clear base map&amp;nbsp;from the base map widget.&lt;/P&gt;&lt;P&gt;Is it possible? If yes, How its can anyone share the code. M using the base map gallery sample&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/3/jssamples/widget_basemap.html" title="https://developers.arcgis.com/javascript/3/jssamples/widget_basemap.html"&gt;Basemap gallery | ArcGIS API for JavaScript 3.20&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 May 2017 13:40:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/clear-a-basemap-from-the-application/m-p/182790#M16971</guid>
      <dc:creator>Sai_AnandPeketi1</dc:creator>
      <dc:date>2017-05-24T13:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: Clear a basemap from the application.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/clear-a-basemap-from-the-application/m-p/182791#M16972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The user wants to be able to remove the option of that basemap from the list of choices?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 May 2017 14:26:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/clear-a-basemap-from-the-application/m-p/182791#M16972</guid>
      <dc:creator>RickeyFight</dc:creator>
      <dc:date>2017-05-24T14:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: Clear a basemap from the application.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/clear-a-basemap-from-the-application/m-p/182792#M16973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you want to hide the basemap(s)? &amp;nbsp;If so this will hide all basemap layers:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;// ES6&lt;/SPAN&gt;
map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;basemapLayerIds&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;forEach&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;id &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp; map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;id&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;hide&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="comment token"&gt;//ES5&lt;/SPAN&gt;
map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;basemapLayerIds&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;forEach&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;id&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp; map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;id&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;hide&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="comment token"&gt;// use .show() to show the layer&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;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To actually remove the layer you can do this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;basemapLayerIds&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;forEach&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;id &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp; map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;removeLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;id&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure the best way to go about adding this functionality&amp;nbsp;to the basemap widget.&amp;nbsp; I agree that it would be nice if the gallery included this option, but aside from some DOM manipulation, I think your best bet would be locating this functionality somewhere else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oh, I may have misunderstood. &amp;nbsp;If the goal is to clear the basemap, you can do this with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;basemapGallery&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;remove&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;id&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;of&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;layer&lt;SPAN class="operator token"&gt;&amp;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="comment token"&gt;// ids are basemap_0 -&amp;gt; basemap_N&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It looks like basemaps are displayed in reverse order: so basemap_0 will be the ID of the bottom-right basemap in the widget.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:18:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/clear-a-basemap-from-the-application/m-p/182792#M16973</guid>
      <dc:creator>ThomasSolow</dc:creator>
      <dc:date>2021-12-11T09:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: Clear a basemap from the application.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/clear-a-basemap-from-the-application/m-p/182793#M16974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, Rickey. User need removes&lt;SPAN style="background-color: #ffffff;"&gt; the option of that base map from the list of choices.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Thanks for the help.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 May 2017 15:21:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/clear-a-basemap-from-the-application/m-p/182793#M16974</guid>
      <dc:creator>Sai_AnandPeketi1</dc:creator>
      <dc:date>2017-05-24T15:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: Clear a basemap from the application.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/clear-a-basemap-from-the-application/m-p/182794#M16975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Thomas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But How can I get the id of the layer? How to pass the value in the remove method.&lt;/P&gt;&lt;PRE class="" style="color: #000000; background: #f5f2f0; border: 0px; margin: 0.5em 0px; padding: 1em 1em 1em 3.8em;"&gt;&lt;CODE style="border: 0px; font-weight: inherit;"&gt;basemapGallery&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #d74444; border: 0px; font-weight: inherit;"&gt;remove&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;&amp;lt;&lt;/SPAN&gt;id&lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;-&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;of&lt;/SPAN&gt;&lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;-&lt;/SPAN&gt;layer&lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 May 2017 15:23:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/clear-a-basemap-from-the-application/m-p/182794#M16975</guid>
      <dc:creator>Sai_AnandPeketi1</dc:creator>
      <dc:date>2017-05-24T15:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: Clear a basemap from the application.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/clear-a-basemap-from-the-application/m-p/182795#M16976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can get the IDs by looking at basemapGallery.basemaps. &amp;nbsp;This will be an array of objects, each of which will have a property called id that points to that basemap's id in the gallery.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the challenge here will be making a good user experience for removing basemaps from the list. &amp;nbsp;No obvious way to do this occurs to me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's an ugly example where control + click will remove a basemap from the list:&amp;nbsp;&lt;A class="link-titled" href="https://jsbin.com/sicisufeta/1/edit?html,output" title="https://jsbin.com/sicisufeta/1/edit?html,output"&gt;JS Bin - Collaborative JavaScript Debugging&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems that the event listeners need to be reset after each removal, probably because the entire list gets removed and re-added whenever it changes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 May 2017 15:43:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/clear-a-basemap-from-the-application/m-p/182795#M16976</guid>
      <dc:creator>ThomasSolow</dc:creator>
      <dc:date>2017-05-24T15:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: Clear a basemap from the application.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/clear-a-basemap-from-the-application/m-p/182796#M16977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Thomas. But I want to set like&lt;STRONG&gt; No Basemap, &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;Topographic&lt;/SPAN&gt;, &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;Imagery&lt;/SPAN&gt;,&amp;nbsp;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;Streets&lt;/SPAN&gt;&amp;nbsp;&lt;/STRONG&gt;option in the base map&amp;nbsp;gallery list.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 May 2017 16:43:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/clear-a-basemap-from-the-application/m-p/182796#M16977</guid>
      <dc:creator>Sai_AnandPeketi1</dc:creator>
      <dc:date>2017-05-24T16:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Clear a basemap from the application.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/clear-a-basemap-from-the-application/m-p/182797#M16978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This seems hard to do...mainly because the basemap gallery does not actually change the basemap of the map in question. &amp;nbsp;I have no idea why this is or what the issue is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, here's a somewhat hacky solution:&amp;nbsp;&lt;A class="link-titled" href="https://jsbin.com/bikagigafa/edit?html,output" title="https://jsbin.com/bikagigafa/edit?html,output"&gt;JS Bin - Collaborative JavaScript Debugging&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I added a "fake" basemap to the end of the list&amp;nbsp;with a white image (referenced by URL)&amp;nbsp;and a title of "Clear basemap." &amp;nbsp;Clicking on that basemap will toggle the visibility of the basemap on and off.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not too familiar with the 3.20 API, so if someone else knows of the correct way to determine the basemap layers on a given map, please feel free to chime in. &amp;nbsp;The way I'm finding them in that example is brittle and probably won't work on a lot of maps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 May 2017 17:15:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/clear-a-basemap-from-the-application/m-p/182797#M16978</guid>
      <dc:creator>ThomasSolow</dc:creator>
      <dc:date>2017-05-24T17:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: Clear a basemap from the application.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/clear-a-basemap-from-the-application/m-p/182798#M16979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is how i would approach it:&amp;nbsp;&lt;/P&gt;&lt;P&gt;map.on("load", function () {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;$("div[id*='map_layer']").hide(); &amp;nbsp;// this will hide any base map layer(s) on when the map load; not i use jquery to hid the //basemap div&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;basemapGallery.on("load", function () { &amp;nbsp; &amp;nbsp;// this will only left Imagery, Topographic and Streets basemap on the widgets&lt;BR /&gt; var baselayers = basemapGallery.basemaps.slice();&lt;BR /&gt; for (var i = 0; i &amp;lt; baselayers.length; i++) {&lt;BR /&gt; var layer = baselayers&lt;I&gt;;&lt;BR /&gt; if (layer.title != "Topographic" &amp;amp;&amp;amp; layer.title != "Imagery" &amp;amp;&amp;amp; layer.title != "Streets") {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;basemapGallery.remove(layer.id);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;}} &lt;BR /&gt; });&lt;/I&gt;&lt;/P&gt;&lt;P&gt;basemapGallery.on("selection-change", function () {&lt;BR /&gt; $("div[id*='map_layer']").show(); &amp;nbsp; &amp;nbsp; // this will display basemap should user click the base map icon;&lt;BR /&gt; });&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 May 2017 18:47:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/clear-a-basemap-from-the-application/m-p/182798#M16979</guid>
      <dc:creator>HemingZhu</dc:creator>
      <dc:date>2017-05-24T18:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: Clear a basemap from the application.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/clear-a-basemap-from-the-application/m-p/182799#M16980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Thomas. The idea was not bad. It is up to my question. Adding a no base map. It's good, but it removing the layer &amp;nbsp;from the list. Initially,&amp;nbsp;I have 3 items in the list. Whenever I'm clicking on the no base map icon. it removes the layer from the array list.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 May 2017 12:53:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/clear-a-basemap-from-the-application/m-p/182799#M16980</guid>
      <dc:creator>Sai_AnandPeketi1</dc:creator>
      <dc:date>2017-05-25T12:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: Clear a basemap from the application.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/clear-a-basemap-from-the-application/m-p/182800#M16981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Instead of removing the base map. I added another base map and set the&amp;nbsp;transparency level 100% in the base map gallery widget that resolved my problem.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;layers: [new esri.dijit.BasemapLayer({&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN&gt;URL: "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fservices.arcgisonline.com%2Farcgis%2Frest%2Fservices%2FWorld_Street_Map%2FMapServer" rel="nofollow" target="_blank"&gt;http://services.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer&lt;/A&gt;&lt;SPAN&gt;",&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;opacity: "0"&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;})&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 May 2017 11:56:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/clear-a-basemap-from-the-application/m-p/182800#M16981</guid>
      <dc:creator>Sai_AnandPeketi1</dc:creator>
      <dc:date>2017-05-31T11:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: Clear a basemap from the application.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/clear-a-basemap-from-the-application/m-p/1026935#M71777</link>
      <description>&lt;P&gt;Works with minor correction:&lt;/P&gt;&lt;P&gt;layer[i].title&lt;/P&gt;</description>
      <pubDate>Mon, 15 Feb 2021 18:49:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/clear-a-basemap-from-the-application/m-p/1026935#M71777</guid>
      <dc:creator>JerrySimmons_GISP</dc:creator>
      <dc:date>2021-02-15T18:49:11Z</dc:date>
    </item>
  </channel>
</rss>

