ArcGIS Runtime SDK for iOS: AGSScene Class Reference
ArcGIS Runtime SDK for iOS  100.15
AGSScene Class Reference

Description

A scene containing 3D geographic content.

Instance of this class represent a scene. It can be displayed on the screen by AGSSceneView. Thus, a scene represents the Model in an MVC architecture, and an AGSSceneView object represents the View. A scene specifies how the geographic data is organized, and a sceneview renders the data and allows users to interact with it.

Conceptually, a scene's geographic content is derived from its basemap and operationalLayers, which may be draped over a baseSurface to account for elevation.

A basemap helps orient the user and provides a geographical context for the content you want to display in the scene. It is used for locational reference and provides a framework on which you can overlay operational layers. Thus, the basemap serves as a foundation and provides a framework for working with information geographically. It's content is typically static and does not change frequently. For eg, streets, parcel boundaries, or geographic features such as rivers. Some basemaps also contain reference layers, such as labels, which are drawn on top of operational layers.

Operational layers provide content that is of unique interest to the application and the task at hand. Their content might change frequently. For example, earthquakes, traffic, or the weather.

The scene has a spatialReference which specifies how the geographic content from its basemap and operational layers is aligned when combined together.

See also
AGSMap for 2D geographic content.
Since
100
Inheritance diagram for AGSScene:
AGSGeoModel AGSLoadableBase AGSObject <AGSLoadable>

Instance Methods

(void) - cancelLoad
 
(void) - doCancelLoading
 
(void) - doStartLoading:
 
(instancetype) - init
 
(instancetype) - initWithBasemap:
 
(instancetype) - initWithBasemapStyle:
 
(instancetype) - initWithBasemapType:
 
(instancetype) - initWithItem:
 
(instancetype) - initWithTilingScheme:
 
(nullable instancetype) - initWithURL:
 
(void) - loadDidFinishWithError:
 
(void) - loadWithCompletion:
 
(void) - onLoadStatusChanged
 
(void) - retryLoadWithCompletion:
 

Class Methods

(__nullable id< AGSJSONSerializable >) + fromJSON:error:
 
(instancetype) + scene
 
(instancetype) + sceneWithBasemap:
 
(instancetype) + sceneWithBasemapStyle:
 
(instancetype) + sceneWithBasemapType:
 
(instancetype) + sceneWithItem:
 
(instancetype) + sceneWithTilingScheme:
 
(nullable instancetype) + sceneWithURL:
 

Properties

AGSBasemapbasemap
 
AGSSurfacebaseSurface
 
NSMutableArray< AGSBookmark * > * bookmarks
 
AGSGeoModelFloorDefinitionfloorDefinition
 
AGSFloorManagerfloorManager
 
AGSGeotriggersInfogeotriggersInfo
 
AGSViewpointinitialViewpoint
 
AGSItemitem
 
NSError * loadError
 
AGSLoadSettingsloadSettings
 
AGSLoadStatus loadStatus
 
NSMutableArray< AGSLayer * > * operationalLayers
 
AGSSceneViewTilingScheme sceneViewTilingScheme
 
AGSSpatialReferencespatialReference
 
NSMutableArray< AGSFeatureTable * > * tables
 
NSArray< AGSTransportationNetworkDataset * > * transportationNetworks
 
NSDictionary< NSString *, id > * unknownJSON
 
NSDictionary< NSString *, id > * unsupportedJSON
 
NSString * version
 

Method Documentation

◆ cancelLoad

- (void) cancelLoad
requiredinherited

Cancels loading if it is in progress, otherwise it does nothing. This should be called carefully because other objects could be waiting for loadWithCompletion: or retryLoadWithCompletion: to complete and this will call them all back with the error of NSUserCancelledError

Since
100

◆ doCancelLoading

- (void) doCancelLoading

Never call this method directly. The framework calls this method on a background thread when cancelLoad (AGSLoadable-p) is called. It is meant to be overriden by subclasses. Subclasses should override this method to cancel loading their data and call loadDidFinishWithError: (AGSLoadableBase(ForSubclassEyesOnly)) at the end passing in an error representing NSUserCancelledError.

Since
100

Provided by category AGSLoadableBase(ForSubclassEyesOnly).

◆ doStartLoading:

- (void) doStartLoading: (BOOL)  retrying

Never call this method directly. The framework calls this method on a background thread when loadWithCompletion: (AGSLoadable-p) or retryLoadWithCompletion: (AGSLoadable-p) is called. It is meant to be overriden by subclasses. Subclasses should override this method to load their data and call loadDidFinishWithError: (AGSLoadableBase(ForSubclassEyesOnly)) upon completion, passing in the error if any.

