ArcGIS Runtime SDK for iOS: AGSGenerateOfflineMapParameters Class Reference
ArcGIS Runtime SDK for iOS  100.9
AGSGenerateOfflineMapParameters Class Reference

Description

Parameters used with AGSOfflineMapTask to take a map offline.

Instances of this class represent parameters that are used with generateOfflineMapJobWithParameters:downloadDirectory: (AGSOfflineMapTask) to create a job that can take a map offline.

See also
- defaultGenerateOfflineMapParametersWithAreaOfInterest:completion: (AGSOfflineMapTask) convenience method to get parameters that are initialized with appopriate default values for a map.
Since
100.1
Inheritance diagram for AGSGenerateOfflineMapParameters:
AGSObject

Instance Methods

(instancetype) - initWithAreaOfInterest:minScale:maxScale:
 

Class Methods

(instancetype) + generateOfflineMapParameters
 
(instancetype) + generateOfflineMapParametersWithAreaOfInterest:minScale:maxScale:
 

Properties

AGSGeometryareaOfInterest
 
AGSAttachmentSyncDirection attachmentSyncDirection
 
BOOL continueOnErrors
 
BOOL definitionExpressionFilterEnabled
 
AGSDestinationTableRowFilter destinationTableRowFilter
 
BOOL includeBasemap
 
AGSOfflineMapItemInfoitemInfo
 
double maxScale
 
double minScale
 
AGSOnlineOnlyServicesOption onlineOnlyServicesOption
 
NSURL * referenceBasemapDirectory
 
NSString * referenceBasemapFilename
 
AGSReturnLayerAttachmentOption returnLayerAttachmentOption
 
BOOL returnSchemaOnlyForEditableLayers
 
AGSGenerateOfflineMapUpdateMode updateMode
 

Method Documentation

§ generateOfflineMapParameters()

+ (instancetype) generateOfflineMapParameters

§ generateOfflineMapParametersWithAreaOfInterest:minScale:maxScale:()

+ (instancetype) generateOfflineMapParametersWithAreaOfInterest: (AGSGeometry *)  areaOfInterest
minScale: (double)  minScale
maxScale: (double)  maxScale 

Initialize the parameters with the provided information for taking a map offline.

Parameters
areaOfInterestAn AGSPolygon or AGSEnvelope geometry that defines the geographic area for which the map data (features and tiles) should be taken offline
minScaleThe minimum scale for which map tiles are needed. There won't be any tiles offline when the map is zoomed out beyond this scale.
maxScaleThe maximum scale for which map tiles are needed. There won't be any tiles offline when the map is zoomed in beyond this scale.
Returns
initialized parameters
Since
100.1

§ initWithAreaOfInterest:minScale:maxScale:()

- (instancetype) initWithAreaOfInterest: (AGSGeometry *)  areaOfInterest
minScale: (double)  minScale
maxScale: (double)  maxScale 

Initialize the parameters with the provided information for taking a map offline.

Parameters
areaOfInterestAn AGSPolygon or AGSEnvelope geometry that defines the geographic area for which the map data (features and tiles) should be taken offline
minScaleThe minimum scale for which map tiles are needed. There won't be any tiles offline when the map is zoomed out beyond this scale.
maxScaleThe maximum scale for which map tiles are needed. There won't be any tiles offline when the map is zoomed in beyond this scale.
Returns
initialized parameters
Since
100.1

Property Documentation

§ areaOfInterest

- (AGSGeometry*) areaOfInterest
readwritenonatomicstrong

An AGSPolygon or AGSEnvelope geometry that defines the geographic area for which the map data (features and tiles) should be taken offline. Where an AGSPolygon is supplied, features and tiles will be filtered according to the polygon geometry, which can help reduce the size of the resulting offline map. Note that the filtered set of tiles may vary, depending on the underlying service.

Since
100.1

§ attachmentSyncDirection

- (AGSAttachmentSyncDirection) attachmentSyncDirection
readwritenonatomicassign

Specifies how sync-enabled feature layers in the offline map should be configured to sync attachment data with their originating service. This property should be used in conjunction with returnLayerAttachmentOption to determine which layers should be taken offline with attachments included.

