Skip to content

A local scene provides a three-dimensional (3D) visualization mode that displays data on a flat plane using a local projected coordinate system. Like global scenes, they can be shared across the ArcGIS system and beyond. Local scenes are ideally used to display data at the city or campus-level for site-specific rendering. Local scenes allow for accurate measurement, subsurface viewing, and improved performance for limited spatial extensions.

You can use a local scene and ArcGISLocalSceneView to:

  • Display a basemap layer such as streets or satellite imagery.
  • Access and display data layers based on files or services, including data you have authored.
  • Display terrain with an elevation layer.
  • Display real-world objects such as buildings or trees.
  • Display 3D visualizations of 2D objects.
  • Measure distance and explore spatial relationships between geometries using the GeometryEngine API.

Scene

The introduction explained the concept of a scene and how it works. The ArcGISScene is your entry point into the API when working with three dimensional data. However, when working with local scenes, you connect them with ArcGISLocalSceneView in order to display the data within an application. Remember that when you are working with local scenes, the SceneViewingMode is set to local. When creating a scene programmatically, the viewing mode needs to be set.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// The following constructor requires the scene viewing mode and basemap style to create
// the scene.
final scene = ArcGISScene.withViewingModeAndBasemapStyle(
  // Set the viewing mode to local for a local scene.
  viewingMode: SceneViewingMode.local,
  basemapStyle: BasemapStyle.arcGISTopographic,
);

// Connect the local scene to the local scene view's controller
// to display the view.
localSceneViewController.arcGISScene = scene;

If consuming a local web scene item from a portal, this information is gathered from the item's definition for you. Note that if the SceneViewingMode is set to global, consult the global scene overview topic for details, as this differs from working with a local scene. Logically, when programmatically building a local scene, the next step is to add layers to your local scene.

Layer

Each layer in a local scene references projected data, either from an online service or from a local dataset contained in a scene package. There are a variety of layers that can be added to a local scene, each designed to display a particular type of data. For example, some layers display images, such as satellite photos or aerial photography, while others are used to display building footprints or trees.

Local scenes can also contain scene layers enabling you to create advanced 3D visualizations. Scene layers can contain one of four data types: points, 3D objects, integrated meshes, or building scene layers.

The Layer class is the base class for all types of layers used in ArcGIS Maps SDK for Flutter. The type of layer you create depends on the type of data you want to display and what is supported. For example, to display a scene layer you can create an ArcGISSceneLayer that references an online portal item.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// Create a scene layer using a URL to the scene layer in ArcGIS Online.
final sceneLayer = ArcGISSceneLayer.withUri(
  Uri.parse(
    'https://www.arcgis.com/home/item.html?id=7a63e9808a054d39964a8b4712c85657',
  ),
);

// Add the scene layer as an operation layer to the local scene view.
scene.operationalLayers.add(sceneLayer);

When working with local scene views, it is useful to define an area for the scene to be clipped to. The clipping area defines the boundaries of a local scene. When it is defined, only data (including the basemap) inside the specified area is displayed. Be sure to enable the clipping area to apply the extent to the view.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// Define the area to clip when displaying the local scene view.
scene.clippingArea = Envelope.fromXY(
  xMin: 19454578.8235,
  yMin: -5055381.4798,
  xMax: 19455518.8814,
  yMax: -5054888.4150,
  spatialReference: SpatialReference.webMercator,
);

// Enable the clipping area for the local scene view.
scene.isClippingEnabled = true;

Camera

Local scenes and local scene views extend the concept of two dimensional viewpoints with a camera that represents the observer's position and perspective within three dimensions.

The following properties define the camera position:

  • Projected location on the surface
  • Altitude (height, in units defined by the SpatialReference)
  • Heading (angle about the z axis the camera is rotated, in degrees)
  • Pitch (angle the camera is rotated up or down, in degrees)
  • Roll (angle the camera is rotated side-to-side, in degrees)
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// Define an ArcGIS point to stipulate a location for the camera.
final point = ArcGISPoint(
  x: 19455578.6821,
  y: -5056336.2227,
  z: 1699.3366,
  spatialReference: SpatialReference.webMercator,
);

// Create a camera with the specified location and other properties.
final camera = Camera.withLocation(
  location: point,
  heading: 338.7410,
  pitch: 40.3763,
  roll: 0,
);

// Set the local scene's initial view point, centering the visible area
// around a point.
scene.initialViewpoint = Viewpoint.withPointScaleCamera(
  center: point,
  scale: 8314.6991,
  camera: camera,
);

ArcGISLocalSceneView

