<?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: Using arcgis-map-components in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-arcgis-map-components/m-p/1402021#M84153</link>
    <description>&lt;P&gt;Wow!&amp;nbsp; &amp;nbsp; Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/7384"&gt;@ReneRubalcava&lt;/a&gt;&amp;nbsp;I will work with what you sent and let you know how it goes.&amp;nbsp; &amp;nbsp;I appreciate the response and detailed example.&lt;/P&gt;</description>
    <pubDate>Thu, 28 Mar 2024 15:42:58 GMT</pubDate>
    <dc:creator>MeleKoneya1</dc:creator>
    <dc:date>2024-03-28T15:42:58Z</dc:date>
    <item>
      <title>Using arcgis-map-components</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-arcgis-map-components/m-p/1401715#M84144</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Seeing the samples at Dev Summit for ArcGIS Map Components made our web team and developers wonder about migrating existing JavaScript code such as the one used here.&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.scottsdaleaz.gov/solid-waste" target="_blank"&gt;https://www.scottsdaleaz.gov/solid-waste&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I can easily load a web map containing the layers needed, like this&lt;/P&gt;&lt;P&gt;&amp;lt;body&amp;gt;&lt;BR /&gt;&amp;lt;arcgis-map item-id="743a13eed9ee43c5b69ce68414b345ac"&amp;gt;&lt;BR /&gt;&amp;lt;arcgis-expand position="top-left"&amp;gt;&lt;BR /&gt;&amp;lt;arcgis-search&amp;gt;&amp;lt;/arcgis-search&amp;gt;&lt;BR /&gt;&amp;lt;/arcgis-expand&amp;gt;&lt;BR /&gt;&amp;lt;/arcgis-map&amp;gt;&lt;BR /&gt;&amp;lt;/body&amp;gt;&lt;/P&gt;&lt;P&gt;but need to take it a step further and once a search is completed against our parcels, the results for the layers showing service days is displayed.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I include an identity function into this sample?&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-maps-sdk-javascript-samples-beta/blob/main/packages/map-components/templates/amd-script-tag/index.html" target="_blank"&gt;https://github.com/Esri/arcgis-maps-sdk-javascript-samples-beta/blob/main/packages/map-components/templates/amd-script-tag/index.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Mele&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 21:23:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-arcgis-map-components/m-p/1401715#M84144</guid>
      <dc:creator>MeleKoneya1</dc:creator>
      <dc:date>2024-03-27T21:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using arcgis-map-components</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-arcgis-map-components/m-p/1401728#M84146</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/427106"&gt;@MeleKoneya1&lt;/a&gt;&amp;nbsp;you can add IdentityManager the same way you would with a regular ArcGIS Maps SDK app, by importing the IdentityManager and creating your OAuthInfos.&lt;/P&gt;&lt;P&gt;The pattern for this can vary slightly depending on how you build your app.&lt;/P&gt;&lt;P&gt;For that CDN sample, I would do an AMD require or use the $arcgis.import like in this sample&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-maps-sdk-javascript-samples-beta/blob/main/packages/coding-components/templates/amd-script-tag/index.html#L60" target="_blank"&gt;https://github.com/Esri/arcgis-maps-sdk-javascript-samples-beta/blob/main/packages/coding-components/templates/amd-script-tag/index.html#L60&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Note: $arcgis.import is a CDN only helper function you can use to Promisify AMD require calls.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;In order for this to load before the components are loaded, I would do this work in a script tag &lt;EM&gt;after&lt;/EM&gt; loading the maps sdk CDN, but &lt;EM&gt;before&lt;/EM&gt; the arcgis-map-components CDN. I might even place the components CDN as the last tag of the body or add a &lt;A href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#defer" target="_blank" rel="noopener"&gt;defer&lt;/A&gt; attribute.&lt;/P&gt;&lt;P&gt;I haven't tried this in a single page CDN app, but one of these patterns should do the trick, if not, let us know,&lt;/P&gt;&lt;P&gt;In a built app, with vite or maybe another framework, you could run the IdentityManager and OAuthInfo code in an entry point file and before calling the defineCustomElements() method from the arcgis/map-components. A built app is a little easier to control the order of operations then in a CDN app, but it could be done.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 22:15:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-arcgis-map-components/m-p/1401728#M84146</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2024-03-27T22:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: Using arcgis-map-components</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-arcgis-map-components/m-p/1402011#M84152</link>
      <description>&lt;P&gt;I think this will work, you can register the OAuthInfo with the IdentityManager before the components load.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;!doctype html&amp;gt;
&amp;lt;html lang="en" dir="ltr"&amp;gt;

&amp;lt;head&amp;gt;
	&amp;lt;meta charset="utf-8" /&amp;gt;
	&amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" /&amp;gt;
	&amp;lt;title&amp;gt;Map components AMD template&amp;lt;/title&amp;gt;
	&amp;lt;link rel="icon" href="data:;base64,=" /&amp;gt;

	&amp;lt;style&amp;gt;
		html,
		body {
			background-color: var(--calcite-ui-foreground-2);
			padding: 0;
			margin: 0;
			width: 100vw;
			height: 100vh;
		}
	&amp;lt;/style&amp;gt;
	&amp;lt;!-- Load the ArcGIS Maps SDK for JavaScript --&amp;gt;
	&amp;lt;link rel="stylesheet" href="https://js.arcgis.com/4.29/esri/themes/dark/main.css" /&amp;gt;
	&amp;lt;script src="https://js.arcgis.com/4.29/"&amp;gt;&amp;lt;/script&amp;gt;

	&amp;lt;!-- Load the Map Components, but defer loading --&amp;gt;
	&amp;lt;script defer type="module"
		src="https://js.arcgis.com/map-components/4.29/arcgis-map-components.esm.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body&amp;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&amp;gt;
		async function load() {
			const IdentityManager = await $arcgis.import(
				"esri/identity/IdentityManager",
			);
			const OAuthInfo = await $arcgis.import("esri/identity/OAuthInfo");
			// I can register my OAuthInfo here
			console.log(IdentityManager, OAuthInfo);
			// The custom elements are not defined yet
			console.log(customElements.get("arcgis-map"));
		}
		load();
	&amp;lt;/script&amp;gt;
&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 28 Mar 2024 15:34:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-arcgis-map-components/m-p/1402011#M84152</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2024-03-28T15:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: Using arcgis-map-components</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-arcgis-map-components/m-p/1402021#M84153</link>
      <description>&lt;P&gt;Wow!&amp;nbsp; &amp;nbsp; Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/7384"&gt;@ReneRubalcava&lt;/a&gt;&amp;nbsp;I will work with what you sent and let you know how it goes.&amp;nbsp; &amp;nbsp;I appreciate the response and detailed example.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 15:42:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-arcgis-map-components/m-p/1402021#M84153</guid>
      <dc:creator>MeleKoneya1</dc:creator>
      <dc:date>2024-03-28T15:42:58Z</dc:date>
    </item>
  </channel>
</rss>

