Skip to content

Commit

Permalink
chore: doc fix
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickarlt committed Mar 22, 2022
1 parent f8bf1bb commit 2aaeb09
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 4 additions & 1 deletion demos/jsapi-integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ session.getToken("https://www.arcgis.com/sharing/rest").then(() => {

// from jsapi
esriId.getCredential("https://www.arcgis.com/sharing/rest").then((cred) => {
const session = UserSession.fromCredential(cred);
const serverInfo = esriId.findServerInfo(
"https://www.arcgis.com/sharing/rest"
);
const session = UserSession.fromCredential(cred, serverInfo);
});
```

Expand Down
10 changes: 7 additions & 3 deletions demos/jsapi-integration/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
return
}

// once we have the private item, we can create a map
// once we have the item, we can create a map
// NOTE: this is where you would lazy-load the ArcGIS API for JavaScript
require([
"esri/identity/IdentityManager",
Expand All @@ -69,6 +69,9 @@
console.debug('Web map:', webMapItem);

// create a map with the item
// the JS API will automatically discover all portals and severs associated with the webmap.
// this most likly will include https://arcgis.com/sharing/rest/ which is the ArGIS Online portal
// due to the map has a basemap.
var webmap = new WebMap({
portalItem: {
id: webMapItem.id
Expand All @@ -81,9 +84,10 @@
container: "viewDiv"
});

// Once the web map loads the JS API should be "aware" of the ArcGIS.com portal.
// Once the web map loads the JS API should be "aware" of the ArcGIS.com portal at https://arcgis.com/sharing/rest/.
// Using the findCredential and findServerInfo methods we can create an ArcGISIdentityManager
// for use in REST JS from the JS API
// for use in REST JS from the JS API. You could also call `esriId.getCredential("https://arcgis.com/sharing/rest/")`
// to forece this.
webmap.watch("loaded", function (loaded) {
if(loaded) {
const credential = esriId.findCredential("https://arcgis.com/sharing/rest/");
Expand Down

0 comments on commit 2aaeb09

Please sign in to comment.