Select to view content in your preferred language

How to persist presentation slides in a WebScene

618
1
Jump to solution
01-09-2023 08:44 AM
Dirk_Vandervoort
Frequent Contributor

Using this sample HERE to understand WebScene Presentation Slides.  In a JSAP application, I want the user to create a slide and persist slide so the user can visit the slide again at a different time. The sample does not persist the Slides.

The code sample states in the inline comments:

                /*****************************************************************
* Add the slide to the slides collection of the scene presentation
* such that if the scene were to published back to the portal, the
* newly created slide would be correctly persisted as part of the
* WebScene                 *****************************************************************/

 

The SDK (HERE) states: "Additionally, slides can be stored as part of the WebScene.presentation."

  1. Republishing the webscene seems pretty heavy handed, and looks like it updates the webscene to a new default view orientation.
  2. I'm still not seeing any documentation about how I can persist the slides in the presentation of the webscene.

I also note that the ArcGIS Online SceneViewer includes Presentations, which allows you to persist Slides, but you have to Save the WebScene. 

Dirk_Vandervoort_0-1673282270239.png

All I want to do is persist the slide in the WebScene from the JSAPI with no other changes to the WebScene.

Oh, and we may want to do this to create thousands of slides for a WebScene (sic).

TIA

1 Solution

Accepted Solutions
ArnoFiva
Esri Contributor

After creating and adding a slide (as shown in the sample you refer) to the web scene object, you need to persist the changes. You can use WebScene.save to overwrite an existing one, or WebScene.saveAs to create a new web scene.

Note that the user needs to be authenticated to update or create a new web scene (portal item). If not already logged in, the API will automatically prompt for a ArcGIS Online username/password as part of invoking save / saveAs.

Hope this helps, please let me know if anything is unclear!

View solution in original post

0 Kudos
1 Reply
ArnoFiva
Esri Contributor

After creating and adding a slide (as shown in the sample you refer) to the web scene object, you need to persist the changes. You can use WebScene.save to overwrite an existing one, or WebScene.saveAs to create a new web scene.

Note that the user needs to be authenticated to update or create a new web scene (portal item). If not already logged in, the API will automatically prompt for a ArcGIS Online username/password as part of invoking save / saveAs.

Hope this helps, please let me know if anything is unclear!

0 Kudos