Click or drag to resize

Scene Class

The scene contains layers and additional properties and can be displayed in a SceneView.
Inheritance Hierarchy
SystemObject
  Esri.ArcGISRuntime.MappingScene

Namespace:  Esri.ArcGISRuntime.Mapping
Assembly:  Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: 100.11.0
Syntax
[ContentPropertyAttribute("OperationalLayers")]
public class Scene : INotifyPropertyChanged, ILoadable

The Scene type exposes the following members.

Constructors
  NameDescription
Public methodCode exampleScene
Initializes a new instance of the Scene class.
Public methodScene(Uri)
Initializes a new instance of the Scene class with a Uri to a webscene.
Public methodCode exampleScene(Basemap)
Initializes a new instance of the Scene class with a Basemap.
Public methodCode exampleScene(BasemapStyle)
Initializes a new instance of the Scene class with a BasemapStyle.
Public methodCode exampleScene(BasemapType)
Initializes a new instance of the Scene class with a Basemap.
Public methodCode exampleScene(Item)
Initializes a new instance of the Scene class with an ArcGIS Item.
Public methodScene(SceneViewTilingScheme)
Initializes a new instance of the Scene class with a specific tiling scheme.
Top
Properties
  NameDescription
Public propertyAllLayers
Gets all layers in the order they are rendered (bottom-most first).
Public propertyCode exampleBasemap
Gets or sets the basemap for the Scene
Public propertyCode exampleBaseSurface
Gets or sets the base surface for the scene.
Public propertyBookmarks
Gets the bookmarks associated with the scene.
Public propertyCode exampleInitialViewpoint
Gets or sets the view point where the scene should start up at.
Public propertyItem
Gets the ArcGIS Item for the scene.
Public propertyLoadError
Gets the load error for this instance - if any.
Public propertyLoadSettings
Gets or sets the load settings for a scene. The load settings class contains a set of properties which controls rendering options which are applied as the scene is loaded.
Public propertyLoadStatus
Gets the current load status of the scene.
Public propertyCode exampleOperationalLayers
Gets the collection of operational layers in the scene.
Public propertySceneViewTilingScheme
Gets the SceneViewTilingScheme as used to render tile based data.
Public propertySpatialReference
Gets the spatial reference for the scene
Public propertyTables
Gets the list of tables in the scene.
Public propertyTransportationNetworks
Gets a collection of transportation network datasets defined for the scene.
Public propertyUnknownJson
Gets the unknown JSON from the source JSON
Public propertyUnsupportedJson
Gets the unsupported data from the source JSON
Public propertyVersion
Gets the version for the scene.
Top
Methods
  NameDescription
Public methodCancelLoad
Cancels an ongoing load.
Public methodStatic memberFromJson
Creates a scene from the specified JSON
Public methodLoadAsync
Initiates loading of a scene
Public methodRetryLoadAsync
Retries the load operation in case of a load error.
Top
Events
  NameDescription
Public eventLoaded
Occurs when this instance is loaded.
Public eventLoadStatusChanged
Occurs when the instance's LoadStatus has changed.
Public eventPropertyChanged
Occurs when a property value changes.
Top
Examples

WPF

Example Name: OpenScenePortalItem

Open a web scene from a portal item.

Code example screen shot.

C#
// Copyright 2018 Esri.
// 
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an 
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific 
// language governing permissions and limitations under the License.

using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.Portal;
using System;
using System.Windows;

namespace ArcGISRuntime.WPF.Samples.OpenScenePortalItem
{
    [ArcGISRuntime.Samples.Shared.Attributes.Sample(
        name: "Open scene (portal item)",
        category: "Scene",
        description: "Open a web scene from a portal item.",
        instructions: "When the sample opens, it will automatically display the scene from ArcGIS Online. Pan and zoom to explore the scene.",
        tags: new[] { "portal", "scene", "web scene" })]
    public partial class OpenScenePortalItem
    {
        // Hold the ID of the portal item, which is a web scene.
        private const string ItemId = "31874da8a16d45bfbc1273422f772270";

