You can create Basemaps in your ArcGIS Maps SDK for JavaScript applications using a Portal. This sample shows how to add basemaps from a ArcGIS Online group to the BasemapGallery widget. The group used as a PortalBasemapsSource for the BasemapGallery's source property. The group contains basemaps with different projections.
const portal = new Portal();
// source for basemaps from a portal group
// containing basemaps with different projections
const source = new PortalBasemapsSource({
portal,
query: {
id: "bdb9d65e0b5c480c8dcc6916e7f4e099"
}
});
At 4.23, MapView's spatialReference can be changed at runtime by directly setting the MapView's spatialReference or changing the basemap from the BasemapGallery or BasemapToggle widgets.
To disable this option set the MapView.spatialReferenceLocked to true
.