// Default is portal for arcgis.comvar portal = new Portal();
2. Load Portal Resources
// If you define the Portal URL in esriConfig, the// BasemapGallery widget can determine which basemaps// to use.esriConfig.portalUrl = "https://jsapi.maps.arcgis.com";
// Initialize a portal instance and load itvar portal = new Portal();
portal
.load()
.then(function() {
// A portal can be configured to use Vector Basemaps// by default or not.var basemap = portal.useVectorBasemaps ?
portal.defaultVectorBasemap : portal.defaultBasemap;
var map = newMap({
basemap: basemap
});
var view = new MapView({
container: "viewDiv",
map: map,
center: [-118.24, 34.073],
scale: 10000 });
// The BasemapGallery will use the basemaps// configured by the Portal URL defined in esriConfig.portalUrlvar basemapGallery = new BasemapGallery({
view: view
});
var bgExpand = new Expand({
view: view,
content: basemapGallery
});
view.ui.add(bgExpand, "top-right");
})
.catch(function(error) {
console.warn(error);
});
});
This allows you to use your organization settings to create consistent applications across your organization.