        public OpenScenePortalItem()
        {
            InitializeComponent();

            // Create the UI, setup the control references and execute initialization.
            Initialize();
        }

        private async void Initialize()
        {
            try
            {
                // Try to load the default portal, which will be ArcGIS Online.
                ArcGISPortal portal = await ArcGISPortal.CreateAsync();

                // Create the portal item.
                PortalItem websceneItem = await PortalItem.CreateAsync(portal, ItemId);

                // Create and show the scene.
                MySceneView.Scene = new Scene(websceneItem);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString(), "Error");
            }
        }
    }
}
XAML
<UserControl
    x:Class="ArcGISRuntime.WPF.Samples.OpenScenePortalItem.OpenScenePortalItem"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013">
    <Grid>
        <esri:SceneView x:Name="MySceneView" />
    </Grid>
</UserControl>
See Also
Additional Examples
Hyperlink to ExampleDescription
AddAnIntegratedMeshLayerView an integrated mesh layer from a scene service.
AddPointSceneLayerView a point scene layer from a scene service.
Animate3DGraphicAn `OrbitGeoElementCameraController` follows a graphic while the graphic's position and rotation are animated.
AnimateImageOverlayAnimate a series of images with an image overlay.
ChangeAtmosphereEffectChanges the appearance of the atmosphere in a scene.
ChooseCameraControllerControl the behavior of the camera in a scene.
CreateTerrainSurfaceRasterSet the terrain surface with elevation described by a raster file.
CreateTerrainSurfaceTilePackageSet the terrain surface with elevation described by a local tile package.
DisplayKmlDisplay KML from a URL, portal item, or local KML file.
DisplayKmlNetworkLinksDisplay a file with a KML network link, including displaying any network link control messages at launch.
DisplaySceneDisplay a scene with a terrain surface and some imagery.
DistanceMeasurementMeasure distances between two points in 3D.
EditKmlGroundOverlayEdit the values of a KML ground overlay.
FeatureLayerExtrusionExtrude features based on their attributes.
FeatureLayerRenderingModeSceneRender features in a scene statically or dynamically by setting the feature layer rendering mode.
GeoViewSyncKeep the view points of two views (e.g. MapView and SceneView) synchronized with each other.
GetElevationAtPointGet the elevation for a given point on a surface in a scene.
GroupLayersGroup a collection of layers together and toggle their visibility as a group.
LineOfSightGeoElementShow a line of sight between two moving objects.
LineOfSightLocationPerform a line of sight analysis between two points in real time.
ListKmlContentsList the contents of a KML file.
OpenMobileScenePackageOpens and displays a scene from a Mobile Scene Package (.mspk).
OpenScenePortalItemOpen a web scene from a portal item.
PlayKmlToursPlay tours in KML files.
SceneLayerSelectionIdentify features in a scene to select.
SceneLayerUrlDisplay an ArcGIS scene layer from a URL.
ScenePropertiesExpressionsUpdate the orientation of a graphic using expressions based on its attributes.
SceneSymbolsShow various kinds of 3D symbols in a scene.
SurfacePlacementsPosition graphics relative to a surface using different surface placement modes.
TerrainExaggerationVertically exaggerate terrain in a scene.
UseDistanceCompositeSymChange a graphic's symbol based on the camera's proximity to it.
ViewContentBeneathSurfaceSee through terrain in a scene and move the camera underground.
ViewPointCloudDataOfflineDisplay local 3D point cloud data.
ViewshedCameraAnalyze the viewshed for a camera. A viewshed shows the visible and obstructed areas from an observer's vantage point.
ViewshedGeoElementAnalyze the viewshed for an object (GeoElement) in a scene.
ViewshedLocationPerform a viewshed analysis from a defined vantage point.