<?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: basemap-change event not called in 3.20 in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemap-change-event-not-called-in-3-20/m-p/693964#M64525</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So it appears that the BasemapGallery does not actually change the map's official "basemap". It removes the current basemap layer, but then just adds the new tiled layer to the map without updating the map's "basemap" (e.g., by using map.setBasemap()). In a way that makes sense in that you can add non-standard layers to the BasemapGallery, and those layers would not be one of the options available for the map.setBasemap method argument.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can instead use the BasemapGallery's selection-change event to track the change to its basemap layer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would be helpful if the documentation in both the BasemapGallery and the map's relevant events/methods (basemap-change, getBasemap, setBasemap) noted that they are not talking about the same "basemap".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Apr 2017 17:14:24 GMT</pubDate>
    <dc:creator>BryanBaker</dc:creator>
    <dc:date>2017-04-17T17:14:24Z</dc:date>
    <item>
      <title>basemap-change event not called in 3.20</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemap-change-event-not-called-in-3-20/m-p/693963#M64524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The basemap-changed event does not appear to fire correctly in the 3.20 version of the API. It doesn't work in my app, nor in the simple basemap gallery sample in the sandbox. I called up the sample at&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/3/sandbox/sandbox.html?sample=widget_basemap" rel="nofollow noopener noreferrer" target="_blank"&gt;https://developers.arcgis.com/javascript/3/sandbox/sandbox.html?sample=widget_basemap&lt;/A&gt;, and then inserted a handler for the event just before the close of the script:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; map.on("basemap-change", function(e){
&amp;nbsp;&amp;nbsp; console.log(e.current);
 });&lt;/PRE&gt;&lt;P&gt;Nothing gets logged when the basemap changes. Is there some other way to get this to work? Or is it not really called when the basemap layer changes?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:48:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemap-change-event-not-called-in-3-20/m-p/693963#M64524</guid>
      <dc:creator>BryanBaker</dc:creator>
      <dc:date>2021-12-12T16:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: basemap-change event not called in 3.20</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemap-change-event-not-called-in-3-20/m-p/693964#M64525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So it appears that the BasemapGallery does not actually change the map's official "basemap". It removes the current basemap layer, but then just adds the new tiled layer to the map without updating the map's "basemap" (e.g., by using map.setBasemap()). In a way that makes sense in that you can add non-standard layers to the BasemapGallery, and those layers would not be one of the options available for the map.setBasemap method argument.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can instead use the BasemapGallery's selection-change event to track the change to its basemap layer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would be helpful if the documentation in both the BasemapGallery and the map's relevant events/methods (basemap-change, getBasemap, setBasemap) noted that they are not talking about the same "basemap".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Apr 2017 17:14:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemap-change-event-not-called-in-3-20/m-p/693964#M64525</guid>
      <dc:creator>BryanBaker</dc:creator>
      <dc:date>2017-04-17T17:14:24Z</dc:date>
    </item>
  </channel>
</rss>

