ArcGIS Runtime SDK for iOS: AGSGenerateOfflineMapParameters Class Reference
ArcGIS Runtime SDK for iOS  100.7
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
 
NSURL * referenceBasemapDirectory
 
NSString * referenceBasemapFilename
 
AGSReturnLayerAttachmentOption returnLayerAttachmentOption
 
BOOL returnSchemaOnlyForEditableLayers
 

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

Specifies whether the basemap should be included when the map is taken offline. When this property is set to NO, the offline map will not contain any basemap layers. At a later stage, an application can programmatically insert a basemap after loading the offline map - for example, to provide the option for switching between basemaps at runtime. Note that, programmatically inserting a basemap into an offline map will not be persisted.

When this property is set to YES, the AGSGenerateOfflineMapJob will download the online basemap unless AGSGenerateOfflineMapParameters::referenceBasemapDirectory has been set. Setting a directory indicates that the offline map should use a basemap on the device rather than downloading.

Note
If AGSGenerateOfflineMapParameters is used in conjunction with AGSGenerateOfflineMapParameterOverrides this property is superseded.
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

§ referenceBasemapDirectory

- (NSURL*) referenceBasemapDirectory
readwritenonatomicstrong

The path to a directory on the device where the local basemap file is located. This property should be set (along with AGSGenerateOfflineMapParameters::referenceBasemapFilename) in order to to use a basemap which is already on the device, rather than downloading. This property supports any directory specified as either an absolute path or a path relative to the parent directory of the mobile map package. If the directory does not exist, or does not contain the specified basemap, the AGSGenerateOfflineMapJob will fail. Note that this property is ignored if AGSGenerateOfflineMapParameters::includeBasemap is false.

Since
100.5

§ referenceBasemapFilename

- (NSString*) referenceBasemapFilename
readwritenonatomiccopy

The name of a local basemap file on the device which 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