A local scene view is a user interface control that displays a single local scene in your application. It contains built-in functionality that allows the user to explore the local scene by zooming in and out or panning and rotating in the local scene.

After creating a local scene view, you typically set the scene and the camera position. Unlike a map, a local scene uses a camera to define the viewer's perspective and to determine the visible area. The perspective is defined by setting the camera's location, altitude (height), heading, and tilt.

Add ArcGISScene to ArcGISLocalSceneView to display it. Changes you make to the scene, such as adding, removing, or reordering layers, will immediately be reflected in the display. The ArcGISScene.initialViewpoint will determine the area shown when the scene loads.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// Define an ArcGIS point to stipulate a location for the camera.
final point = ArcGISPoint(
  x: 19455578.6821,
  y: -5056336.2227,
  z: 1699.3366,
  spatialReference: SpatialReference.webMercator,
);

// Create a camera with the specified location and other properties.
final camera = Camera.withLocation(
  location: point,
  heading: 338.7410,
  pitch: 40.3763,
  roll: 0,
);

// Set the local scene's initial view point, centering the visible area
// around a point.
scene.initialViewpoint = Viewpoint.withPointScaleCamera(
  center: point,
  scale: 8314.6991,
  camera: camera,
);

// Connect the local scene to the local scene view's controller
// to display the view.
localSceneViewController.arcGISScene = scene;

A ArcGISLocalSceneView also allows you to:

  • Adjust light, atmosphere, and space effects.
  • Identify and select features using a mouse or tap location (ArcGISSceneLayer and BuildingSceneLayer).
  • Export an image of the current display.

View errors

The ArcGISLocalSceneView supports errors that helps to capture different situations and provides useful messages to help troubleshoot related problems that may arise. Ultimately, you decide what you want to do with the error. For example, you may decide to enter the information into a log for further examination as users report problems with your application.

Critical error

A critical error means that the ArcGISLocalSceneView has reached an unusable state from which it cannot recover.

GeoModel error

When working with ArcGISLocalSceneView there are situations that arise when the view is in a usable state, but nothing is displayed because the GeoModel is not configured correctly.

Warnings

Warnings indicate that the ArcGISLocalSceneView is in a usable state, but something may not look correct or as expected.

Example

Display a local scene with elevation

This example uses a ArcGISScene and ArcGISLocalSceneView to display the topographic basemap layer. The basemap layer is draped on an elevation layer to create a 3D perspective. A Camera is created to define the initial view of the local scene.

Steps

  1. Create a ArcGISScene and add a basemap layer.

  2. Use an elevation service to define the ArcGISScene.baseSurface.

  3. Define an area to clip when displaying the local scene view.

  4. Create a ArcGISLocalSceneView and set the camera position.

Expand
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
    // Create a new ArcGIS scene with the topographic basemap style.
    final scene = ArcGISScene.withViewingModeAndBasemapStyle(
      // Set the viewing mode to local for a local scene.
      viewingMode: SceneViewingMode.local,
      basemapStyle: BasemapStyle.arcGISTopographic,
    );

    // Use the world 3D terrain service, which provides global elevation to use
    // as a ground surface.
    final elevationSource = ArcGISTiledElevationSource.withUri(
      Uri.parse(
        'https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer',
      ),
    );

    // Add the elevation source to the base surface.
    scene.baseSurface.elevationSources.add(elevationSource);

    // Define the area to clip when displaying the local scene view.
    scene.clippingArea = Envelope.fromXY(
      xMin: 19454578.8235,
      yMin: -5055381.4798,
      xMax: 19455518.8814,
      yMax: -5054888.4150,
      spatialReference: SpatialReference.webMercator,
    );

    // Enable the clipping area for the local scene view.
    scene.isClippingEnabled = true;

    // Define an ArcGIS point to stipulate a location for the camera.
    final point = ArcGISPoint(
      x: 19455578.6821,
      y: -5056336.2227,
      z: 1699.3366,
      spatialReference: SpatialReference.webMercator,
    );

    // Create a camera with the specified location and other properties.
    final camera = Camera.withLocation(
      location: point,
      heading: 338.7410,
      pitch: 40.3763,
      roll: 0,
    );

    // Set the local scene's initial view point, centering the visible area
    // around a point.
    scene.initialViewpoint = Viewpoint.withPointScaleCamera(
      center: point,
      scale: 8314.6991,
      camera: camera,
    );

    // Connect the local scene to the local scene view's controller
    // to display the view.
    _localSceneViewController.arcGISScene = scene;
Expand

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