Maps A map is a collection of layers that are displayed in 2D. It is typically composed of a basemap layer and data layers. Learn more and scenes A scene is a collection of layers that are displayed in 3D. It is typically composed of a basemap layer, data layers, and 3D data. Learn more provide interactive displays of geographic data that enable you to visualize and explore patterns, answer questions, and share insight. They can be opened, edited, and shared across the ArcGIS system and beyond. While the programming patterns are similar and many of the classes you work with are the same, maps are designed for working with geographic data in two dimensions (2D) and scenes in three dimensions (3D). Most applications contain a basemap layer A basemap layer is the layer in a map or scene that displays basemap data. The data source for a basemap layer is typically a basemap service. Learn more to display geographic data with streets or satellite imagery, but you can also use data layers A data layer is a layer that references geographic data from a file or a service and is used to visualize the data in a map or scene. Learn more and graphics A graphic is a visual element composed of a geometry, symbol, and attributes that is displayed on a map or scene. Learn more to display additional data. See Maps (2D) in this guide for more information about working with maps.

You can use a scene A scene is a collection of layers that are displayed in 3D. It is typically composed of a basemap layer, data layers, and 3D data. Learn more and a scene view A scene view is a user interface that displays scene layers and graphics in 3D. It uses a camera to control the visible area of the scene and supports user interactions such as pan, zoom, tilt, and rotate. Learn more to:

  • Display a basemap layer A basemap layer is the layer in a map or scene that displays basemap data. The data source for a basemap layer is typically a basemap service. Learn more such as streets or satellite imagery.
  • Access and display data layers A data layer is a layer that references geographic data from a file or a service and is used to visualize the data in a map or scene. Learn more based on files or services, including data you have authored.
  • Display terrain with an elevation layer An elevation layer is a layer that defines the ground height or the surface for a scene. Learn more .
  • Display real-world objects such as buildings, cars, and trees.
  • Display 3D visualizations of 2D objects.
  • Perform 3D analysis, such as line-of-sight, visibility, and 3D measurements.
  • Provide context for temporary points, lines, polygons, or text displayed as graphics A graphic is a visual element composed of a geometry, symbol, and attributes that is displayed on a map or scene. Learn more .
  • Measure distance and explore spatial relationships between geometries A geometry is a geometric shape, such as a point, polyline, or polygon, that contains one or more coordinates and a spatial reference. Learn more .
  • Inspect data layers and display information from attributes Attributes are fields and values for a single feature or non-spatial record. They are typically stored in a database or service such as a feature service. Learn more .

How a scene works

A scene A scene is a collection of layers that are displayed in 3D. It is typically composed of a basemap layer, data layers, and 3D data. Learn more works together with a scene view A scene view is a user interface that displays scene layers and graphics in 3D. It uses a camera to control the visible area of the scene and supports user interactions such as pan, zoom, tilt, and rotate. Learn more to display geographic content in three dimensions. A scene contains a collection of layers A layer is a reference to a collection of geographic data that is used to access and display data. The data for layers are typically provided by the basemap layer service and data services. Learn more including multiple data layers A data layer is a layer that references geographic data from a file or a service and is used to visualize the data in a map or scene. Learn more from online or local sources, a basemap layer A basemap layer is the layer in a map or scene that displays basemap data. The data source for a basemap layer is typically a basemap service. Learn more that gives geographic context, and a base surface containing elevation data An elevation layer is a layer that defines the ground height or the surface for a scene. Learn more . A scene can also contain datasets that enable searches for addresses or place names, networks for solving routes A route is a polyline that defines the best path between two or more points in a street network. Learn more , and non-spatial tables.

For offline An offline application, also known as offline app, is an application that runs on a phone, tablet, laptop or desktop device with limited or no network connection. Offline applications are built with ArcGIS Maps SDKs for Native Apps. Learn more workflows (when you don’t have network connectivity), you can open a scene stored in a mobile scene package A mobile scene package (MSPK) is a standalone file that contains one or more scene definitions, including the basemap layers, elevation layers, data layers, layer styles, and pop-up styles for use in offline applications built with ArcGIS Maps SDKs for Native Apps. Learn more . You can create mobile scene packages using ArcGIS Pro, share them using your ArcGIS organization, or distribute directly by copying to a device. See Offline maps, scenes, and data for more information about implementing offline workflows in your app.

