Scene properties expressions

View inMAUIUWPWPFWinUIView on GitHub

Update the orientation of a graphic using expressions based on its attributes.

Image of scene properties expressions

Use case

Instead of reading the attribute and changing the rotation on the symbol for a single graphic (a manual CPU operation), you can bind the rotation to an expression that applies to the whole overlay (an automatic GPU operation). This usually results in a noticeable performance boost (smooth rotations).

How to use the sample

Adjust the heading and pitch sliders to rotate the cone.

How it works

  1. Create a new graphics overlay.
  2. Create a simple renderer and set its scene properties.
  3. Set the heading expression to [HEADING].
  4. Apply the renderer to the graphics overlay.
  5. Create a graphic and add it to the overlay.
  6. To update the graphic's rotation, update the HEADING or PITCH property in the graphic's attributes.

Relevant API

  • Graphic.Attributes
  • GraphicsOverlay
  • SceneProperties
  • SceneProperties.HeadingExpression
  • SceneProperties.PitchExpression
  • SimpleRenderer
  • SimpleRenderer.SceneProperties

Tags

3D, expression, graphics, heading, pitch, rotation, scene, symbology

Sample Code

ScenePropertiesExpressions.xamlScenePropertiesExpressions.xamlScenePropertiesExpressions.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<UserControl
    x:Class="ArcGIS.UWP.Samples.ScenePropertiesExpressions.ScenePropertiesExpressions"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:esriUI="using:Esri.ArcGISRuntime.UI.Controls">
    <Grid>
        <esriUI:SceneView x:Name="MySceneView" />
        <Border Style="{StaticResource BorderStyle}">
            <StackPanel>
                <TextBlock Text="Heading:" />
                <Slider x:Name="HeadingSlider" Minimum="0" Maximum="360" />
                <TextBlock Text="Pitch:" />
                <Slider x:Name="PitchSlider" Minimum="-90" Maximum="90" />
            </StackPanel>
        </Border>
    </Grid>
</UserControl>

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close