You can create Basemaps in your ArcGIS Maps SDK for JavaScript applications using a Portal. This sample shows how to add basemaps from an ArcGIS Online group to the Basemap Gallery component. The group is used as a PortalBasemapsSource for the Basemap Gallery's source property. The group contains basemaps with different projections.
// get the basemap gallery element
const basemapGallery = document.querySelector("arcgis-basemap-gallery");
// create a portal instance
const portal = new Portal();
// source for basemaps from a portal group
// containing basemaps with different projections
const source = new PortalBasemapsSource({
portal,
query: {
id: "bdb9d65e0b5c480c8dcc6916e7f4e099"
}
});
basemapGallery.source = source;
At 4.23, MapView's spatialReference can be changed at runtime by directly setting the MapView's spatialReference or changing the basemap from the Basemap Gallery or Basemap Toggle components.
To disable this option, set the MapView.spatialReferenceLocked to true
.