Click or drag to resize

LayerSceneProperties Class

Collection of properties for layers or overlays that participate in a Scene.
Inheritance Hierarchy
SystemObject
  Esri.ArcGISRuntime.MappingLayerSceneProperties

Namespace:  Esri.ArcGISRuntime.Mapping
Assembly:  Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: 100.7.0.0
Syntax
C#
public sealed class LayerSceneProperties

The LayerSceneProperties type exposes the following members.

Constructors
  NameDescription
Public methodLayerSceneProperties
Initializes a new instance of the LayerSceneProperties class with default values.
Public methodCode exampleLayerSceneProperties(SurfacePlacement)
Initializes a new instance of the LayerSceneProperties class with the specified SurfacePlacement.
Top
Properties
  NameDescription
Public propertyCode exampleAltitudeOffset
Gets or sets the altitude offset on the layer.
Public propertyCode exampleSurfacePlacement
Gets or sets the SurfacePlacement for the layer scene properties.
Top
Events
  NameDescription
Public eventPropertyChanged
Occurs when a property value changes.
Top
Examples

Android

Example Name: ScenePropertiesExpressions

Update the orientation of a graphic using scene property rotation expressions.

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

namespace ArcGISRuntimeXamarin.Samples.ScenePropertiesExpressions
{
    [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
    [ArcGISRuntime.Samples.Shared.Attributes.Sample(
        "Scene properties expressions",
        "GraphicsOverlay",
        "Update the orientation of a graphic using scene property rotation expressions.",
        "",
        "rotation", "expression", "heading", "pitch", "scene", "3D", "symbology")]
    public class ScenePropertiesExpressions : Activity
    {
        // Hold reference to the used MapView.
        private SceneView _mySceneView;
        private SeekBar _headingSlider;
        private SeekBar _pitchSlider;

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

            Title = "Scene properties expressions";

            CreateLayout();
            Initialize();
        }

        private void Initialize()
        {
            // Set up the scene with an imagery basemap.
            _mySceneView.Scene = new Scene(Basemap.CreateImagery());

            // Set the initial viewpoint for the scene.
            MapPoint point = new MapPoint(83.9, 28.4, 1000, SpatialReferences.Wgs84);
            Camera initialCamera = new Camera(point, 1000, 0, 50, 0);
            _mySceneView.SetViewpointCamera(initialCamera);

            // Create a graphics overlay.
            GraphicsOverlay overlay = new GraphicsOverlay();
            overlay.SceneProperties.SurfacePlacement = SurfacePlacement.Relative;
            _mySceneView.GraphicsOverlays.Add(overlay);

            // Add a renderer using rotation expressions.
            SimpleRenderer renderer = new SimpleRenderer();
            renderer.SceneProperties.HeadingExpression = "[HEADING]";
            renderer.SceneProperties.PitchExpression = "[PITCH]";

            // Apply the renderer to the graphics overlay.
            overlay.Renderer = renderer;

            // Create a red cone graphic.
            SimpleMarkerSceneSymbol coneSymbol = SimpleMarkerSceneSymbol.CreateCone(Color.Red, 100, 100);
            coneSymbol.Pitch = -90;
            MapPoint conePoint = new MapPoint(83.9, 28.41, 200, SpatialReferences.Wgs84);
            Graphic cone = new Graphic(conePoint, coneSymbol);

            // Add the cone graphic to the overlay.
            overlay.Graphics.Add(cone);

            // Listen for changes in slider values and update graphic properties.
            _headingSlider.ProgressChanged += (sender, e) => { cone.Attributes["HEADING"] = _headingSlider.Progress; };
            _pitchSlider.ProgressChanged += (sender, e) => { cone.Attributes["PITCH"] = _pitchSlider.Progress - 90; };
        }

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

            _mySceneView = new SceneView(this);
            TextView headingLabel = new TextView(this);
            headingLabel.Text = "Heading:";
            _headingSlider = new SeekBar(this);
            _headingSlider.Min = 0;
            _headingSlider.Max = 360;
            TextView pitchLabel = new TextView(this);
            pitchLabel.Text = "Pitch:";
            _pitchSlider = new SeekBar(this);
            _pitchSlider.Min = 0;
            _pitchSlider.Max = 180;

            // Add the map view to the layout.
            layout.AddView(headingLabel);
            layout.AddView(_headingSlider);
            layout.AddView(pitchLabel);
            layout.AddView(_pitchSlider);
            layout.AddView(_mySceneView);

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

Xamarin Forms Android

Example Name: ScenePropertiesExpressions

Update the orientation of a graphic using scene property rotation expressions.

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 Esri.ArcGISRuntime.Geometry;
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.Symbology;
using Esri.ArcGISRuntime.UI;
using Xamarin.Forms;

namespace ArcGISRuntimeXamarin.Samples.ScenePropertiesExpressions
{
    [ArcGISRuntime.Samples.Shared.Attributes.Sample(
        "Scene properties expressions",
        "GraphicsOverlay",
        "Update the orientation of a graphic using scene property rotation expressions.",
        "",
        "rotation", "expression", "heading", "pitch", "scene", "3D", "symbology")]
    public partial class ScenePropertiesExpressions : ContentPage
    {
        public ScenePropertiesExpressions()
        {
            InitializeComponent();
            Initialize();
        }

        private void Initialize()
        {
            // Set up the scene with an imagery basemap.
            MySceneView.Scene = new Scene(Basemap.CreateImagery());

            // Set the initial viewpoint for the scene.
            MapPoint point = new MapPoint(83.9, 28.4, 1000, SpatialReferences.Wgs84);
            Camera initialCamera = new Camera(point, 1000, 0, 50, 0);
            MySceneView.SetViewpointCamera(initialCamera);

            // Create a graphics overlay.
            GraphicsOverlay overlay = new GraphicsOverlay();
            overlay.SceneProperties.SurfacePlacement = SurfacePlacement.Relative;
            MySceneView.GraphicsOverlays.Add(overlay);

            // Add a renderer using rotation expressions.
            SimpleRenderer renderer = new SimpleRenderer();
            renderer.SceneProperties.HeadingExpression = "[HEADING]";
            renderer.SceneProperties.PitchExpression = "[PITCH]";

            // Apply the renderer to the graphics overlay.
            overlay.Renderer = renderer;

            // Create a red cone graphic.
            SimpleMarkerSceneSymbol coneSymbol = SimpleMarkerSceneSymbol.CreateCone(Color.Red, 100, 100);
            coneSymbol.Pitch = -90;
            MapPoint conePoint = new MapPoint(83.9, 28.41, 200, SpatialReferences.Wgs84);
            Graphic cone = new Graphic(conePoint, coneSymbol);

            // Add the cone graphic to the overlay.
            overlay.Graphics.Add(cone);

            // Listen for changes in slider values and update graphic properties.
            HeadingSlider.ValueChanged += (sender, e) => { cone.Attributes["HEADING"] = HeadingSlider.Value; };
            PitchSlider.ValueChanged += (sender, e) => { cone.Attributes["PITCH"] = PitchSlider.Value; };
        }
    }
}
XAML
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
    x:Class="ArcGISRuntimeXamarin.Samples.ScenePropertiesExpressions.ScenePropertiesExpressions"
    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"
    xmlns:resources="clr-namespace:Forms.Resources;assembly=ArcGISRuntime">
    <RelativeLayout>
        <esriUI:SceneView
            x:Name="MySceneView"
            Style="{StaticResource MapWithFormStyle}"
            ViewInsets="0" />
        <resources:ResponsiveFormContainer x:Name="FormContainer">
            <StackLayout>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="200" />
                    </Grid.ColumnDefinitions>
                    <Label
                        Grid.Column="0"
                        Style="{StaticResource LabelStyle}"
                        Text="Heading:" />
                    <Slider
                        x:Name="HeadingSlider"
                        Grid.Column="1"
                        Maximum="360"
                        MaximumTrackColor="Black"
                        Minimum="0"
                        MinimumTrackColor="Black" />
                </Grid>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="200" />
                    </Grid.ColumnDefinitions>
                    <Label
                        Grid.Column="0"
                        Style="{StaticResource LabelStyle}"
                        Text="Pitch:" />
                    <Slider
                        x:Name="PitchSlider"
                        Grid.Column="1"
                        Maximum="90"
                        MaximumTrackColor="Black"
                        Minimum="-90"
                        MinimumTrackColor="Black" />
                </Grid>
            </StackLayout>
        </resources:ResponsiveFormContainer>
    </RelativeLayout>
</ContentPage>
See Also
Additional Examples
Hyperlink to ExampleDescription
Animate3DGraphicAn `OrbitGeoElementCameraController` follows a graphic while the graphic's position and rotation are animated.
ChooseCameraControllerControl the behavior of the camera in a scene.
GetElevationAtPointGet the elevation for a given point on a surface in a scene.
LineOfSightGeoElementShow a line of sight between two moving objects.
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.
UseDistanceCompositeSymChange a graphic's symbol based on the camera's proximity to it.
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.