This property is valid when the service resource sync capabilities includes supportsAttachmentsSyncDirection otherwise it is ignored. This property works in conjunction with returnLayerAttachmentOption and in some cases may have its value overridden as shown below:

Layer Attachment Option Valid Attachment Sync Direction Note
None None
Upload
All Layers Upload
Bidirectional
Read Only Layers None Layers with attachments will treat this as attachmentSyncDirection = Bidirectional
Upload
Bidirectional Layers without attachments will treat this as attachmentSyncDirection = None
Editable Layers None Layers with attachments will treat this as attachmentSyncDirection = Bidirectional
Upload
Bidirectional Layers without attachments will treat this as attachmentSyncDirection = None
Note
If AGSGenerateOfflineMapParameters is used in conjunction with AGSGenerateOfflineMapParameterOverrides this property is superseded.
Since
100.1

§ continueOnErrors

- (BOOL) continueOnErrors
readwritenonatomicassign

Indicates whether or not the job should continue running in the event of a failure to take a layer offline. If this property is true, failure to take a layer or table offline will not fail the job, the failure will be exposed in the job result. If this property is false, failure to take a layer or table offline will fail the job and no more layers or tables will be taken offline. The layer or table's error will be available as the job's error. Default value is true

Since
100.4

§ definitionExpressionFilterEnabled

- (BOOL) definitionExpressionFilterEnabled
readwritenonatomicassign

A value of true allows the AGSGenerateOfflineMapJob to use the SQL where clause in AGSFeatureLayer::definitionExpression as a filter when generating offline geodatabases. Applying the definition expression may reduce the number of features taken offline for display and sync. If the value is false this could result in a larger geodatabase than is required to display the feature layer. The default value is true. For tables the definition expression is taken from the property AGSServiceFeatureTable::definitionExpression.

Note
If AGSGenerateOfflineMapParameters is used in conjunction with AGSGenerateOfflineMapParameterOverrides this property is superseded.
Since
100.3

§ destinationTableRowFilter

- (AGSDestinationTableRowFilter) destinationTableRowFilter
readwritenonatomicassign

Specifies whether tables in relationships will contain all rows or can be filtered to a smaller set of related rows. Setting this to AGSDestinationTableRowFilterRelatedOnly can substantially reduce the number of rows in offline tables to only those that are related to rows from other layers or tables. Only tables present in AGSMap::tables are considered as candidates for filtering. This does not apply when the table:

§ includeBasemap

- (BOOL) includeBasemap
readwritenonatomicassign

Indicates whether or not a basemap will be included in the offline map.

If you do not want a basemap in the offline map, then set this property to NO. After loading the offline map, your application can programmatically insert a basemap into the map. Note that a programmatically inserted basemap will not be persisted in the map.

If you want a basemap in the offline map, then set this property to YES. You can choose to either: Generate and download the online basemap using the AGSGenerateOfflineMapJob. This is the default. Use a local basemap on the device by setting the AGSGenerateOfflineMapParameters::referenceBasemapDirectory.

The default value is YES. This property is superseded if the AGSGenerateOfflineMapParameters is used in conjunction with AGSGenerateOfflineMapParameterOverrides.

Since
100.1

§ itemInfo

- (AGSOfflineMapItemInfo*) itemInfo
readwritenonatomicstrong

Metadata about the map that should be persisted when it is taken offline. When using the convenience method defaultGenerateOfflineMapParametersWithAreaOfInterest:completion: (AGSOfflineMapTask) to get the default parameters, this metadata is initialized based on the map's portal item.

Since
100.1

§ maxScale

- (double) maxScale
readwritenonatomicassign

The maximum scale for how far in to extract tiles from tile caches. This also determines the offline map's AGSMap::maxScale property. The 0 default means extract the levels down to the most detailed.

Note
This is used as input for levels of detail for AGSTileCache and AGSVectorTileCache. This is not applicable to offline data in AGSGeodatabase. A minScale of 100000 and a maxScale of 500 will select level IDs between 1:500 and 1:100,000 scale. A minScale of 0 and a maxScale of 500 will select all global level IDs down to 1:500 scale. A minScale of 100000 and a maxScale of 0 will select level IDs from 1:100,000 scale to the most detailed available level. If AGSGenerateOfflineMapParameters is used in conjunction with AGSGenerateOfflineMapParameterOverrides, this property is superseded for individual layers tile caches. Note that this property only sets the levels of detail to download for tiled data. The offline basemap layers will use the same max scale as in the online web map (either defined by the service or on the layer itself) to allow zooming in.
Since
100.1

§ minScale

- (double) minScale
readwritenonatomicassign

The minimum scale for how far out data will be in tile caches. This also determines the offline map's AGSMap::minScale property. The 0 default means extract all the available detailed levels to global scales.

Note
This is used as input for levels of detail for AGSTileCache. This is not applicable to offline data in AGSVectorTileCache or AGSGeodatabase. A minScale of 100000 and a maxScale of 500 will select level IDs between 1:500 and 1:100,000 scale. A minScale of 0 and a maxScale of 500 will select all global level IDs down to 1:500 scale. A minScale of 100000 and a maxScale of 0 will select level IDs from 1:100,000 scale to the most detailed available level. If AGSGenerateOfflineMapParameters is used in conjunction with AGSGenerateOfflineMapParameterOverrides, this property is superseded for individual layers tile caches. Note that this property only sets the levels of detail to download for tiled data. The offline basemap layers will use the same min scale as in the online web map (either defined by the service or on the layer itself).
Since
100.1

§ onlineOnlyServicesOption

- (AGSOnlineOnlyServicesOption) onlineOnlyServicesOption
readwritenonatomicassign

Describes how data that requires an online service will be handled when taking a map offline. Online layers and tables cannot be taken offline in the following situations:

  • The layer or table is using a service that cannot be taken offline. For example, AGSWMSLayer or AGSWMTSLayer.
  • The layer or table is using a service that supports offline, such as an ArcGISFeatureLayer, but synchronization has not been enabled on the service (AGSFeatureServiceCapabilities::supportsSync is set to NO). Services utilize synchronization to take layers and tables offline and synchronize changes.

Online services that cannot be taken offline are referred to as online-only services. Online-only services require network connectivity and may involve authentication. Examples of online-only services include:

  • Dynamic information, such as changing weather or traffic conditions, that delivers frequent and regular updates to the app.
  • Large datasets that would be impractical to take offline to a device.

This property allows you to specify how online-only data will be handled when taking the map offline. There are two options:

  • AGSOnlineOnlyServicesOptionExclude means that any data that cannot be taken offline will be omitted from the offline map. Choosing this option means that your offline map will not require a network connection but may not include all of the data from the original web map.
  • AGSOnlineOnlyServicesOptionInclude means that data that cannot be taken offline will be accessed via the URL in the offline map. Choosing this option means that your offline map will retain all of the information from the original web map, but it will require a network connection and may require authentication.

The default value is AGSOnlineOnlyServicesOptionExclude.

Since
100.9

§ referenceBasemapDirectory

- (NSURL*) referenceBasemapDirectory
readwritenonatomicstrong

The path to a directory on the device where the local basemap file is located.

Set this property to use a basemap that is already on the device (rather than downloading it). The directory should only be set when the parameters have an AGSGenerateOfflineMapParameters::referenceBasemapFilename defined.

This property supports any directory specified as either: an absolute path a path relative to the parent directory of the generated mobile map package (see download path for generateOfflineMapJobWithParameters:downloadDirectory: (AGSOfflineMapTask)).

If the directory does not exist, or does not contain the specified basemap, the AGSGenerateOfflineMapJob will fail.

Note that the mobile map package will store either a relative or absolute path to the reference basemap file so that it can be opened in the future.

A relative path typically begins with "./" to denote the parent directory of the resulting mobile map package or "../" to move up one directory. The parent directory of the mobile map package will be set when calling generateOfflineMapJobWithParameters:downloadDirectory: (AGSOfflineMapTask).

