Skip to content

Instantly share code, notes, and snippets.

@geog4046instructor
Last active January 1, 2018 22:17
Show Gist options
  • Save geog4046instructor/763c027dcb2003bc7117ca4561c7959a to your computer and use it in GitHub Desktop.
Save geog4046instructor/763c027dcb2003bc7117ca4561c7959a to your computer and use it in GitHub Desktop.
ArcGIS - Load a 3D scene from ArcGIS Online
/*
* This example loads a 3D globe with basemap and layers published to ArcGIS Online. To use another scene with this code,
* change the id of the portalItem. The "container" value should match the id of the map div specified in the HTML.
*/
require([
"esri/views/SceneView",
"esri/WebScene",
"dojo/domReady!"
],
function(
SceneView, WebScene
) {
let scene = new WebScene({
portalItem: {
id: "SCENE_ID_GOES_HERE" // change this to the id (the long sequence of characters in the URL of an ArcGIS web scene)
}
});
let globe = new SceneView({
map: scene,
container: "arcgis-map" // this value should match the id of the map div
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment