Select to view content in your preferred language

Trying to find basemap identifiers that correspond to Basemap Gallery options

1046
3
07-16-2021 09:15 AM
jbarrmetro
Emerging Contributor

Hello,

I am building an application that persists certain user preferences in Local Storage between uses so they don't have to reset everything each time they login. I'm using a Basemap Gallery widget, and one of the things I'd like to persist is the user's selection.

I've registered a click event handler on the Gallery's container, and in the handler I'm getting the basemap title as that seems like the simplest way to identify which map has been selected (it's extremely unfortunate that the basemap identifier is not available, but so it goes).

I have a dictionary mapping the titles for the available basemaps to the identifiers, which I found here. I was able to find identifiers for all basemap titles except these:

  • Human Geography Map
  • Human Geography Dark Map
  • Outline Map
  • USGS National Map
  • USA Topo Maps
  • OpenStreetMap (Blueprint)

Additionally, I found the identifier "hybrid," which seems likely to me that it's one of these two:

  • Firefly Imagery Hybrid
  • NAIP Imagery Hybrid

so I also need an identifier for at least one of those.

Any help with filling in the blanks on these missing identifiers would be greatly appreciated.

0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus

@jbarrmetro It is not uncommon for basemaps to not have a well know id/name.

For those basemaps that do not have a well know id you use a PortalItem to set the basemap.

let basemap = new Basemap({
  portalItem: {
    id: "9e557abc61ce41c9b8ec8b15800c20d3"  // Firefly Imagery Hybrid
  }
});

To determine the portal item ids look at the basemaps portalItem property and then the id property.

0 Kudos
RudyProsser
Esri Contributor

@jbarrmetro 

You can find the ArcGIS Online basemap collection by signing in to ArcGIS Online. Click on Content and select Living Atlas (it should be just under your login). In the filters down the left side, select Basemaps. In the Search Living Atlas enter owner=Esri. That should limit the search to 81 basemaps. Adding AND 'Human Geography' returned four candidates for you to review. Replacing 'Human Geography' with the titles to your other basemaps should provide you with want you want. You'll find the URLs to each on the details page.

owner:Esri AND 'Human Geography'

-Rudy

0 Kudos
jbarrmetro
Emerging Contributor

Thanks to both of you for your helpful suggestions! I've actually been told to restrict sources for the gallery to basemaps available through our enterprise portal, so the problem resolved itself for me, but these answers may be helpful for me in my own projects.

Thanks again,

Jason

0 Kudos