<?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 BaseMapGallery missing features and suggestions in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemapgallery-missing-features-and-suggestions/m-p/308017#M28260</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I like the BaseMapGallery widget, even when I don't need the ArcGIS online maps and thumbnails, simply because it toggles the relevant layers for me and allows me to add "overlay" layers in a basemap easily.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example: &lt;/SPAN&gt;&lt;A href="http://jsfiddle.net/uYLu3/" rel="nofollow noopener noreferrer" target="_blank"&gt;http://jsfiddle.net/uYLu3/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I've run across and can't find any solutions for, is that I can't specify the BasemapLayer "id" &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;or&lt;/SPAN&gt;&lt;SPAN&gt; change a specific BasemapLayer's visibility. For example, I can't toggle the overlay layer off or on.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've hacked up a solution here: &lt;/SPAN&gt;&lt;A href="http://jsfiddle.net/qfH3W/1/" rel="nofollow noopener noreferrer" target="_blank"&gt;http://jsfiddle.net/qfH3W/1/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;relevant code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var layer = bmg.get("baseCanvas").getLayers()[0];
layer.visibility = !layer.visibility;
bmg.select("baseCanvas");&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In that I had to put in the known array index because I don't know the layer id at run-time. The other trick for this would be to search for a string in the layer URL maybe. I also had to re-select the Basemap to get it to update the change in visibility.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 14:44:27 GMT</pubDate>
    <dc:creator>MattLane</dc:creator>
    <dc:date>2021-12-11T14:44:27Z</dc:date>
    <item>
      <title>BaseMapGallery missing features and suggestions</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemapgallery-missing-features-and-suggestions/m-p/308017#M28260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I like the BaseMapGallery widget, even when I don't need the ArcGIS online maps and thumbnails, simply because it toggles the relevant layers for me and allows me to add "overlay" layers in a basemap easily.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example: &lt;/SPAN&gt;&lt;A href="http://jsfiddle.net/uYLu3/" rel="nofollow noopener noreferrer" target="_blank"&gt;http://jsfiddle.net/uYLu3/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I've run across and can't find any solutions for, is that I can't specify the BasemapLayer "id" &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;or&lt;/SPAN&gt;&lt;SPAN&gt; change a specific BasemapLayer's visibility. For example, I can't toggle the overlay layer off or on.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've hacked up a solution here: &lt;/SPAN&gt;&lt;A href="http://jsfiddle.net/qfH3W/1/" rel="nofollow noopener noreferrer" target="_blank"&gt;http://jsfiddle.net/qfH3W/1/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;relevant code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var layer = bmg.get("baseCanvas").getLayers()[0];
layer.visibility = !layer.visibility;
bmg.select("baseCanvas");&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In that I had to put in the known array index because I don't know the layer id at run-time. The other trick for this would be to search for a string in the layer URL maybe. I also had to re-select the Basemap to get it to update the change in visibility.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:44:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemapgallery-missing-features-and-suggestions/m-p/308017#M28260</guid>
      <dc:creator>MattLane</dc:creator>
      <dc:date>2021-12-11T14:44:27Z</dc:date>
    </item>
  </channel>
</rss>

