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

Description

Parameters used with a AGSOfflineMapTask object 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
 
AGSEsriVectorTilesDownloadOption esriVectorTilesDownloadOption
 
BOOL includeBasemap
 
AGSOfflineMapItemInfoitemInfo
 
double maxScale
 
double minScale
 
AGSOnlineOnlyServicesOption onlineOnlyServicesOption
 
NSURL * referenceBasemapDirectory
 
NSString * referenceBasemapFilename
 
AGSReturnLayerAttachmentOption returnLayerAttachmentOption
 
BOOL returnSchemaOnlyForEditableLayers
 
AGSGenerateOfflineMapUpdateMode updateMode
 

Method Documentation

◆ generateOfflineMapParameters

+ (instancetype) generateOfflineMapParameters

Creates a parameters object.

Returns
A new parameters object.
Since
100.1

◆ generateOfflineMapParametersWithAreaOfInterest:minScale:maxScale:

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

Creates a parameters object 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
A new parameters object.
Since
100.1

◆ initWithAreaOfInterest:minScale:maxScale:

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

Creates a parameters object 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.
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 object 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 the returnLayerAttachmentOption property 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 the returnLayerAttachmentOption property 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 YES, 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 NO, 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 YES.

Since
100.4

◆ definitionExpressionFilterEnabled

- (BOOL) definitionExpressionFilterEnabled
readwritenonatomicassign

A value of YES allows the AGSGenerateOfflineMapJob object to use the SQL where clause in the AGSFeatureLayer::definitionExpression propety 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 NO this could result in a larger geodatabase than is required to display the feature layer. The default value is YES. For tables, the definition expression is taken from the property AGSServiceFeatureTable::definitionExpression.

Note
If the AGSGenerateOfflineMapParameters object is used in conjunction with the AGSGenerateOfflineMapParameterOverrides object, 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 AGSGeoModel::tables are considered as candidates for filtering.

This does not apply when the table:

◆ esriVectorTilesDownloadOption

- (AGSEsriVectorTilesDownloadOption) esriVectorTilesDownloadOption
readwritenonatomicassign

Describes how Esri vector tiled basemap layers will be downloaded.

This property lets you choose how to download Esri vector tiled basemap layers. This property only applies when taking an Esri vector tile basemap service offline.

When taking an Esri vector tiled basemap service offline (e.g. to create an AGSVectorTileCache on your device), you can choose from different versions of the service depending on your use case.

Primary considerations are the download speed and the size of the resulting .vtpk file. Among other things, file size is influenced by the number of fonts downloaded from the service. Esri vector tiled basemap layers use fonts as part of their style resources - see the vector-tile-style documentation. When you take a vector tiled layer offline, these fonts are downloaded as part of the AGSVectorTileCache.

Esri services also offer an alternative version with a reduced font package size. This omits the large Arial Unicode font, which greatly reduces the download size. You can view the set of reduced font vector tile services here.

  • If you choose AGSEsriVectorTilesDownloadOptionUseOriginalService, the full set of resources used by the original online service, including all fonts, will be downloaded. This increases the download size of the AGSVectorTileCache but ensures that the offline layer will display the same as the original online data.
  • If you choose AGSEsriVectorTilesDownloadOptionUseReducedFontsService, the smaller set of fonts used by the alternative, for export, version of the service will be downloaded. This reduces the download size of the AGSVectorTileCache but is not suitable for all locales or when your offline vector tiled layer includes certain language characters. For example, this option will not display Chinese, Japanese, Thai, Korean or Georgian characters. If an alternative, for export version of the service cannot be found, the original service will be used.

The default value is AGSEsriVectorTilesDownloadOptionUseOriginalService.

Since
100.10

◆ 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:

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

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 theAGSGenerateOfflineMapParameters object is used in conjunction with the AGSGenerateOfflineMapParameterOverrides object, 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 an AGSVectorTileCache or AGSGeodatabase object. 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 the AGSGenerateOfflineMapParameters object is used in conjunction with the AGSGenerateOfflineMapParameterOverrides object, 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 (the AGSFeatureServiceCapabilities::supportsSync property 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 three 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.
  • AGSOnlineOnlyServicesOptionUseAuthoredSettings means that layers and tables will be taken offline, remain online or be omitted from the offline map according to the map author's intent as defined in the web map

The default value is AGSOnlineOnlyServicesOptionExclude.

See also
AGSOfflineSettings::onlineLayers, AGSOfflineSettings::onlineTables
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:

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:

Note that this property is ignored if the AGSGenerateOfflineMapParameters::includeBasemap property 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 NO.

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 the attachmentSyncDirection proprety 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 the AGSGenerateOfflineMapParameters object is used in conjunction with the AGSGenerateOfflineMapParameterOverrides object 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 the AGSGenerateOfflineMapParameters object is used in conjunction with the AGSGenerateOfflineMapParameterOverrides object 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 object to create offline geodatabases that support syncing with online feature services.

A value of AGSGenerateOfflineMapUpdateModeNoUpdates instructs the AGSGenerateOfflineMapJob object 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 the AGSGenerateOfflineMapParameters object is used in conjunction with the AGSGenerateOfflineMapParameterOverrides object this property is superseded by the AGSGenerateGeodatabaseParameters::syncModel property of the overridden layer.

See also
AGSGenerateGeodatabaseParameters::syncModel
Since
100.9