<?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: Problem Restoring Basemap Hosted on ArcGIS Online with URL Parameter 4.33 in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-restoring-basemap-hosted-on-arcgis-online/m-p/1665896#M87870</link>
    <description>&lt;P&gt;It turns out that I didn't need to set a portal config after all.&amp;nbsp; In my code I have an object of basemaps to choose from and I was pulling in the wrong value from there for the portalID.&amp;nbsp; This is an example of what worked in the end for the Open Street Map basemap:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;const basemap = {portalItem: {id: baseMapLookup[savedBasemap]["portalID"]}} or&lt;/P&gt;&lt;P&gt;const basemap = {portalItem: {id: "c29cfb7875fc4b97b58ba6987c460862"}}&lt;/P&gt;&lt;P&gt;I was accessing my "portalID" property in the wrong way.&lt;/P&gt;&lt;P&gt;Thanks for taking the time to pose some solutions!&amp;nbsp; That got me looking at my code some more and helped me to find my own mistakes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Nov 2025 16:31:56 GMT</pubDate>
    <dc:creator>JasonBartling1</dc:creator>
    <dc:date>2025-11-14T16:31:56Z</dc:date>
    <item>
      <title>Problem Restoring Basemap Hosted on ArcGIS Online with URL Parameter 4.33</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-restoring-basemap-hosted-on-arcgis-online/m-p/1662266#M87816</link>
      <description>&lt;P&gt;I'm working on an application that saves part of the app state with a link and URL parameters like a marker, zoom, and base map that can be shared with others.&amp;nbsp; For certain base maps I can just use code like:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;viewElement.map.basemap = basemapShortName&lt;/LI-CODE&gt;&lt;P&gt;This works fine for Imagery, Imagery Hybrid, Streets, Topographic and others that seem to have the short Name logic baked into the basemap class.&amp;nbsp; Some of the other short names like osm (Open Street Map) seem to reference another base map that is different from the Basemap widget though when it is selected there.&amp;nbsp; For these, I am trying to reference the portal item in ArcGIS Online.&lt;/P&gt;&lt;P&gt;When I reference the item in ArcGIS Online in the javascript for my application, I get errors like the below:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;[esri.Basemap] #load() Failed to load basemap (title: 'Basemap', id: '19a35e6774b-basemap-39')&lt;BR /&gt;Unable to load &lt;A href="http://127.0.0.1:5500/null/data?f=json" target="_blank"&gt;http://127.0.0.1:5500/null/data?f=json&lt;/A&gt; status: 404&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This is the definition I have for the basemap portal item:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; const basemap = {
       portalItem: {
          id: "c29cfb7875fc4b97b58ba6987c460862",
          portal: {
             url: "https://www.arcgis.com"
          }
       }
 };
 viewElement.map.basemap = basemap;&lt;/LI-CODE&gt;&lt;P&gt;Even though I have the URL for arcgis.com, it still seems to try to be loaded from my local machine.&lt;/P&gt;&lt;P&gt;Using the above approach works fine and expected from developer console in the browser.&lt;/P&gt;&lt;P&gt;How do I successfully change to one of these ArcGIS Online base map portal items in my application as it loads to restore one that was previously selected?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Oct 2025 16:25:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-restoring-basemap-hosted-on-arcgis-online/m-p/1662266#M87816</guid>
      <dc:creator>JasonBartling1</dc:creator>
      <dc:date>2025-10-30T16:25:33Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Restoring Basemap Hosted on ArcGIS Online with URL Parameter 4.33</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-restoring-basemap-hosted-on-arcgis-online/m-p/1662273#M87817</link>
      <description>&lt;P&gt;Hi Jason,&amp;nbsp;&lt;/P&gt;&lt;P&gt;What happens if you try using the Basemap Class Constructor instead of autocasting from the object? It definitely seems odd to me that it would make that request to your local machine!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Oct 2025 17:02:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-restoring-basemap-hosted-on-arcgis-online/m-p/1662273#M87817</guid>
      <dc:creator>JonathanDawe_BAS</dc:creator>
      <dc:date>2025-10-30T17:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Restoring Basemap Hosted on ArcGIS Online with URL Parameter 4.33</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-restoring-basemap-hosted-on-arcgis-online/m-p/1662306#M87818</link>
      <description>&lt;P&gt;Unfortunately, the Basemap class constructor throws the same error with this code:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const basemap = new Basemap({
portalItem: {
    id: "c29cfb7875fc4b97b58ba6987c460862",
    portal: {
        url: "https://www.arcgis.com"
    }
}
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Oct 2025 18:07:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-restoring-basemap-hosted-on-arcgis-online/m-p/1662306#M87818</guid>
      <dc:creator>JasonBartling1</dc:creator>
      <dc:date>2025-10-30T18:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Restoring Basemap Hosted on ArcGIS Online with URL Parameter 4.33</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-restoring-basemap-hosted-on-arcgis-online/m-p/1665237#M87848</link>
      <description>&lt;P&gt;Bump.&amp;nbsp; Does anyone from ESRI have a suggestion for how to specify ArcGIS Online as the portal for my custom application besides specifying the url for the portal object when using the Basemap constructor?&amp;nbsp; It looks like the basemap is trying to be accessed from my local machine by the error:&amp;nbsp;&amp;nbsp;Unable to load &lt;A href="http://127.0.0.1:5500/null/data?f=json" target="_blank" rel="nofollow noopener noreferrer"&gt;http://127.0.0.1:5500/null/data?f=json&lt;/A&gt; status: 404 .&lt;/P&gt;</description>
      <pubDate>Wed, 12 Nov 2025 19:27:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-restoring-basemap-hosted-on-arcgis-online/m-p/1665237#M87848</guid>
      <dc:creator>JasonBartling1</dc:creator>
      <dc:date>2025-11-12T19:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Restoring Basemap Hosted on ArcGIS Online with URL Parameter 4.33</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-restoring-basemap-hosted-on-arcgis-online/m-p/1665682#M87861</link>
      <description>&lt;P&gt;Have you tried dropping the&amp;nbsp;&lt;EM&gt;portal&lt;/EM&gt; property altogether? For most AGOL items you can just do something like:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;const basemap = new Basemap({
  portalItem: {
    id: "c29cfb7875fc4b97b58ba6987c460862"
  }
});

view.map.basemap = basemap;&lt;/LI-CODE&gt;&lt;P&gt;I wonder if the portal property is throwing it off somehow.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Nov 2025 21:55:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-restoring-basemap-hosted-on-arcgis-online/m-p/1665682#M87861</guid>
      <dc:creator>N8-CORR</dc:creator>
      <dc:date>2025-11-13T21:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Restoring Basemap Hosted on ArcGIS Online with URL Parameter 4.33</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-restoring-basemap-hosted-on-arcgis-online/m-p/1665690#M87862</link>
      <description>&lt;P&gt;I get the same error when omitting the portal object.&amp;nbsp; I think I tried referencing the basemap without the portal object on my first attempts.&amp;nbsp; After it didn't work, I did some research and thought adding a portal object with the URL might help.&amp;nbsp; It seems like I need to set my portal somewhere else though since it is still trying to load from my local machine.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Nov 2025 22:11:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-restoring-basemap-hosted-on-arcgis-online/m-p/1665690#M87862</guid>
      <dc:creator>JasonBartling1</dc:creator>
      <dc:date>2025-11-13T22:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Restoring Basemap Hosted on ArcGIS Online with URL Parameter 4.33</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-restoring-basemap-hosted-on-arcgis-online/m-p/1665697#M87863</link>
      <description>&lt;P&gt;Interesting. Have you tried setting the &lt;EM&gt;portal&lt;/EM&gt; globally and then just using a &lt;EM&gt;Portaltem&lt;/EM&gt;?&lt;/P&gt;&lt;LI-CODE lang="c"&gt;import esriConfig from "@arcgis/core/config";
import Map from "@arcgis/core/Map";
import MapView from "@arcgis/core/views/MapView";
import Basemap from "@arcgis/core/Basemap";
import PortalItem from "@arcgis/core/portal/PortalItem";

esriConfig.portalUrl = "https://www.arcgis.com";

const map = new Map({
  basemap: "topo-vector"
});

const view = new MapView({
  container: "viewDiv",
  map
});

view.when().then(() =&amp;gt; {
  const params = new URLSearchParams(window.location.search);
  const basemapId = params.get("basemapId"); // throw the basemap id here

  if (basemapId) {
    const bm = new Basemap({
      portalItem: new PortalItem({
        id: basemapId
      })
    });

    view.map.basemap = bm;
  }
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Nov 2025 22:33:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-restoring-basemap-hosted-on-arcgis-online/m-p/1665697#M87863</guid>
      <dc:creator>N8-CORR</dc:creator>
      <dc:date>2025-11-13T22:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Restoring Basemap Hosted on ArcGIS Online with URL Parameter 4.33</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-restoring-basemap-hosted-on-arcgis-online/m-p/1665896#M87870</link>
      <description>&lt;P&gt;It turns out that I didn't need to set a portal config after all.&amp;nbsp; In my code I have an object of basemaps to choose from and I was pulling in the wrong value from there for the portalID.&amp;nbsp; This is an example of what worked in the end for the Open Street Map basemap:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;const basemap = {portalItem: {id: baseMapLookup[savedBasemap]["portalID"]}} or&lt;/P&gt;&lt;P&gt;const basemap = {portalItem: {id: "c29cfb7875fc4b97b58ba6987c460862"}}&lt;/P&gt;&lt;P&gt;I was accessing my "portalID" property in the wrong way.&lt;/P&gt;&lt;P&gt;Thanks for taking the time to pose some solutions!&amp;nbsp; That got me looking at my code some more and helped me to find my own mistakes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Nov 2025 16:31:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-restoring-basemap-hosted-on-arcgis-online/m-p/1665896#M87870</guid>
      <dc:creator>JasonBartling1</dc:creator>
      <dc:date>2025-11-14T16:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Restoring Basemap Hosted on ArcGIS Online with URL Parameter 4.33</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-restoring-basemap-hosted-on-arcgis-online/m-p/1666901#M87896</link>
      <description>&lt;P&gt;Awesome! Glad you were able to get it sorted.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Nov 2025 20:51:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-restoring-basemap-hosted-on-arcgis-online/m-p/1666901#M87896</guid>
      <dc:creator>N8-CORR</dc:creator>
      <dc:date>2025-11-18T20:51:13Z</dc:date>
    </item>
  </channel>
</rss>

