You can use ArcGIS Pro to consolidate your scenes into a single mobile scene package (.mspk) that can be taken offline. Each package can contain scenes, elevation sources and any data necessary for your users to continue working when connectivity is poor or non-existent. Mobile scene packages can include basemaps, operational layers, 3D scene layers, tiled layers (.tpkx,.vtpk), tables, relationship classes, locators, and elevation sources. Each package adheres to a common scene definition, allowing you to transport your scenes and data across the ArcGIS platform.
With ArcGIS Pro 2.6 (or later) you can include online layers and tables in your scenes, such as traffic information, weather conditions, or a large company data-set. If your user's device has network connectivity they can take advantage of these online layer. If the connection is unavailable, users can continue to work with the scenes and data that is stored locally in the mobile scene package.
Create a mobile scene package with ArcGIS Pro
- Locate the ArcGIS Pro tool called Create Mobile Scene Package in the Data Management Toolbox. You can use this to create a mobile scene package containing any number of scenes.
- If needed, set an expiration date on the mobile scene package. This is available with ArcGIS Pro 2.4 (or later) with the ArcGIS Publisher extension license.
- If you want include online layers and tables in the scenes, you need to check on the "Reference online content". This is available with ArcGIS Pro 2.6 (or later).
- Save the package to ArcGIS Online, ArcGIS Enterprise, or to a folder on your device.
- You can download the mobile scene package from ArcGIS Online or ArcGIS Enterprise directly onto your device using the ArcGIS Runtime API. Alternatively, you can copy the package directly to your device.
Open the mobile scene package
To create the mobile scene package object, pass the mobile scene package file path MobileScenePackage constructor. Load the package and access its collection of scenes. Passing the scene to the scene view will initiate loading the scene, its layers, and data.
You can access the metadata from the mobile scene package, without loading the scenes from the MobileScenePackage.Item property. After loading a scene, its metadata is accessible using the Scene.Item property.
If the mobile scene package was created with ArcGIS Pro 2.6 (or later) it may contain online layers or tables. In this case your app may need to handle authentication before the layers and tables are loaded.
If the mobile scene package was created with ArcGIS Pro 2.4 (or later) it can have an expiration date. If you do not handle the potential expiration the mobile scene package may fail to load.
Handle mobile scene package expiration
Mobile scene packages, created with ArcGIS Pro 2.4 (or later), can have an expiration date set. This gives the author more control over the lifetime of the package's data. For example, it will allow you to do the following:
- Provide data to third-party contractors that will expire at the end of a contract.
- Indicate to your users that the data is now obsolete.
As an ArcGIS Runtime developer, there are three possible outcomes when you try to load a mobile scene package:
- You have full access to the mobile scene package and their scenes. This situation occurs if the package has been created without any expiration properties or if it has not expired.
- You have full access to the mobile scene package and their scenes, even though the scenes and their data have expired. You will be warned that the package is out of date.
- You cannot access the mobile scene package and their scenes because it has expired. In this case, the package will fail to load and you will not be able to access its scenes and data.
These three outcomes are managed by the mobile scene package load process MobileScenePackage.Load . No extra workflow or code paths are required to accommodate this.
If you want to provide your users with extra information, you can retrieve the expiration details from the expiration property on the MobileScenePackage. For example, you could display how many days remain before the package expires by doing the following:
- Load the mobile scene package.
- Read the expiration property on the mobile scene package.
- Confirm that it has not expired.
- Get the expiration date.
- Calculate the number of days between today and the expiration date. Report the number of days remaining.