Scene

A scene contains a collection of layers A layer is a reference to a collection of geographic data that is used to access and display data. The data for layers are typically provided by the basemap layer service and data services. Learn more . Two dimensional layers are displayed in the order in which they are added, while three dimensional layers are displayed using the layer’s elevation information. You can use the scene to change the display order of two dimensional layers as well as to control which layers are visible, and expose this functionality with user interface controls such as lists, check boxes, or switches. Scenes extend the concept of a basemap by introducing a base surface that contains a collection of elevation sources An elevation layer is a layer that defines the ground height or the surface for a scene. Learn more . Layers can be draped on top of the surface, positioned relative to the surface or displayed based on their absolute values.

You can instantiate a new ArcGISScene object by creating a new scene and building it entirely with code. With this approach, you typically first add a basemap layer A basemap layer is the layer in a map or scene that displays basemap data. The data source for a basemap layer is typically a basemap service. Learn more and then one or more data layers A data layer is a layer that references geographic data from a file or a service and is used to visualize the data in a map or scene. Learn more .

// Authenticate your application using a supported method:
// - API key authentication
// - User authentication
// Create a new ArcGISScene with the topographic basemap style.
final scene = ArcGISScene.withBasemapStyle(BasemapStyle.arcGISTopographic);
// Use the world 3D terrain service, which provides global elevation to use
// as a ground surface.
const elevationUrl =
'https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer';
// Create an elevation source using the global elevation service.
final source = ArcGISTiledElevationSource.withUri(Uri.parse(elevationUrl));
// Create a new surface.
final surface = Surface();
// Add the elevation source to the surface.
surface.elevationSources.add(source);
// Set the base surface of the ArcGISScene to the surface.
scene.baseSurface = surface;
// Set the scene to the scene view controller's arcGISScene property.
sceneViewController.arcGISScene = scene;

You can also instantiate a ArcGISScene that’s stored in a portal ArcGIS portal, also known as a portal, is a website with applications and tools that can be used to create, manage, access, and share geospatial content and data. It supports security and authentication, developer credentials, content and data service management, user and group management, and site administration. A portal can be hosted in Esri's infrastructure or your own infrastructure. Learn more (such as ArcGIS Online) using its item ID or URL.

// Instantiate a Portal object to connect to the portal anonymously.
final portal = Portal.arcGISOnline();
const itemId = '579f97b2f3b94d4a8e48a5f140a6639b'; // Web scene item ID.
// Create a PortalItem object using the item ID that
// references the web scene.
final portalItem =
PortalItem.withPortalAndItemId(portal: portal, itemId: itemId);
// Create a scene with the portal item.
final scene = ArcGISScene.withItem(portalItem);
// Set the scene to the scene view controller's arcGISScene property.
sceneViewController.arcGISScene = scene;

When the ArcGISScene first appears in the ArcGISSceneView, you can focus the initial display at a specified view point by setting the ArcGISScene.initialViewpoint property. If an initial view point is not defined, the scene will initially display at a global scale.

Layer

Each layer A layer is a reference to a collection of geographic data that is used to access and display data. The data for layers are typically provided by the basemap layer service and data services. Learn more in a scene references geographic data, either from an online service or from a local dataset. There are a variety of layers that can be added to a scene, each designed to display a particular type of data. Some layers display images, such as satellite photos or aerial photography, others are composed of a collection of features A feature is a single record, also known as a row, that represents a real-world entity. It typically contains a geometry (point, multipoint, polyline, or polygon) and attributes but it can also contain just attributes. Learn more to represent real-world entities using point, line, or polygon geometries A geometry is a geometric shape, such as a point, polyline, or polygon, that contains one or more coordinates and a spatial reference. Learn more . In addition to geometry, features have attributes Attributes are fields and values for a single feature or non-spatial record. They are typically stored in a database or service such as a feature service. Learn more that provide details about the entity it represents.

Scenes can also contain scene layers A scene layer is a data layer is used to access and display 3D data from a scene service. Learn more enabling you to create advanced 3D visualizations. Scene layers can contain one of four data types: points, point cloud, 3D objects, or an integrated mesh. To learn more about scene layers, visit What is a scene layer? in the ArcGIS Pro documentation.

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. For example, to display feature data you can create a FeatureLayer that references an online service (such as a feature service A feature service is a data service that provides access to spatial and non-spatial data in feature layers, feature layer views, and tables. Learn more ) or a supported local dataset. Some layers cannot be displayed in a scene, such as ArcGISVectorTiledLayer and AnnotationLayer. Similarly, 3D layers cannot be displayed in a map A map is a collection of layers that are displayed in 2D. It is typically composed of a basemap layer and data layers. Learn more , such as ArcGISSceneLayer.

// Create a new trail heads feature layer from its URL.
final trailheadsLayer = FeatureLayer.withFeatureTable(
ServiceFeatureTable.withUri(
Uri.parse(
'https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Trailheads_Styled/FeatureServer/0',
),
),
);
// Create a new trails feature layer from its URL.
final trailsLayer = FeatureLayer.withFeatureTable(
ServiceFeatureTable.withUri(
Uri.parse(
'https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Trails_Styled/FeatureServer/0',
),
),
);
// Create a new open spaces feature layer from its URL.
final openSpacesLayer = FeatureLayer.withFeatureTable(
ServiceFeatureTable.withUri(
Uri.parse(
'https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Parks_and_Open_Space_Styled/FeatureServer/0',
),
),
);
// Add all feature layers to the scene.
scene.operationalLayers
.addAll([trailheadsLayer, trailsLayer, openSpacesLayer]);

Camera

Scenes and scene views extend the concept of two dimensional viewpoints with a camera A camera defines the rendering viewpoint of a 3D scene in a scene view. Learn more that represents the observer’s position and perspective within three dimensions.

The following properties define the camera position:

  • Geographic location on the surface (longitude and latitude)
  • Altitude (height, in meters, above sea level)
  • 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)
// Define an ArcGIS point to stipulate a location for the camera.
final point = ArcGISPoint(
x: -118.804,
y: 34.027,
z: 5330.0,
spatialReference: SpatialReference.wgs84,
);
// Create a camera based on the point and set the other properties.
final camera = Camera.withLocation(
location: point,
heading: 355.0,
pitch: 72.0,
roll: 0,
);
// Set the scene's initial view point providing a point as the visible area
// and the camera.
scene.initialViewpoint =
Viewpoint.withExtentCamera(targetExtent: point, camera: camera);

A scene view A scene view is a user interface that displays scene layers and graphics in 3D. It uses a camera to control the visible area of the scene and supports user interactions such as pan, zoom, tilt, and rotate. Learn more has an associated controller that manages the camera A camera defines the rendering viewpoint of a 3D scene in a scene view. Learn more for the scene A scene is a collection of layers that are displayed in 3D. It is typically composed of a basemap layer, data layers, and 3D data. Learn more . Each type of camera controller is designed to provide a specific user experience for interacting with the scene display. The camera controller and its properties can be changed at run time, enabling you to provide the scene view interaction experience best suited for the current context.

When a camera controller other than the default GlobeCameraController is active, the scene view’s viewpoint cannot be assigned. Attempts to do so do not raise an exception, but they are ignored.

The following camera controllers are available:

  • GlobeCameraController (default) — Provides the default scene view camera behavior. Allows the user to freely move and focus the camera anywhere in the scene.
  • OrbitGeoElementCameraController — Locks the scene view’s camera to maintain focus relative to a (possibly moving) graphic. The camera can only move relative to the target graphic.
  • OrbitLocationCameraController — Locks the scene view’s camera to orbit a fixed location (map point). The camera can only move relative to the target map point.
  • TransformationMatrixCameraController — Provides navigation by using a TransformationMatrix to control the camera’s location and rotation. You need to pass this object to all TransformationMatrixCameraController functions. This can be used with transformation matrices produced by Augmented Reality APIs like ARKit (iOS) and ARCore (Android).§