For example, to generate a mobile map package to "[my root path]/my_offline_maps/my_mobile_map_package", that uses a reference basemap in "[my root path]/other_maps/my_basemap.tpk", you would set the relative path as follows: AGSGenerateOfflineMapJob::downloadDirectory to "[my root path]/my_offline_maps/my_mobile_map_package" AGSGenerateOfflineMapParameters::referenceBasemapDirectory to "../other_maps" AGSGenerateOfflineMapParameters::referenceBasemapFilename to "my_basemap.tpk"

Note that this property is ignored if AGSGenerateOfflineMapParameters::includeBasemap is NO.

Since
100.5

§ referenceBasemapFilename

- (NSString*) referenceBasemapFilename
readwritenonatomiccopy

The name of a local basemap file on the device that can be used rather than downloading an online basemap. The local basemap filename must end with .tpk, .tpkx or .vtpk since these are the supported file formats. This property can be read directly from settings applied by the author of the online web map (see AGSOfflineSettings) or set by user code to a file known to be on the device. This property will be populated from online settings when created with AGSOfflineMapTask::defaultGenerateOfflineMapParametersWithAreaOfInterest:minScale:maxScale:completion. If you wish to use the specified local basemap rather than downloading, you must also set AGSGenerateOfflineMapParameters::referenceBasemapDirectory. If the directory does not exist, or does not contain the specified basemap, the AGSGenerateOfflineMapJob will fail. The spatial reference of the reference basemap is used for the offline map when it is different to the online map's spatial reference. Note that this property is ignored if AGSGenerateOfflineMapParameters::includeBasemap is false.

Since
100.5

§ returnLayerAttachmentOption

- (AGSReturnLayerAttachmentOption) returnLayerAttachmentOption
readwritenonatomicassign

Specifies whether or not to include attachments for feature layers when taking the map offline. Attachments can be included with none of the layers, all of the layers, read only layers or editable layers. This option should be used in conjunction with attachmentSyncDirection to control how the attachments are synced.

For offline maps, a feature layer is considered to be editable if the feature service has capabilities that include any of create, update or delete. A read-only layer is one that supports sync, but does not have any of create, update or delete capability. Service capabilities are accessible from service infos. For more information, see AGSArcGISFeatureServiceInfo::featureServiceCapabilities or AGSArcGISFeatureLayerInfo::capabilities.

Layer Attachment Option Valid Attachment Sync Direction Note
None None
Upload
All Layers Upload
Bidirectional
Read Only Layers None Layers with attachments will treat this as attachmentSyncDirection = Bidirectional
Upload
Bidirectional Layers without attachments will treat this as attachmentSyncDirection = None
Editable Layers None Layers with attachments will treat this as attachmentSyncDirection = Bidirectional
Upload
Bidirectional Layers without attachments will treat this as attachmentSyncDirection = None
Note
If AGSGenerateOfflineMapParameters is used in conjunction with AGSGenerateOfflineMapParameterOverrides this property is superseded.
Since
100.1

§ returnSchemaOnlyForEditableLayers

- (BOOL) returnSchemaOnlyForEditableLayers
readwritenonatomicassign

Specifies whether to only include the schema or also include data for feature layers when taking the map offline.

Note
If AGSGenerateOfflineMapParameters is used in conjunction with AGSGenerateOfflineMapParameterOverrides this property is superseded.
Since
100.1

§ updateMode

- (AGSGenerateOfflineMapUpdateMode) updateMode
readwritenonatomicassign

Describes how the offline map will support synchronization with online services.

A value of AGSGenerateOfflineMapUpdateModeSyncWithFeatureServices instructs the AGSGenerateOfflineMapJob to create offline geodatabases that support syncing with online feature services.

A value of AGSGenerateOfflineMapUpdateModeNoUpdates instructs the AGSGenerateOfflineMapJob to disable data synchronization for generated offline geodatabases. In this case, no synchronization replicas will be created on corresponding feature services. This reduces the load on the feature server and frees the developer from needing to unregister server replicas when they are no longer needed.

The default value is AGSGenerateOfflineMapUpdateModeSyncWithFeatureServices.

If AGSGenerateOfflineMapParameters is used in conjunction with AGSGenerateOfflineMapParameterOverrides this property is superseded by the AGSGenerateGeodatabaseParameters::syncModel property of the overridden layer.

See also
AGSGenerateGeodatabaseParameters::syncModel
Since
100.9