Parameters
retryingflag that is true if this method was called from retryLoadWithCompletion: (AGSLoadable-p).
Since
100

Provided by category AGSLoadableBase(ForSubclassEyesOnly).

◆ fromJSON:error:

+ (__nullable id<AGSJSONSerializable>) fromJSON: (id)  JSONObject
error: (NSError **)  error 

Initializes and returns an object from its JSON representation.

Parameters
JSONObjectNSDictionary or NSArray containing the JSON.
errorencountered during the operation, if any.
Since
100.3

◆ init

- (instancetype) init

Creates an empty scene.

Since
100.0

◆ initWithBasemap:

- (instancetype) initWithBasemap: (AGSBasemap *)  basemap

Creates a scene with the given basemap.

Parameters
basemapto use with the scene.
Since
100

◆ initWithBasemapStyle:

- (instancetype) initWithBasemapStyle: (AGSBasemapStyle basemapStyle

Creates a scene with a basemap.

Parameters
basemapStyleThe basemap style.
See also
AGSBasemapStyle
Since
100.10

◆ initWithBasemapType:

- (instancetype) initWithBasemapType: (AGSBasemapType)  basemapType

Creates a scene with a basemap. In order to take advantage of geographically load balanced services and monitor usage with API keys or named users, use initWithBasemapStyle:.

Parameters
basemapTypeThe basemap.
Since
100.0
Deprecated:
100.14.0. Use initWithBasemapStyle:.

Provided by category AGSScene(AGSDeprecated).

◆ initWithItem:

- (instancetype) initWithItem: (AGSItem *)  item

Creates a scene based on the given web scene item.

Parameters
itemthat represents a web scene on ArcGIS Online or an on-premises portal. Item's type must be AGSPortalItemTypeWebScene.
Since
100.3

◆ initWithTilingScheme:

- (instancetype) initWithTilingScheme: (AGSSceneViewTilingScheme tilingScheme

Creates a scene with the given tiling scheme.

Parameters
tilingSchemeto use with the scene.
Since
100.2.1

◆ initWithURL:

- (nullable instancetype) initWithURL: (NSURL *)  URL

Creates a scene based on the given web scene URL. The URL you pass can be one of three basic types. Examples of these types are:

◆ loadDidFinishWithError:

- (void) loadDidFinishWithError: (nullable NSError *)  error

Only subclasses should call this method in doStartLoading: (AGSLoadableBase(ForSubclassEyesOnly)) and doCancelLoading (AGSLoadableBase(ForSubclassEyesOnly)) when done loading or failed to load.

Since
100

Provided by category AGSLoadableBase(ForSubclassEyesOnly).

◆ loadWithCompletion:

- (void) loadWithCompletion: (nullable void(^)(NSError *__nullable error))  completion
requiredinherited

Loads data for the object asynchronously. The completion block is invoked upon completion.

You can call this method any number of times, however only one attempt is made to load the data. If it is already loading, it will just continue to load (i.e. not force a reload). If it has already loaded successfully, the completion block will be invoked right away. If it has already failed to load, the completion block will be invoked right away with error previously encountered. This method supports multiple callers and will call them all back on completion. However, each caller's completion block will be invoked once and only once.

Parameters
completionblock that is invoked when object loads successfully or fails to load. An error is passed to the block if the object fails to load.
Note
The completion block is always invoked on the main thread.
Since
100
See also
- cancelLoad to cancel loading
- retryLoadWithCompletion: to force reload

◆ onLoadStatusChanged

- (void) onLoadStatusChanged

Never call this method directly. The framework calls this method on a background thread when AGSLoadable::loadStatus changes is called. Subclasses can optionally implement this to know when their loading status has changed.

Since
100

Provided by category AGSLoadableBase(ForSubclassEyesOnly).

◆ retryLoadWithCompletion:

- (void) retryLoadWithCompletion: (nullable void(^)(NSError *__nullable error))  completion
requiredinherited

Tries to reload when an object has failed to load. This method should be called judiciously. It should be called when:

  1. you didn't have network connectivity earlier when it failed and you want to retry now that you have connectivity
  2. the server was down earlier when it failed and you want to retry
  3. the request is taking too long and you want to cancel it and retry, in which case you will first call cancelLoad and then this method

If the data hasn't started loading, it will start loading. If it is already loading, it will just continue to load. If it has already loaded successfully, calls back right away. If it has already failed to load, tries again. This method supports multiple callers and will call them all back on completion. However, each caller's completion block will be invoked once and only once.

Parameters
completionblock that is invoked when object loads successfully or fails to load. An error is passed to the block if the object fails to load.
Note
The completion block is always invoked on the main thread.
Since
100

◆ scene

+ (instancetype) scene

Creates a scene.

Returns
A new scene.
See also
AGSScene::load, AGSScene::requestRequired
Since
100.0

◆ sceneWithBasemap:

+ (instancetype) sceneWithBasemap: (AGSBasemap *)  basemap

Creates a scene with the given basemap.

Parameters
basemapto use with the scene.
Returns
A new scene created from the basemap.
Since
100

◆ sceneWithBasemapStyle:

+ (instancetype) sceneWithBasemapStyle: (AGSBasemapStyle basemapStyle

Creates a scene with a basemap.

Parameters
basemapStyleThe basemap style.
Returns
A new scene created from the basemapStyle.
See also
AGSBasemapStyle
Since
100.10

◆ sceneWithBasemapType:

+ (instancetype) sceneWithBasemapType: (AGSBasemapType)  basemapType

Creates a scene with a basemap. In order to take advantage of geographically load balanced services and monitor usage with API keys or named users, use sceneWithBasemapStyle:.

Parameters
basemapTypeThe basemap.
Returns
A new scene created from the basemapType.
Since
100.0
Deprecated:
100.14.0. Use sceneWithBasemapStyle:.

Provided by category AGSScene(AGSDeprecated).

◆ sceneWithItem:

+ (instancetype) sceneWithItem: (AGSItem *)  item

Creates a scene based on the given web scene item.

Parameters
itemthat represents a web scene on ArcGIS Online or an on-premises portal. Item's type must be AGSPortalItemTypeWebScene.
Returns
A new scene created from the item.
Since
100.3

◆ sceneWithTilingScheme:

+ (instancetype) sceneWithTilingScheme: (AGSSceneViewTilingScheme tilingScheme

Creates a scene with the given tiling scheme.

Parameters
tilingSchemeto use with the scene.
Returns
A new scene created from the tilingScheme.
Since
100.2.1

◆ sceneWithURL:

+ (nullable instancetype) sceneWithURL: (NSURL *)  URL

Creates a scene based on the given web scene URL. The URL you pass can be one of three basic types. Examples of these types are:

Property Documentation

◆ basemap

- (AGSBasemap*) basemap
readwritenonatomicstrong

The scene's basemap.

Since
100

◆ baseSurface

- (AGSSurface*) baseSurface
readwritenonatomicstrong

The base surface of this scene which provides an elevation context for the basemap and operational layers. The layers may be draped on or offset from this surface.

Since
100

◆ bookmarks

- (NSMutableArray<AGSBookmark *>*) bookmarks
readnonatomicstronginherited

The bookmarks for the map or scene.

See also
AGSBookmark
Since
100.12

◆ floorDefinition

- (AGSGeoModelFloorDefinition*) floorDefinition
readwritenonatomicstronginherited

Defines the properties that allow a map or a scene to be floor-aware.

Floor-aware maps and scenes contain data representing floor plan and indoor features. The data displayed by floor-aware maps and scenes can be filtered based on floor levels using the AGSFloorManager. This property is nil for maps or scenes that are not floor-aware. When this property is set, a new unloaded AGSGeoModel::floorManager is instantiated.

See also
AGSGeoModel::floorManager
Since
100.12

◆ floorManager

- (AGSFloorManager*) floorManager
readnonatomicstronginherited

Manages the data displayed for a floor-aware map or scene, allowing the data to be filtered based on floor levels.

This property is created using the floor-aware metadata defined by AGSGeoModel::floorDefinition, if not nil. This property is nil if the map/scene is not loaded or if the map/scene is not floor-aware. An AGSFloorManager must be loaded before you can access its properties and perform floor filtering.

See also
AGSFloorManager
Since
100.12

◆ geotriggersInfo

- (AGSGeotriggersInfo*) geotriggersInfo
readnonatomicstronginherited

An object that presents information on the set of AGSGeotrigger objects defined for the map or scene.

You must load the AGSGeotriggersInfo to populate the AGSGeotriggersInfo::geotriggers defined by the author of the map or scene. If no geotriggers were defined, the the collection will be empty.

Use an AGSGeotriggerMonitor to check each of the conditions defined in AGSGeotriggersInfo::geotriggers.

When you save the map, any AGSGeotrigger objects that reference local data (for example an AGSGraphicsOverlayFenceParameters) will be omitted.

Since
100.14

◆ initialViewpoint

- (AGSViewpoint*) initialViewpoint
readwritenonatomicstrong

The scene's initial viewpoint. This is the area initially displayed by an AGSSceneView object when the scene is used.

Since
100

◆ item

- (AGSItem*) item
readnonatomicstronginherited

The item for the map or scene.

An ID for a resource, such as an AGSPortalItem (for maps created from a portal) or an AGSLocalItem (for maps and scenes in a map or scene package). Note that a map or scene cannot be instantiated from an AGSLocalItem.

Since
100.12

◆ loadError

- (NSError*) loadError
readnonatomicstronginherited

The error that was encountered during the most recent load operation. Will be nil if the operation succeeded.

Since
100

◆ loadSettings

- (AGSLoadSettings*) loadSettings
readwritenonatomicstronginherited

Set default behaviors (preferences) and control the rendering behaviors for maps and scenes as they load.

Set preferences and control rendering behaviors when maps and scenes load. For example, you can specify which tiling mode should be used when feature layers are added or specify whether feature tables should use advanced symbology.

Since
100.12

◆ loadStatus

- (AGSLoadStatus) loadStatus
readrequirednonatomicassigninherited

Status of the load operation.

Since
100

◆ operationalLayers

- (NSMutableArray<AGSLayer *>*) operationalLayers
readnonatomicstronginherited

Layers that reference data from a file or a service and are typically used to visualize the data in a map or scene. For example, a fleet of vehicles being tracked on a map.

Operational layers, which display on top of the AGSBasemap::baseLayers property, are hosted and managed on the ArcGIS Platform as feature layers, KML layers, WFS layers, tile layers, and more. Several layer types can also be used by your ArcGIS Runtime app as local layers, such as feature layers and tiled layers. You cannot reuse a layer array coming from a different map or scene. Instead, you must create a new array of AGSLayer objects.

See also
AGSLayer, AGSBasemap::baseLayers
Since
100.12

◆ sceneViewTilingScheme

- (AGSSceneViewTilingScheme) sceneViewTilingScheme
readnonatomicassign

The AGSSceneViewTilingScheme as used to render tile based data. The default value is AGSSceneViewTilingSchemeWebMercator. The tiling scheme property is used by the AGSSceneView object to determine how to render tiled data. If this property was not set in advance of loading the scene it will be determined during the AGSScene::load. This will examine the AGSSpatialReference of the first tiled elevation source (see AGSArcGISTiledElevationSource) or tiled layer in the basemap or operational layers (see AGSArcGISTiledLayer) to choose either AGSSceneViewTilingSchemeGeographic or AGSSceneViewTilingSchemeWebMercator values. The AGSSceneViewTilingScheme must correspond to the AGSSpatialReference for those layers to render correctly.

Since
100.2.1

◆ spatialReference

- (AGSSpatialReference*) spatialReference
readnonatomicstronginherited

A well-known ID (WKID) integer value or a text string definition referred to as a well-known text (WKT) representation that identifies how a geometry's coordinates relate to real-world space.

Spatial reference ensures that spatial data in different layers or graphic overlays can be used together for accurate viewing or analysis.

See also
AGSSpatialReference
Since
100.12

◆ tables

- (NSMutableArray<AGSFeatureTable *>*) tables
readnonatomicstronginherited

An array of tables in the map or scene. Unlike AGSGeoModel::operationalLayers, tables are not displayed by the AGSGeoView.

Tables can be added and removed. Tables are not loaded by default. Tables are loaded internally when asynchronous operations like query are performed. Alternatively, they can be loaded by calling AGSFeatureTable::load.

See also
AGSFeatureTable, NSMutableArray, NSMutableArray::initWithValueType:
Since
100.12

◆ transportationNetworks

- (NSArray<AGSTransportationNetworkDataset *>*) transportationNetworks
readnonatomiccopyinherited

An array of transportation network datasets defined for the map or scene.

Map and scene authors can use ArcGIS Pro to create mobile map or scene packages containing maps and scenes that include transportation networks. If so, this property will be populated with the collection of AGSTransportationNetworkDataset objects.

An AGSTransportationNetworkDataset from this array can be used to construct one of the network analysis tasks (such as AGSRouteTask, AGSServiceAreaTask, and AGSClosestFacilityTask).

See also
AGSRouteTask, AGSMobileScenePackage
Since
100.12

◆ unknownJSON

- (NSDictionary<NSString*,id>*) unknownJSON
readnonatomiccopy

A dictionary of values that was in the source JSON but was unparsed by API.

Since
100.3

◆ unsupportedJSON

- (NSDictionary<NSString*,id>*) unsupportedJSON
readnonatomiccopy

A dictionary of values that are supported by the REST API, but not exposed through the SDK API.

Since
100.3

◆ version

- (NSString*) version
readnonatomiccopyinherited

The version of the AGSMap or AGSScene, read when it is opened.

The version of a newly created AGSMap or AGSScene is empty. The version that the map or scene is saved to might differ from the version it was opened at. The version saved depends on the ArcGIS Runtime version.

Since
100.12