// Create a camera controller to follow a GeoElement in the scene view.
// Pass a GeoElement (graphic) and a distance the camera will be positioned
// from the GeoElement.
final cameraController = OrbitGeoElementCameraController(
targetGeoElement: _planeGraphic!,
distance: 1700,
)
..cameraPitchOffset = 3
..cameraHeadingOffset = 150;
// Add the camera controller to the scene view controller.
sceneViewController.cameraController = cameraController;
§ This capability has not yet been implemented in ArcGIS Maps SDK for Flutter, but will be added in a future release. See this page for more details.

SceneView

A scene view A scene view is a user interface that displays scene layers and graphics in 3D. It uses a camera to control the visible area of the scene and supports user interactions such as pan, zoom, tilt, and rotate. Learn more is a user interface control that displays a single scene in your application. It contains built-in functionality that allows the user to explore the scene by zooming in and out, panning and rotating, or getting additional information about elements in the scene. Scene views may also contain graphics A graphic is a visual element composed of a geometry, symbol, and attributes that is displayed on a map or scene. Learn more in one or more graphics overlays A graphics overlay is a client-side, temporary container of graphics to display on a map view or scene view. Learn more .

After creating a scene view A scene view is a user interface that displays scene layers and graphics in 3D. It uses a camera to control the visible area of the scene and supports user interactions such as pan, zoom, tilt, and rotate. Learn more , you typically set the scene A scene is a collection of layers that are displayed in 3D. It is typically composed of a basemap layer, data layers, and 3D data. Learn more and the camera A camera defines the rendering viewpoint of a 3D scene in a scene view. Learn more position. Unlike a map, a 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 position, location, altitude (height), heading, and tilt.

Add a ArcGISScene to a ArcGISSceneView control 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 property will determine the area shown when the scene loads.

// Set the scene to the scene view controller's arcGISScene property.
sceneViewController.arcGISScene = scene;
// Display the viewpoint specified by the camera.
sceneViewController.setViewpointCamera(
Camera.withLatLong(
latitude: 33.961,
longitude: -118.808,
altitude: 2000,
heading: 0,
pitch: 75,
roll: 0,
),
);

A scene view A scene view is a user interface that displays scene layers and graphics in 3D. It uses a camera to control the visible area of the scene and supports user interactions such as pan, zoom, tilt, and rotate. Learn more control also allows you to:

  • Adjust light, atmosphere, and space effects.
  • Display image overlays on the scene surface.
  • Lock the camera to a location or geoelement A geoelement refers to any geographic element in a map or map view that can be identified by its location to return attribute information. Learn more .
  • Add analysis overlays to visualize analysis results.
  • Identify and select features using a mouse or tap location.
  • Export an image of the current display.
  • Apply a time extent to filter the display of features.

Examples

Display a scene with elevation

This example uses a ArcGISScene and ArcGISSceneView to display the topographic basemap layer A basemap layer is the layer in a map or scene that displays basemap data. The data source for a basemap layer is typically a basemap service. Learn more . 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 scene.

Steps

  1. Create a ArcGISScene and add a basemap layer A basemap layer is the layer in a map or scene that displays basemap data. The data source for a basemap layer is typically a basemap service. Learn more .

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

  3. Create a ArcGISSceneView and set the camera position.

37 collapsed lines
import 'package:arcgis_maps/arcgis_maps.dart';
import 'package:flutter/material.dart';
void main() {
ArcGISEnvironment.apiKey = 'YOUR_ACCESS_TOKEN';
runApp(
const MaterialApp(
home: DisplayASceneWithElevationExample(),
),
);
}
class DisplayASceneWithElevationExample extends StatefulWidget {
const DisplayASceneWithElevationExample({super.key});
@override
State<DisplayASceneWithElevationExample> createState() =>
_DisplayASceneWithElevationState();
}
class _DisplayASceneWithElevationState
extends State<DisplayASceneWithElevationExample> {
final _sceneViewController = ArcGISSceneView.createController();
@override
Widget build(BuildContext context) {
return Scaffold(
body: ArcGISSceneView(
controllerProvider: () => _sceneViewController,
onSceneViewReady: onSceneViewReady,
),
);
}
void onSceneViewReady() {
// Create a new ArcGISScene with the topographic basemap style.
final scene = ArcGISScene.withBasemapStyle(BasemapStyle.arcGISTopographic);
// Use the world 3D terrain service, which provides global elevation to use
// as a ground surface.
const elevationUrl =
'https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer';
// Create an elevation source using the global elevation service.
final elevationSource =
ArcGISTiledElevationSource.withUri(Uri.parse(elevationUrl));
// Create a new surface.
final surface = Surface();
// Add the elevation source to the surface.
surface.elevationSources.add(elevationSource);
// Set the base surface of the ArcGISScene to the surface.
scene.baseSurface = surface;
// Set the scene to the scene view controller's arcGISScene property.
_sceneViewController.arcGISScene = scene;
// Display the viewpoint specified by the camera.
_sceneViewController.setViewpointCamera(
Camera.withLatLong(
latitude: 33.961,
longitude: -118.808,
altitude: 2000,
heading: 0,
pitch: 75,
roll: 0,
),
);
3 collapsed lines
}
}

