Click or drag to resize

SceneView Class

The SceneView is a container that holds a Scene. It is the 3d mapping component of the ArcGIS Runtime .NET SDK. It can contain mapping layers and responds to user interaction (touch, mouse, keyboard) and provides behavior for scene navigation. It has multiple properties.
Inheritance Hierarchy
SystemObject
  Java.Lang.Object
    Xamarin.Forms.View
      Android.Views.ViewGroup
        Esri.ArcGISRuntime.UI.ControlsGeoView
          Esri.ArcGISRuntime.UI.ControlsSceneView

Namespace:  Esri.ArcGISRuntime.UI.Controls
Assembly:  Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: 100.7.0.0
Syntax
C#
public class SceneView : GeoView

The SceneView type exposes the following members.

Constructors
  NameDescription
Public methodCode exampleSceneView
Initializes a new instance of the SceneView class.
Public methodSceneView(Context)
Initializes a new instance of the SceneView class.
Public methodSceneView(Context, IAttributeSet)
Initializes a new instance of the SceneView class.
Top
Properties
  NameDescription
Public propertyAmbientLightColor
Gets or sets the ambient light.
Public propertyCode exampleAnalysisOverlays
Gets or sets the analysis overlay collection containing the analysis overlay objects.
Public propertyCode exampleAtmosphereEffect
Gets or sets the effect applied to the scene's atmosphere.
Public propertyAttributionText
Gets the full attribution text for all active layers, concatenated into a single string.
(Inherited from GeoView.)
Public propertyCalloutStyle
Gets or sets the CalloutStyle for callouts on this GeoView.
(Inherited from GeoView.)
Public propertyCode exampleCamera
Gets the current Camera for the view.
Public propertyCode exampleCameraController
Gets or sets the SceneView camera controller which determines the camera interaction and navigation model.
Public propertyCode exampleDrawStatus
Returns the current draw status
(Inherited from GeoView.)
Public propertyFieldOfView
Gets the horizontal field of view of the scene view in degrees.
Public propertyFieldOfViewDistortionRatio
Gets how much the vertical field of view is distorted.
Public propertyCode exampleGraphicsOverlays
Gets or sets the GraphicsOverlayCollection.
(Inherited from GeoView.)
Public propertyCode exampleInteractionOptions
Gets or sets the sketch editor used for drawing and editing on the map.
Public propertyCode exampleIsAttributionTextVisible
Gets or sets a value indicating whether Esri attribution text is visible.
(Inherited from GeoView.)
Public propertyIsCalloutVisible
Gets a value indicating whether a callout is currently open
(Inherited from GeoView.)
Public propertyCode exampleIsNavigating
Gets a value indicating whether the map is currently navigating. when navigation has finished the NavigationCompleted event will be raised.
(Inherited from GeoView.)
Public propertyCode exampleIsWrapAroundEnabled
Indicates whether the wrap around feature is currently active. For wrap around to be active the WrapAroundMode property must be set to true and the SpatialReference of the MapView control must be a SpatialReference that supports wrapping.
(Inherited from GeoView.)
Public propertyStatic memberMemoryLimit
Gets or sets the amount of total memory a process can use to render scene data. Note that setting this property must be done before any SceneView instances are constructed. The value is in bytes.
Public propertyCode exampleScene
Gets or sets the scene the view is rendering.
Public propertyCode exampleSpaceEffect
Gets or sets a value indicating whether outer space is black with stars or transparent in the scene view.
Public propertyCode exampleSpatialReference
Gets the current spatial reference of the map
(Inherited from GeoView.)
Public propertySunLighting
Gets or sets the type of lighting applied to the scene view.
Public propertySunTime
Gets or sets the position of the Sun.
Public propertyViewInsetsBottom
Gets the bottom view inset
(Inherited from GeoView.)
Public propertyViewInsetsLeft
Gets the left view inset
(Inherited from GeoView.)
Public propertyViewInsetsRight
Gets the right view inset
(Inherited from GeoView.)
Public propertyViewInsetsTop
Gets the top view inset
(Inherited from GeoView.)
Top
Methods
  NameDescription
Public methodCancelSetViewpointOperations
Cancels any pending or currently running SetViewpointAsync operations.
(Overrides GeoViewCancelSetViewpointOperations.)
Public methodCode exampleDismissCallout
Dismisses a callout if it's open.
(Inherited from GeoView.)
Public methodCode exampleExportImageAsync
Creates an image snapshot of the current map view
(Inherited from GeoView.)
Public methodCode exampleGetCurrentViewpoint
Gets the current Viewpoint of the view.
(Inherited from GeoView.)
Public methodGetLayerViewState
Gets the LayerViewState for the given layer.
(Inherited from GeoView.)
Public methodIdentifyGraphicsOverlayAsync(GraphicsOverlay, PointF, Double, Boolean)
Initiates an identify operation on the specified graphics overlay which will return the visible topmost graphic.
(Inherited from GeoView.)
Public methodIdentifyGraphicsOverlayAsync(GraphicsOverlay, PointF, Double, Boolean, Int64)
Initiates an identify operation on the specified graphics overlay.
(Inherited from GeoView.)
Public methodIdentifyGraphicsOverlaysAsync(PointF, Double, Boolean)
Initiate an identify operation on all graphics overlays which will return the single visible topmost graphic per overlay only.
(Inherited from GeoView.)
Public methodIdentifyGraphicsOverlaysAsync(PointF, Double, Boolean, Int64)
Initiate an identify operation on all graphics overlays.
(Inherited from GeoView.)
Public methodIdentifyLayerAsync(Layer, PointF, Double, Boolean)
Initiates an identify operation on the specified layer which will return the single visible topmost GeoElement only.
(Inherited from GeoView.)
Public methodIdentifyLayerAsync(Layer, PointF, Double, Boolean, Int64)
Initiates an identify operation on the specified layer.
(Inherited from GeoView.)
Public methodIdentifyLayerAsync(Layer, PointF, Double, Boolean, CancellationToken)
Initiates an identify operation on the specified layer which will return the single visible topmost GeoElement only.
(Inherited from GeoView.)
Public methodIdentifyLayerAsync(Layer, PointF, Double, Boolean, Int64, CancellationToken)
Initiates an identify operation on the specified layer.
(Inherited from GeoView.)
Public methodIdentifyLayersAsync(PointF, Double, Boolean)
Initiates an identify operation on all layers in the view which will return the single visible topmost GeoElement per layer only.
(Inherited from GeoView.)
Public methodIdentifyLayersAsync(PointF, Double, Boolean, Int64)
Initiates an identify operation on all layers in the view.
(Inherited from GeoView.)
Public methodIdentifyLayersAsync(PointF, Double, Boolean, CancellationToken)
Initiates an identify operation on all layers in the view which will return the single visible topmost GeoElement per layer only.
(Inherited from GeoView.)
Public methodIdentifyLayersAsync(PointF, Double, Boolean, Int64, CancellationToken)
Initiates an identify operation on all layers in the view.
(Inherited from GeoView.)
Public methodLocationToScreen(MapPoint)
Converts a location in map coordinates to a screen coordinate relative to the upper-left corner of the scene.
Public methodLocationToScreen(MapPoint, LocationVisibility)
Converts a location in map coordinates to a screen coordinate relative to the upper-left corner of the scene.
Public methodScreenToBaseSurface
Converts a screen coordinate (in pixels) to a coordinate on the scene view's base surface.
Public methodScreenToLocationAsync
Async method to convert a screen point relative to the upper left of the SceneView into a location accounting for 3D features within the Scene.
Public methodSetFieldOfView(Double)
Sets the horizontal field of view of the scene view in degrees.
Public methodSetFieldOfView(Double, Double)
Sets the field of view on the scene view in degrees and determines how much the vertical field of view is distorted.
Public methodSetFieldOfView(Single, Single, Single, Single, Single, Single, DeviceOrientation)
Allows for matching the field of view of the scene view to the field of view of a camera lens using the lens intrinsics characteristics.
Public methodSetViewInsets
Gets or sets the viewport padding in pixels.
(Inherited from GeoView.)
Public methodCode exampleSetViewpoint
Sets the view to the given Viewpoint location
(Inherited from GeoView.)
Public methodCode exampleSetViewpointAsync(Viewpoint)
Animates the view to the given Viewpoint location
(Inherited from GeoView.)
Public methodCode exampleSetViewpointAsync(Viewpoint, TimeSpan)
Animates the view to the given Viewpoint location
(Inherited from GeoView.)
Public methodCode exampleSetViewpointCamera
Sets the viewpoint camera in the scene view.
Public methodCode exampleSetViewpointCameraAsync(Camera)
Changes the scene view to the new camera viewpoint asynchronously.
Public methodCode exampleSetViewpointCameraAsync(Camera, TimeSpan)
Changes the scene view to the new camera viewpoint asynchronously using the specified duration to arrive.
Public methodCode exampleShowCalloutAt(MapPoint, CalloutDefinition)
Shows a callout based on a CalloutDefinition at the given location.
(Inherited from GeoView.)
Public methodShowCalloutAt(MapPoint, View, PointF)
Shows a callout at the given location with Visual Element as content
(Inherited from GeoView.)
Public methodShowCalloutForGeoElement
Shows a callout for the given GeoElement at an appropriate location for the tap location by snapping to the geometry of the element.
(Inherited from GeoView.)
Top
Events
  NameDescription
