ESM: import Slide from "@arcgis/core/webscene/Slide.js";
CDN: const Slide = await $arcgis.import("@arcgis/core/webscene/Slide.js");
Class: @arcgis/core/webscene/Slide
Since: ArcGIS Maps SDK for JavaScript 4.0
Example
// Create a slide from a view and apply it at a later time
Slide.createFrom(view).then(function(slide) {
// Add slide to the scene presentation
scene.presentation.slides.add(slide);
});
// At a later time
let firstSlide = scene.presentation.slides.at(0);
firstSlide.applyTo(view).then(function() {
// Slide has been successfully applied to the view
});
Constructors
new Slide(properties)
Create a new slide instance. Usually Slide.createFrom is used instead to create a new slide which stores a snapshot of the view.
Parameter
optionalSee the properties for a list of all the properties that may be passed into the constructor.
Show inherited properties Hide inherited properties
Property DetailsThe basemap of the scene. Only the base and reference layers of the basemap are stored in a slide.
This value can be an instance of Basemap or a value listed in these basemap id tables.
Inherited
Property declaredClass Stringreadonly
Since: ArcGIS Maps SDK for JavaScript 4.7 Accessor since 4.0, declaredClass added at 4.7.
The name of the class. The declared class name is formatted as esri.folder.className
.
The description of the slide.
Since: ArcGIS Maps SDK for JavaScript 4.32 Slide since 4.0, elements added at 4.32.
The elements object contains configurations for components set in a slide.
The enabled focus areas of the scene.
This is a collection of strings, storing references (by ID) to the focus areas that are enabled when the slide is applied to a SceneView.
Example
// Update the slide to only enable the first focus area in the map.
slide.enabledFocusAreas = [ view.map.focusAreas.areas.at(0).id ];
Represents settings that affect the environment in which the WebScene is displayed (such as lighting).
Ground properties for this slide.
Since: ArcGIS Maps SDK for JavaScript 4.28 Slide since 4.0, hidden added at 4.28.
The visibility of a slide in a presentation. A hidden slide should not show up when an application goes into presentation mode.
Since: ArcGIS Maps SDK for JavaScript 4.31 Slide since 4.0, layout added at 4.31.
Layout of the slide.
Possible Values:"caption" |"cover" |"none"
A data URI encoded thumbnail.
The URI pointing to the thumbnail image representing the slide.
Since: ArcGIS Maps SDK for JavaScript 4.30 Slide since 4.0, timeExtent added at 4.30.
The time extent of the scene.
The viewpoint of the slide. This acts like a bookmark, saving a predefined location or point of view from which to view the scene.
The visible layers of the scene.
This is a collection of objects that stores references (by ID) to the scene layers and ground layers that are set as visible
when a slide is applied to a SceneView.
When assigning visible layers, the following types of values will be automatically casted:
[layerInstance, layerInstance]
["layer-1", "layer-2"]
The specification for each object in the collection is outlined in the table below.
Example
// Update the visible layers to the second layer in the scene, and the
// first elevation layer in the ground.
slide.visibleLayers = [
{ id: scene.layers.at(1).id }
{ id: scene.ground.layers.at(0).id }
];
// Equivalent using convenience autocasting
slide.visibleLayers = [scene.layers.at(0), scene.ground.layers.at(0)];
Show inherited methods Hide inherited methods
Method DetailsInherited
Method addHandles(handleOrHandles, groupKey)
Since: ArcGIS Maps SDK for JavaScript 4.25 Accessor since 4.0, addHandles added at 4.25.
Adds one or more handles which are to be tied to the lifecycle of the object. The handles will be removed when the object is destroyed.
// Manually manage handles
const handle = reactiveUtils.when(
() => !view.updating,
() => {
wkidSelect.disabled = false;
},
{ once: true }
);
this.addHandles(handle);
// Destroy the object
this.destroy();
Parameters
Handles marked for removal once the object is destroyed.
groupKey *
optionalKey identifying the group to which the handles should be added. All the handles in the group can later be removed with Accessor.removeHandles(). If no key is provided the handles are added to a default group.
applyTo(view, options){Promise<Slide>}
Applies a slide's settings to a SceneView.
Parameters
Specification
The SceneView the slide should be applied to.
optionalAnimation options. See properties below for object specifications.
Specification
optionalDefault Value: true
Indicates whether to animate the slide transition.
optionalDefault Value: 1
Increases or decreases the animation speed by the specified factor. A speedFactor of 2 will make the animation twice as fast, while a speedFactor of 0.5 will make the animation half as fast. Setting the speed factor will automatically adapt the default maxDuration accordingly.
optionalSet the exact duration (in milliseconds) of the animation. Note that by default, animation duration is calculated based on the time required to reach the target at a constant speed. Setting duration overrides the speedFactor option. Note that the resulting duration is still limited to the maxDuration.
optionalDefault Value: 8000
The maximum allowed duration (in milliseconds) of the animation. The default maxDuration value takes the specified speedFactor into account.
optionalThe easing function to use for the animation. This may either be a preset (named) function, or a user specified function. Supported named presets are: linear
, cubic-in
, cubic-out
, cubic-in-out
, expo-in
, expo-out
, expo-in-out
, quad-in-out-coast
, ease-in
, ease-out
, ease-in-out
, as well as in-cubic
, out-cubic
, in-out-cubic
, in-expo
, out-expo
, in-out-expo
, and in-out-coast-quad
. See easing functions and CSS easing functions for graphical representations of these functions.
By default, animations that are less than 1000 ms use the expo-out
easing function; longer animations use the quad-in-out-coast
easing function.
The following prenamed easing functions have been deprecated since version 4.33: in-cubic
, out-cubic
, in-out-cubic
, in-expo
, out-expo
, in-out-expo
, and in-out-coast-quad
. Please use cubic-in
, cubic-out
, cubic-in-out
, expo-in
, expo-out
, expo-in-out
, and quad-in-out-coast
instead.
Possible Values:"linear"|"cubic-in"|"cubic-out"|"cubic-in-out"|"expo-in"|"expo-out"|"expo-in-out"|"quad-in-out-coast"|"in-cubic"|"out-cubic"|"in-out-cubic"|"in-expo"|"out-expo"|"in-out-expo"|"in-out-coast-quad"|"ease"|"ease-in"|"ease-out"|"ease-in-out"
optionalSignal object that can be used to abort the asynchronous task. Aborting will cause the slide animation to stop. The returned promise will be rejected with an Error named AbortError
when an abort is signaled. See also AbortController for more information on how to construct a controller that can be used to deliver abort signals.
Returns
Type Description Promise<Slide> When resolved, returns the updated slide.Examples
// Applies the slide's settings to the view, but does
// not use animation when updating the viewpoint
slide.applyTo(view, {
animate: false
});
// Applies the slide's settings to the view, animates with a maximum
// duration of 2 seconds.
slide.applyTo(view, {
maxDuration: 2000
});
slide.applyTo(view, {
maxDuration: 2000
}).then(function(){
//do something after applying the slide's settings to the view
});
clone(){Slide}
Creates a deep clone of this object. Note that the basemap instance is cloned, but the layers within the basemap are copied.
Returns
createFrom(view, options){Promise<Slide>}static
Creates a slide from a SceneView, which may be added to the slides in the WebScene's presentation. Updating the slide is asynchronous and a snapshot of the view is only complete once the returned promise has resolved.
Parameters
Specification
The SceneView from which the slide should be created.
optionalCreation options. See properties below for object specifications.
Parameters
Specification
optionalScreenshot options to use. See properties below for object specifications.
Specification
optionalDefault Value: png
The image format.
optionalDefault Value: 80
The image quality (due to compression).
optionalDefault Value: 120
The image width.
optionalDefault Value: 75
The image height.
Returns
Type Description Promise<Slide> When resolved, returns the created slide.Examples
// Creates a slide from the view and
// adds it to the webscene
Slide.createFrom(view).then(function(slide){
webscene.presentation.slides.add(slide);
});
// Create multiple slides from multiple viewpoints.
view.goTo({ heading: 0 }, { animate: false })
.then(function() {
// Create first slide at heading 0 (looking north)
return Slide.createFrom(view);
})
.then(function(slide){
// Slide has been captured, add to presentation
webscene.presentation.slides.add(slide);
// Change viewpoint to look east
return view.goTo({ heading: 90 }, { animate: false });
})
.then(function() {
// Capture second slide
return Slide.createFrom(view);
})
.then(function(slide) {
// Add second slide to presentation
webscene.presentation.slides.add(slide);
});
Inherited
Method hasHandles(groupKey){Boolean}
Since: ArcGIS Maps SDK for JavaScript 4.25 Accessor since 4.0, hasHandles added at 4.25.
Returns true if a named group of handles exist.
Parameter
groupKey *
optionalA group key.
Returns
Type Description Boolean Returnstrue
if a named group of handles exist.
Example
// Remove a named group of handles if they exist.
if (obj.hasHandles("watch-view-updates")) {
obj.removeHandles("watch-view-updates");
}
Inherited
Method removeHandles(groupKey)
Since: ArcGIS Maps SDK for JavaScript 4.25 Accessor since 4.0, removeHandles added at 4.25.
Removes a group of handles owned by the object.
Parameter
groupKey *
optionalA group key or an array or collection of group keys to remove.
Example
obj.removeHandles(); // removes handles from default group
obj.removeHandles("handle-group");
obj.removeHandles("other-handle-group");
updateFrom(view, options){Promise<Slide>}
Updates a slide from a WebScene's slides. Updating the slide is asynchronous and a snapshot of the view is only complete once the returned promise has resolved.
Parameters
Specification
The SceneView from which the slide should update.
optionalUpdate options. See properties below for object specifications.
Parameters
Specification
Screenshot options to use. See properties below for object specifications.
Specification
optionalDefault Value: png
The image format.
optionalDefault Value: 80
The image quality (due to compression).
optionalDefault Value: 120
The image width.
optionalDefault Value: 75
The image height.
Returns
Type Description Promise<Slide> When resolved, returns the updated slide.RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4