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.7.0.0
Syntax
C#
public class Scene : 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(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 methodCode exampleScene(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 tiling scheme used to render tile-based data in this Scene.
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 methodCode exampleLoadAsync
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

Android

Example Name: OpenScene

Open a scene from a Portal item. Just like Web Maps are the ArcGIS format for maps, Web Scenes are the ArcGIS format for scenes. These scenes can be stored in ArcGIS Online or Portal.

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 Android.App;
using Android.OS;
using Android.Widget;
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.Portal;
using Esri.ArcGISRuntime.UI.Controls;
using System;

namespace ArcGISRuntime.Samples.OpenScene
{
    [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
    [ArcGISRuntime.Samples.Shared.Attributes.Sample(
        "Open scene (Portal item)",
        "Map",
        "Open a scene from a Portal item. Just like Web Maps are the ArcGIS format for maps, Web Scenes are the ArcGIS format for scenes. These scenes can be stored in ArcGIS Online or Portal.",
        "The sample will load the scene automatically.")]
    public class OpenScene : Activity
    {
        // Hold the ID of the portal item, which is a web scene.
        private const string ItemId = "c6f90b19164c4283884361005faea852";

        // Hold a reference to the scene view.
        private SceneView _mySceneView;

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            Title = "Open scene (Portal item)";

            CreateLayout();
            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)
            {
                new AlertDialog.Builder(this).SetMessage(e.ToString()).SetTitle("Error").Show();
            }
        }

        private void CreateLayout()
        {
            // Create a new vertical layout for the app
            LinearLayout layout = new LinearLayout(this) {Orientation = Orientation.Vertical};

            // Add the map view to the layout
            _mySceneView = new SceneView(this);
            layout.AddView(_mySceneView);

            // Show the layout in the app
            SetContentView(layout);
        }
    }
}
Examples

Xamarin Forms Android

Example Name: OpenScene

Open a scene from a Portal item. Just like Web Maps are the ArcGIS format for maps, Web Scenes are the ArcGIS format for scenes. These scenes can be stored in ArcGIS Online or Portal.

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 System;
using Esri.ArcGISRuntime.Portal;
using Xamarin.Forms;

namespace ArcGISRuntime.Samples.OpenScene
{
    [ArcGISRuntime.Samples.Shared.Attributes.Sample(
        "Open scene (Portal item)",
        "Map",
        "Open a scene from a Portal item. Just like Web Maps are the ArcGIS format for maps, Web Scenes are the ArcGIS format for scenes. These scenes can be stored in ArcGIS Online or Portal.",
        "The sample will load the scene automatically.")]
    public partial class OpenScene : ContentPage
    {
        // Hold the ID of the portal item, which is a web scene.
        private const string ItemId = "c6f90b19164c4283884361005faea852";

        public OpenScene()
        {
            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)
            {
                await Application.Current.MainPage.DisplayAlert("Error", e.ToString(), "OK");
            }
        }
    }
}
XAML
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Xamarin.Forms;assembly=Esri.ArcGISRuntime.Xamarin.Forms"
             x:Class="ArcGISRuntime.Samples.OpenScene.OpenScene">
    <Grid>
        <esriUI:SceneView x:Name="MySceneView" />
    </Grid>
</ContentPage>
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.
ChangeAtmosphereEffectChanges the appearance of the atmosphere in a scene.
ChooseCameraControllerControl the behavior of the camera in a scene.
CreateTerrainSurfaceFromRasterUse a terrain surface with elevation described by a raster file.
CreateTerrainSurfaceFromTilePackageSet the terrain surface with elevation described by a local tile package.
DisplayKmlLoad and display KML from a URL, a local file, or a portal item.
DisplayKmlNetworkLinks Display a file with a KML network link.
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 (a MapView and a SceneView in this case) 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. KML files can contain a hierarchy of features, including network links to other KML content.
OpenMobileScenePackageOpen and display a scene from a Mobile Scene Package (.mspk).
OpenSceneOpen a scene from a Portal item. Just like Web Maps are the ArcGIS format for maps, Web Scenes are the ArcGIS format for scenes. These scenes can be stored in ArcGIS Online or Portal.
PlayKmlToursPlay tours in KML files.
SceneLayerSelectionIdentify GeoElements in a scene layer.
SceneLayerUrlDisplay an ArcGIS scene layer from a URL.
ScenePropertiesExpressionsUpdate the orientation of a graphic using scene property rotation expressions.
SceneSymbolsShow various kinds of 3D symbols in a scene.
SurfacePlacementsPosition graphics relative to a surface using different surface placement modes.
TerrainExaggerationConfigure the vertical exaggeration of terrain (the ground surface) 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. Viewshed analyses have several configuration options that are demonstrated in this sample.