Display a scene from a mobile scene package

This example displays a scene A scene is a collection of layers that are displayed in 3D. It is typically composed of a basemap layer, data layers, and 3D data. Learn more from a mobile scene package A mobile scene package (MSPK) is a standalone file that contains one or more scene definitions, including the basemap layers, elevation layers, data layers, layer styles, and pop-up styles for use in offline applications built with ArcGIS Maps SDKs for Native Apps. Learn more . You can create your own mobile scene packages using ArcGIS Pro or download existing ones from ArcGIS Online. The Philadelphia scene package, for example, shows an area of downtown Philadelphia with textured buildings.

Steps

  1. Create a MobileScenePackage using the path to a local .mspk file.

  2. Call MobileScenePackage.load() to load the package.

  3. When the package loads, get the first scene from the package using the MobileScenePackage.scenes property.

  4. Display the scene in a ArcGISSceneView.

66 collapsed lines
import 'dart:io';
import 'package:arcgis_maps/arcgis_maps.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:path_provider/path_provider.dart';
void main() {
runApp(const MaterialApp(home: DisplaySceneFromMobileScenePackageExample()));
}
class DisplaySceneFromMobileScenePackageExample extends StatefulWidget {
const DisplaySceneFromMobileScenePackageExample({super.key});
@override
State<DisplaySceneFromMobileScenePackageExample> createState() =>
_DisplaySceneFromMobileScenePackageExampleState();
}
class _DisplaySceneFromMobileScenePackageExampleState
extends State<DisplaySceneFromMobileScenePackageExample> {
final _sceneViewController = ArcGISSceneView.createController();
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
children: [
Expanded(
child: ArcGISSceneView(
controllerProvider: () => _sceneViewController,
onSceneViewReady: onSceneViewReady,
),
),
],
),
);
}
void onSceneViewReady() async {
const mobileScenePackageName = 'philadelphia.mspk';
// Retrieve the mobile scene package from the asset bundle.
final mobileScenePackageData = await rootBundle.load(
'assets/$mobileScenePackageName',
);
// Path to a temporary directory on the device.
// NOTE: This location is not backed up and is suitable for storing
// caches of downloaded files, in this case, your mobile scene package.
final platformTempDir = await getTemporaryDirectory();
// Define the path on the device to the mobile scene package.
final pathToFile =
'${platformTempDir.absolute.path}/$mobileScenePackageName';
// Create a new file using the path to the mobile scene package.
final mobileScenePackageFile = File(pathToFile);
// Synchronously write the mobile scene package to the file
// on the device.
mobileScenePackageFile.writeAsBytesSync(
mobileScenePackageData.buffer.asUint8List(),
flush: true,
);
// Create a mobile scene package using the Uri to the mobile scene
// package file.
final mobileScenePackage = MobileScenePackage.withFileUri(
mobileScenePackageFile.uri,
);
// Load the metadata for the mobile scene package.
await mobileScenePackage.load();
// Check that the mobile scene package is not empty.
if (mobileScenePackage.scenes.isNotEmpty) {
// Display the first scene in the mobile scene package in the scene
// view controller.
_sceneViewController.arcGISScene = mobileScenePackage.scenes.first;
}
3 collapsed lines
}
}

Samples

Services