Skip To Content ArcGIS for Developers Sign In Dashboard

MobileScenePackage QML Type

Instances of this class represent a mobile scene package (.mspk file). More...

Import Statement: import Esri.ArcGISRuntime 100.9
Since: Esri.ArcGISRuntime 100.5
Inherits:

Object

Properties

Signals

Methods

Detailed Description

Mobile scene packages allow you to work with 3D scenes on a mobile device. A mobile scene package contains all of the files necessary to work with your scenes and is stored on a device as either:

  • A single archive file with an .mspk extension.
  • A directory containing an unpacked mobile scene package.

A mobile scene package can encapsulate one or more scenes, their layers and data, transportation networks and a locator. The mobile scene package also contains an ArcGISItem with metadata about the package (description, thumbnail, etc.). You can use these packages to share scenes across the ArcGIS platform and to allow your users to work with scenes in the field. Mobile scene packages also allow you to continue working when you have limited connectivity.

Starting with ArcGIS Pro 2.3 you can create mobile scene packages for use in ArcGIS Runtime. This version of ArcGIS Runtime will support any mobile scene package up to major version 3.

Mobile scene packages can contain links to online services, but be aware that these services will be unavailable if your device is offline. You can choose whether to use:

  • A tile package (.tpkx) or an online basemap as the Scene::basemap.
  • A mobile geodatabase (.geodatabase) or an online feature service as one of the Scene::operationalLayers.
  • Local raster data (such as a DTED, GeoTIFF) or online image services as the elevation sources in a Scene::baseSurface

Online services (such as traffic or weather) can provide excellent contextual information for your users. If the mobile scene package is going to be used in areas of poor connectivity, however, you must ensure that data critical to your workflow is stored locally on the device.

Mobile scene packages implement the Loadable interface; you need to load the MobileScenePackage before you can access its content. Once loaded you can:

  • Determine the version of this package using the MobileScenePackage::version property. ArcGIS Runtime currently supports mobile scene packages up to and including major version 3. If the package is from an unsupported version it will fail to load.
  • Discover whether the package has expired using the MobileScenePackage::expiration property.
  • Access the individual scenes and display them in a SceneView.
  • Programmatically add, modify, and remove layers in the scene. Mobile scene packages, however, are read-only and these changes to scenes or layers will not be persisted to the device.

See also Loadable.

Property Documentation

expiration : Expiration

Expiration details for this mobile scene package, if provided. (read-only).

Expiration details provide:

  • The package’s expiration date and time.
  • Whether the scenes can be accessed after expiration.
  • Any messages relevant for the user.

By publishing a package with expiration details, the author can control the experience an end-user has when they try to access information that is no longer valid. For example, for time limited data (such as major sporting events), the author can ensure that the data cannot be accessed after the expiry date.

These expiration details can be specified when the author creates a mobile scene package using ArcGIS Pro (from version 2.4). This requires the ArcGIS Pro Publisher Extension.

During package loading, the ArcGIS Runtime will determine whether the mobile scene package was authored with expiration. If so, then this property will be populated.

If the package has expired and was authored as Enums.ExpirationTypePreventExpiredAccess, loading will fail and you will not be able to access the scenes. The expiration details will be accessible for you to examine and/or communicate to the user.


item : ArcGISItem

Returns an ArcGISItem object describing the contents of the mobile scene package (read-only).

The item includes the metadata that was provided by the mobile scene package author in ArcGIS Pro. This includes information such as:

  • Title
  • Snippet (summary)
  • Description
  • Tags
  • Thumbnail

A mobile scene package's item will be an instance of a LocalItem.

Returns null if the package is not loaded.


loadError : Error

Returns the load error (read-only).

Note: load errors are also reported on the error property and emit the errorChanged signal.

See also Loadable.


loadStatus : Enums.LoadStatus

Returns the load status (read-only).

See also Loadable and Enums.LoadStatus.


locatorTask : LocatorTask

Returns the locator contained in the mobile scene package as a LocatorTask (read-only).

Use this task to geocode and reverse-geocode addresses and places. There is only one LocatorTask in each mobile scene package but it can be used by all scenes.

Returns null if there is no LocatorTask in the package, or the package is not loaded.


path : void

The path of the mobile scene package.

The path can refer to a file with an .mspk extension or a directory containing an unpacked mobile scene package.


scenes : list<Scene>

Returns a list of the scenes contained in the mobile scene package (read-only).

To use the scenes in a MobileScenePackage, you first need to load the package. The scenes are presented in the same order in which they were packaged with ArcGIS Pro. To display a Scene set the scene to a SceneView. This will automatically load the scene and all of its content. If you only need to access the scene's content or metadata, then you need to load it by calling Scene::load.

If the package is not loaded, an empty collection is returned.


version : string

Returns the version of this mobile scene package (read-only).

The mobile scene package version was set when the package was authored in ArcGIS Pro.

This property is populated when you attempt to load the package. The version property will always be populated, for you to examine, even if the package is an unsupported version.

ArcGIS Runtime currently supports mobile scene packages up to and including major version 3.

You may wish to check the version property before trying to access specific functionality. For example:

  • Expiration details are only available in mobile scene package from version 1.1 onwards.
  • Links to online services are only available in mobile scene package from version 3.0 onwards.

If the package fails to load, check that the version number does not exceeded the supported major version.


Signal Documentation

expirationChanged()

Emitted when the expiration property changes.

Note: The corresponding handler is onExpirationChanged.


itemChanged()

Emitted when the item property changes.

Note: The corresponding handler is onItemChanged.


loadErrorChanged()

Emitted when the loadError property changes.

Note: load errors are also reported on the error property and emit the errorChanged signal.

Note: The corresponding handler is onLoadErrorChanged.

See also Loadable and Object.


loadStatusChanged()

Emitted when the loadStatus property changes.

Note: The corresponding handler is onLoadStatusChanged.

See also Loadable.


locatorTaskChanged()

Emitted when the locatorTask property changes.

Note: The corresponding handler is onLocatorTaskChanged.


pathChanged()

Emitted when the path property changes.

Note: The corresponding handler is onPathChanged.


scenesChanged()

Emitted when the scenes property changes.

Note: The corresponding handler is onScenesChanged.


versionChanged()

Emitted when the version property changes.

Note: The corresponding handler is onVersionChanged.


Method Documentation

void cancelLoad()

See also Loadable.


void close()

Closes a mobile scene package and frees file locks on the underlying .mspk file or directory.

All references to mobile scene package data (scenes, layers, tables, networks, locators, etc.) should be released before closing the package. If active references to mobile scene package data exist, this method will still close the package, but subsequent rendering and data access methods will fail. Results of accessing mobile scene package data after close are undefined.

After closing a mobile scene package, the underlying .mspk file or directory can be moved or deleted.

Closing a mobile scene package is not necessary if the package has not been loaded.

This method was introduced in Esri.ArcGISRuntime 100.6.

See also MobileMapPackage::close and Geodatabase::close.


void load()

See also Loadable.


void retryLoad()

See also Loadable.



Feedback on this topic?