<?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 combine the new component Widgets to the classic Widget initialisation? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-combine-the-new-component-widgets-to-the/m-p/1606016#M86943</link>
    <description>&lt;P&gt;Thank you&amp;nbsp; &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/413145" target="_self"&gt;Edvinas_S&lt;/A&gt;, but I am still a little in 'the dark'. I don't use esriConfig, I request a token from REST API. With that token, I use these Javascript functions:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;esriId.registerToken({
server: 'https://www.arcgis.com/sharing/rest',
  token: &amp;lt;TOKEN_FROM_REST_API&amp;gt;
});
esriId.getCredential("https://www.arcgis.com/sharing");
  esriId.checkSignInStatus('https://www.arcgis.com/sharing').then(function(responseSignInStatus) {
      displayMap();
  }).catch(function(error) {
      alert("Register error message: ", error);
  });&lt;/LI-CODE&gt;&lt;P&gt;displayMap is my custom function to display the map and add all Widgets. I need to do this because without this registration, the map won't show because it is private.&lt;/P&gt;&lt;P&gt;&amp;nbsp;My question: what and how should I store in the&amp;nbsp;globalThis.esriConfig using a REST generated token?&lt;/P&gt;&lt;P&gt;Your help is appreciated.&lt;/P&gt;</description>
    <pubDate>Tue, 15 Apr 2025 14:20:11 GMT</pubDate>
    <dc:creator>Wimvan_Dijk</dc:creator>
    <dc:date>2025-04-15T14:20:11Z</dc:date>
    <item>
      <title>How to combine the new component Widgets to the classic Widget initialisation?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-combine-the-new-component-widgets-to-the/m-p/1605678#M86923</link>
      <description>&lt;P class=""&gt;ArcGIS JS API 4.32 uses the &amp;lt;arcgis-map&amp;gt;&amp;nbsp;HTML style with Web Component for the&amp;nbsp;esri/widgets/BasemapGallery component. I have hundreds of pages with the classic way to setup a mapView with the classic way to initialise widgets to the webView. How can I replace the classic Widget initialisation for the new Web Component in my existing projects?&lt;/P&gt;&lt;P class=""&gt;This is the way I initialised all my projects:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;webMap = new WebMap({
    portalItem: {
        id: &amp;lt;mymapid&amp;gt;,
        portal: &amp;lt;myarcgisportal&amp;gt;
    }
});
view = new MapView({
    container: "mapDiv",
    map: webMap,
});

var basemapGallery;
var basemapele = document.createElement('div');
basemapele.setAttribute('data-toggle', 'Tooltip');
basemapele.setAttribute('title', 'Basis kaarten');
basemapele.className = "esri-icon-basemap esri-widget--button esri-widget esri-interactive home";
basemapele.addEventListener('click', function(evt){
if (basemapGallery) {
    basemapGallery.destroy();
    basemapGallery = null;
}
else {
    basemapGallery = new BasemapGallery({
        view: view
    });
    view.ui.add(basemapGallery,"top-right");
}
})
view.ui.add(basemapele, "top-left");
    &lt;/LI-CODE&gt;&lt;P&gt;I have the token mechanism in Javascript, to be able to work with private maps, so if you have a solution to work 'the other way around", meaning I change my HTML to the new style:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;&amp;lt;arcgis-map item-id="123456789123456789" id="mapDiv"&amp;gt;
    &amp;lt;arcgis-basemap-gallery&amp;gt;&amp;lt;/arcgis-basemap-gallery&amp;gt;