Public eventCode exampleDrawStatusChanged
Occurs when the DrawStatus property of this instance changes.
(Inherited from GeoView.)
Public eventCode exampleGeoViewDoubleTapped
Occurs when an otherwise unhandled DoubleTap interaction occurs over the hit test area of the view.
(Inherited from GeoView.)
Public eventGeoViewHolding
Occurs when an otherwise unhandled holding interaction occurs over the hit test area of the view.
(Inherited from GeoView.)
Public eventCode exampleGeoViewTapped
Occurs when an otherwise unhandled Tap interaction occurs over the hit test area of the view.
(Inherited from GeoView.)
Public eventCode exampleLayerViewStateChanged
Occurs when the LayerViewState of a contained layer changes.
(Inherited from GeoView.)
Public eventCode exampleNavigationCompleted
When navigation on the map has completed this event will be raised.
(Inherited from GeoView.)
Public eventCode exampleSpatialReferenceChanged
Occurs when spatial reference of the view changes.
(Inherited from GeoView.)
Public eventCode exampleViewpointChanged
Occurs when the current viewpoint changes.
(Inherited from GeoView.)
Top
Remarks

The SceneView is a container that holds a Scene. A Scene holds a collection of operational layers and Basemap. Layers are visual representations of geographic information and come in many forms. The types of layers that are displayed in a SceneView are three dimensional.

There is only one Scene per SceneView and it is set by the SceneView.Scene Property. Multiple Scene objects can be created and swapped out dynamically as the application is running in the SceneView.

Examples

Android

Example Name: AddPointSceneLayer

View a point scene layer from a scene service.

Code example screen shot.

C#
// Copyright 2019 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.UI.Controls;
using System;

namespace ArcGISRuntimeXamarin.Samples.AddPointSceneLayer
{
    [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
    [ArcGISRuntime.Samples.Shared.Attributes.Sample(
        "Add a point scene layer",
        "Layers",
        "View a point scene layer from a scene service.",
        "")]
    public class AddPointSceneLayer : Activity
    {
        // Hold references to the UI controls.
        private SceneView _mySceneView;

        // URL for the service with the point scene layer.
        private const string PointSceneServiceUri = "https://tiles.arcgis.com/tiles/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Airports_PointSceneLayer/SceneServer/layers/0";

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

            Title = "Add a point scene layer";

            CreateLayout();
            Initialize();
        }

        private void Initialize()
        {
            // Create the scene.
            _mySceneView.Scene = new Scene(Basemap.CreateImagery());

            // Create the layer.
            ArcGISSceneLayer pointSceneLayer = new ArcGISSceneLayer(new Uri(PointSceneServiceUri));

            // Show the layer in the scene.
            _mySceneView.Scene.OperationalLayers.Add(pointSceneLayer);
        }

        private void CreateLayout()
        {
            // Create a new vertical layout for the app.
            var 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);
        }
    }
}
See Also