<?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: ArcGIS JS API Map-Componets: Load-Portal-Item not using correct PortalUrl or ProxyUrl in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-js-api-map-componets-load-portal-item-not/m-p/1689638#M88275</link>
    <description>&lt;P&gt;This will depend on how you are building your app.&lt;/P&gt;&lt;P&gt;They key is to set this up before the map-components load or added to the DOM. One good way is to set them on the global esriConfig object.&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/odoe/pen/LYaveKr" target="_blank"&gt;https://codepen.io/odoe/pen/LYaveKr&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;head&amp;gt;
	&amp;lt;script&amp;gt;
		// use the global esriConfig variable to initialize properties
		var esriConfig = {
			// No map will load with fake portal
			portalUrl: "https://myHostName.esri.com/arcgis"
		};
	&amp;lt;/script&amp;gt;
	&amp;lt;script type="module" src="https://js.arcgis.com/5.0/"&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 slot="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 slot="bottom-left"&amp;gt;&amp;lt;/arcgis-legend&amp;gt;
	&amp;lt;/arcgis-map&amp;gt;
&amp;lt;/body&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can also use a script tag in the &amp;lt;head&amp;gt; to set this up. Then you can write your app code in a script tag in the last element of the body.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/programming-patterns/#set-the-portalurl-in-a-cdn-application" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/programming-patterns/#set-the-portalurl-in-a-cdn-application&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Another way is to create the WebMap yourself and assign it to the map component.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/programming-patterns/#using-webmap-or-webscene" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/programming-patterns/#using-webmap-or-webscene&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/programming-patterns/#set-the-portalurl-in-an-esm-application" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/programming-patterns/#set-the-portalurl-in-an-esm-application&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Mar 2026 13:22:08 GMT</pubDate>
    <dc:creator>ReneRubalcava</dc:creator>
    <dc:date>2026-03-10T13:22:08Z</dc:date>
    <item>
      <title>ArcGIS JS API Map-Componets: Load-Portal-Item not using correct PortalUrl or ProxyUrl</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-js-api-map-componets-load-portal-item-not/m-p/1689444#M88270</link>
      <description>&lt;OL class=""&gt;&lt;LI&gt;&lt;STRONG&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;error&lt;/SPAN&gt;&lt;SPAN class=""&gt;: &lt;/SPAN&gt;&lt;SPAN class=""&gt;o&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/LI&gt;&lt;OL class=""&gt;&lt;LI&gt;&lt;STRONG&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;details&lt;/SPAN&gt;&lt;SPAN class=""&gt;: &lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;{&lt;SPAN class=""&gt;url&lt;/SPAN&gt;:&amp;nbsp;&lt;SPAN class=""&gt;'&lt;A href="https://www.arcgis.com/sharing/rest/content/items/My_Portal_Url" target="_blank" rel="noopener"&gt;https://www.arcgis.com/sharing/rest/content/items/My_Portal_Url&lt;/A&gt;}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/OL&gt;&lt;P&gt;I am getting this error when trying to convert to Arcgis/Map-Components. I set the PortalURL and ProxyURL in NgOnInit()&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also have a boolean on the map to wait to render until the config is set.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;esriConfig&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;request&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;proxyRules&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; [&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;urlPrefix&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;myPortalUrl&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;proxyUrl&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;myProxyUrl&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ];&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;But the request from the {arcgis-map} is still trying to find the portalUrl through arcgis. I did try setting the portalUrl in the {arcgis-map&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;portal-url&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;"myUrl" item-id="&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;My_Portal_Url"}. Neither of these seem to work.&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Any help with this would be great.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2026 17:10:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-js-api-map-componets-load-portal-item-not/m-p/1689444#M88270</guid>
      <dc:creator>ColbyMorris</dc:creator>
      <dc:date>2026-03-09T17:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS JS API Map-Componets: Load-Portal-Item not using correct PortalUrl or ProxyUrl</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-js-api-map-componets-load-portal-item-not/m-p/1689638#M88275</link>
      <description>&lt;P&gt;This will depend on how you are building your app.&lt;/P&gt;&lt;P&gt;They key is to set this up before the map-components load or added to the DOM. One good way is to set them on the global esriConfig object.&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/odoe/pen/LYaveKr" target="_blank"&gt;https://codepen.io/odoe/pen/LYaveKr&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;head&amp;gt;
	&amp;lt;script&amp;gt;
		// use the global esriConfig variable to initialize properties
		var esriConfig = {
			// No map will load with fake portal
			portalUrl: "https://myHostName.esri.com/arcgis"
		};
	&amp;lt;/script&amp;gt;
	&amp;lt;script type="module" src="https://js.arcgis.com/5.0/"&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 slot="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 slot="bottom-left"&amp;gt;&amp;lt;/arcgis-legend&amp;gt;
	&amp;lt;/arcgis-map&amp;gt;
&amp;lt;/body&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can also use a script tag in the &amp;lt;head&amp;gt; to set this up. Then you can write your app code in a script tag in the last element of the body.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/programming-patterns/#set-the-portalurl-in-a-cdn-application" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/programming-patterns/#set-the-portalurl-in-a-cdn-application&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Another way is to create the WebMap yourself and assign it to the map component.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/programming-patterns/#using-webmap-or-webscene" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/programming-patterns/#using-webmap-or-webscene&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/programming-patterns/#set-the-portalurl-in-an-esm-application" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/programming-patterns/#set-the-portalurl-in-an-esm-application&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2026 13:22:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-js-api-map-componets-load-portal-item-not/m-p/1689638#M88275</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2026-03-10T13:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS JS API Map-Componets: Load-Portal-Item not using correct PortalUrl or ProxyUrl</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-js-api-map-componets-load-portal-item-not/m-p/1689657#M88277</link>
      <description>&lt;P data-unlink="true"&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/977389"&gt;@ColbyMorris&lt;/a&gt;&amp;nbsp;- To load a webmap from your portal, you need to set the &lt;A href="https://developers.arcgis.com/javascript/latest/references/core/config/#Config-portalUrl" target="_self"&gt;config.portalUrl&lt;/A&gt;&amp;nbsp;to "https://{yourportal}/portal".&amp;nbsp; Set the config before the API is loaded to make sure some requests are not still made to arcgis.com.&amp;nbsp; For example, with this &lt;A href="https://github.com/Esri/jsapi-resources/tree/main/templates/js-maps-sdk-angular" target="_self"&gt;template&lt;/A&gt; you could place it in the app.config.ts.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;import&lt;/SPAN&gt; &lt;SPAN&gt;esriConfig&lt;/SPAN&gt; &lt;SPAN&gt;from&lt;/SPAN&gt; &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;@arcgis/core/config&lt;/SPAN&gt;&lt;SPAN&gt;";&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;esriConfig&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;portalUrl&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;your_portal_url&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;For the arcgis-map, set the item-id to your portal webmap's&amp;nbsp; item id.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The proxy rules may not be needed.&amp;nbsp; Unless there is something specific to your environment that requires it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2026 14:30:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-js-api-map-componets-load-portal-item-not/m-p/1689657#M88277</guid>
      <dc:creator>TJSimons</dc:creator>
      <dc:date>2026-03-10T14:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS JS API Map-Componets: Load-Portal-Item not using correct PortalUrl or ProxyUrl</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-js-api-map-componets-load-portal-item-not/m-p/1689659#M88279</link>
      <description>&lt;P&gt;Great!&lt;/P&gt;&lt;P&gt;Thank you for the solutions. The app is now up and running with your help.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2026 14:38:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-js-api-map-componets-load-portal-item-not/m-p/1689659#M88279</guid>
      <dc:creator>ColbyMorris</dc:creator>
      <dc:date>2026-03-10T14:38:10Z</dc:date>
    </item>
  </channel>
</rss>