&amp;lt;/arcgis-map&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I apply the Token to this setup, so I can work with private maps? In the classic way I assign the token with:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;esriId.registerToken({
    server: &amp;lt;argisserver&amp;gt;,
    token: &amp;lt;mytoken&amp;gt;
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It didn't find esriId in the 4.32 documentation, and I have no clue how to combine the new and old initialisations. Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 14 Apr 2025 14:38:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-combine-the-new-component-widgets-to-the/m-p/1605678#M86923</guid>
      <dc:creator>Wimvan_Dijk</dc:creator>
      <dc:date>2025-04-14T14:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine the new component Widgets to the classic Widget initialisation?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-combine-the-new-component-widgets-to-the/m-p/1605697#M86926</link>
      <description>&lt;P&gt;When using the NPM package to build your apps, you can set up your authentication or api keys before importing the components. Sorry for images, but I have these on hand from presentations.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ReneRubalcava_0-1744647359299.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/130163i06D7278D953B33BA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ReneRubalcava_0-1744647359299.png" alt="ReneRubalcava_0-1744647359299.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ReneRubalcava_1-1744647372733.jpg" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/130164i36738B33833E924D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ReneRubalcava_1-1744647372733.jpg" alt="ReneRubalcava_1-1744647372733.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If using the CDN, you can do a couple of things. For API keys, use the global esriConfig before the script tags for core js and components.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ReneRubalcava_2-1744647432926.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/130165iF81229F45FE16907/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ReneRubalcava_2-1744647432926.png" alt="ReneRubalcava_2-1744647432926.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or similar to how you would do it in NPM, do your work first and then import the components.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ReneRubalcava_3-1744647472609.jpg" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/130166iA8A77F40E8D2A086/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ReneRubalcava_3-1744647472609.jpg" alt="ReneRubalcava_3-1744647472609.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Apr 2025 16:19:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-combine-the-new-component-widgets-to-the/m-p/1605697#M86926</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2025-04-14T16:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine the new component Widgets to the classic Widget initialisation?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-combine-the-new-component-widgets-to-the/m-p/1605783#M86930</link>
      <description>&lt;P&gt;The object referred to as "esriId" is the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html" target="_self"&gt;esri/identity/IdentityManager&lt;/A&gt; module.&amp;nbsp; A shortcut to the documentation of the registerToken method is &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#registerToken" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Apr 2025 19:31:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-combine-the-new-component-widgets-to-the/m-p/1605783#M86930</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2025-04-14T19:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine the new component Widgets to the classic Widget initialisation?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-combine-the-new-component-widgets-to-the/m-p/1605906#M86934</link>
      <description>&lt;P&gt;Thank you Rene for your reply. Appreciated! We are not using &lt;SPAN&gt;the NPM package, but standard plain Javascript initialisation like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;&amp;lt;link rel="stylesheet" href="/arcgis_js/javascript/4.32/esri/themes/light/main.css"&amp;gt;
&amp;lt;script src="/arcgis_js/javascript/4.33/init.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;(ArcGIS javascript API on our server).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;What is the sequence of commands I have to use, standard Javascript, to be able to display a private map into this structure:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;&amp;lt;arcgis-map item-id="123456789123456789" id="mapDiv"&amp;gt;
    &amp;lt;arcgis-basemap-gallery&amp;gt;&amp;lt;/arcgis-basemap-gallery&amp;gt;
&amp;lt;/arcgis-map&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Apr 2025 07:34:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-combine-the-new-component-widgets-to-the/m-p/1605906#M86934</guid>
      <dc:creator>Wimvan_Dijk</dc:creator>
      <dc:date>2025-04-15T07:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine the new component Widgets to the classic Widget initialisation?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-combine-the-new-component-widgets-to-the/m-p/1605907#M86935</link>
      <description>&lt;P&gt;Thank you Joel, the variable is still accessible. I can register but I can't get a private map loaded into this element:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;&amp;lt;arcgis-map item-id="123456789123456789" id="mapDiv"&amp;gt;
    &amp;lt;arcgis-basemap-gallery&amp;gt;&amp;lt;/arcgis-basemap-gallery&amp;gt;
&amp;lt;/arcgis-map&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;With AI the suggestion is to initialise a webMap and a view and replace that in the &amp;lt;arcgis-map&amp;gt; element. That works but then the &amp;lt;arcgis-basemap-gallery&amp;gt; is gone. Most likely that won't work...&lt;/P&gt;</description>
      <pubDate>Tue, 15 Apr 2025 07:42:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-combine-the-new-component-widgets-to-the/m-p/1605907#M86935</guid>
      <dc:creator>Wimvan_Dijk</dc:creator>
      <dc:date>2025-04-15T07:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine the new component Widgets to the classic Widget initialisation?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-combine-the-new-component-widgets-to-the/m-p/1605926#M86938</link>
      <description>&lt;P&gt;Thank you for the comment &lt;SPAN&gt;Edvinas_S&lt;/SPAN&gt;. You are right about the object, but that is not the only initialisation needed. We do not work with Node.js so this statement will not work with just basic Javascript&lt;/P&gt;&lt;P&gt;await import("@arcgis/map-components/dist/components/arcgis-map");&lt;/P&gt;&lt;P&gt;How do I solve this without Node.js?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Apr 2025 08:50:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-combine-the-new-component-widgets-to-the/m-p/1605926#M86938</guid>
      <dc:creator>Wimvan_Dijk</dc:creator>
      <dc:date>2025-04-15T08:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine the new component Widgets to the classic Widget initialisation?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-combine-the-new-component-widgets-to-the/m-p/1605932#M86939</link>
      <description>&lt;P&gt;I think you misread what Rene said. The first part of his comment is for node. You don't need to do that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you create the esriConfig &lt;STRONG&gt;before&lt;/STRONG&gt; importing calcite components and esri js api, it works in plain js. You don't need to do any other imports and awaits. Just add this object to globalThis:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;!-- New code --&amp;gt;
&amp;lt;script&amp;gt; 
  globalThis.esriConfig = {
    portalUrl: "https://my.portal.com/portal",
    apiKey: "API_KEY"
  }
&amp;lt;/script&amp;gt;


&amp;lt;!-- Your imports --&amp;gt;
&amp;lt;script type="module" src="https://js.arcgis.com/calcite-components/3.0.3/calcite.esm.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;link rel="stylesheet" href="https://js.arcgis.com/4.32/esri/themes/light/main.css" /&amp;gt;
&amp;lt;script src="https://js.arcgis.com/4.32/"&amp;gt;&amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Apr 2025 10:40:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-combine-the-new-component-widgets-to-the/m-p/1605932#M86939</guid>
      <dc:creator>Edvinas_S</dc:creator>
      <dc:date>2025-04-15T10:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine the new component Widgets to the classic Widget initialisation?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-combine-the-new-component-widgets-to-the/m-p/1605940#M86940</link>
      <description>&lt;P&gt;Exactly. Here's a demo for identity manager and loading components after setting up auth.&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/odoe/pen/mdgjKZR" target="_blank"&gt;https://codepen.io/odoe/pen/mdgjKZR&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Apr 2025 11:32:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-combine-the-new-component-widgets-to-the/m-p/1605940#M86940</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2025-04-15T11:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine the new component Widgets to the classic Widget initialisation?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-combine-the-new-component-widgets-to-the/m-p/1606016#M86943</link>
      <description>&lt;P&gt;Thank you&amp;nbsp; &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/413145" target="_self"&gt;Edvinas_S&lt;/A&gt;, but I am still a little in 'the dark'. I don't use esriConfig, I request a token from REST API. With that token, I use these Javascript functions:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;esriId.registerToken({
server: 'https://www.arcgis.com/sharing/rest',
  token: &amp;lt;TOKEN_FROM_REST_API&amp;gt;
});
esriId.getCredential("https://www.arcgis.com/sharing");
  esriId.checkSignInStatus('https://www.arcgis.com/sharing').then(function(responseSignInStatus) {
      displayMap();
  }).catch(function(error) {
      alert("Register error message: ", error);
  });&lt;/LI-CODE&gt;&lt;P&gt;displayMap is my custom function to display the map and add all Widgets. I need to do this because without this registration, the map won't show because it is private.&lt;/P&gt;&lt;P&gt;&amp;nbsp;My question: what and how should I store in the&amp;nbsp;globalThis.esriConfig using a REST generated token?&lt;/P&gt;&lt;P&gt;Your help is appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Apr 2025 14:20:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-combine-the-new-component-widgets-to-the/m-p/1606016#M86943</guid>
      <dc:creator>Wimvan_Dijk</dc:creator>
      <dc:date>2025-04-15T14:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine the new component Widgets to the classic Widget initialisation?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-combine-the-new-component-widgets-to-the/m-p/1606093#M86945</link>
      <description>&lt;P&gt;See&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-combine-the-new-component-widgets-to-the/m-p/1605940/highlight/true#M86940" target="_blank" rel="noopener"&gt;https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-combine-the-new-component-widgets-to-the/m-p/1605940/highlight/true#M86940&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;arcgis-map item-id="d5dda743788a4b0688fe48f43ae7beb9"&amp;gt;
	&amp;lt;arcgis-expand position="top-right"&amp;gt;
		&amp;lt;arcgis-search&amp;gt;&amp;lt;/arcgis-search&amp;gt;
	&amp;lt;/arcgis-expand&amp;gt;
	&amp;lt;arcgis-legend position="bottom-left"&amp;gt;&amp;lt;/arcgis-legend&amp;gt;
&amp;lt;/arcgis-map&amp;gt;
&amp;lt;script type="module"&amp;gt;
	const esriId = await $arcgis.import("@arcgis/core/identity/IdentityManager.js");
	const OAuthInfo = await $arcgis.import("@arcgis/core/identity/OAuthInfo.js");
	console.log(!!customElements.get("arcgis-map"));
	esriId.registerToken({
		server: 'https://www.arcgis.com/sharing/rest',
		token: "YOUR_TOKEN_HERE"
	});
	esriId.getCredential("https://www.arcgis.com/sharing");
	esriId.checkSignInStatus('https://www.arcgis.com/sharing').then(async (responseSignInStatus) =&amp;gt; {
		await import("https://js.arcgis.com/map-components/4.32/arcgis-map-components.esm.js");
		console.log(!!customElements.get("arcgis-map"));
	}).catch(function (error) {
		alert("Register error message: ", error);
	});
&amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 15 Apr 2025 16:00:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-combine-the-new-component-widgets-to-the/m-p/1606093#M86945</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2025-04-15T16:00:52Z</dc:date>
    </item>
  </channel>
</rss>

