Skip To Content ArcGIS for Developers Sign In Dashboard

GenerateOfflineMapParameters Class

(Esri::ArcGISRuntime::GenerateOfflineMapParameters)

Parameters used for creating a GenerateOfflineMapJob. More...

Header: #include <GenerateOfflineMapParameters>
Since: Esri::ArcGISRuntime 100.1

Public Functions

GenerateOfflineMapParameters()
GenerateOfflineMapParameters(const Geometry &areaOfInterest, double minScale, double maxScale)
GenerateOfflineMapParameters(const GenerateOfflineMapParameters &other)
GenerateOfflineMapParameters(GenerateOfflineMapParameters &&other)
~GenerateOfflineMapParameters()
Geometry areaOfInterest() const
AttachmentSyncDirection attachmentSyncDirection() const
DestinationTableRowFilter destinationTableRowFilter() const
bool isContinueOnErrors() const
bool isDefinitionExpressionFilterEnabled() const
bool isIncludeBasemap() const
bool isReturnSchemaOnlyForEditableLayers() const
OfflineMapItemInfo itemInfo() const
double maxScale() const
double minScale() const
QString referenceBasemapDirectory() const
QString referenceBasemapFilename() const
ReturnLayerAttachmentOption returnLayerAttachmentOption() const
void setAreaOfInterest(const Geometry &areaOfInterest)
void setAttachmentSyncDirection(AttachmentSyncDirection syncDirection)
void setContinueOnErrors(bool continueOnErrors)
void setDefinitionExpressionFilterEnabled(bool definitionExpressionFilterEnabled)
void setDestinationTableRowFilter(DestinationTableRowFilter destinationTableRowFilter)
void setIncludeBasemap(bool includeBasemap)
void setItemInfo(const OfflineMapItemInfo &offlineMapItemInfo)
void setMaxScale(double maxScale)
void setMinScale(double minScale)
void setReferenceBasemapDirectory(const QString &referenceBasemapDirectory)
void setReferenceBasemapFilename(const QString &referenceBasemapFilename)
void setReturnLayerAttachmentOption(ReturnLayerAttachmentOption layerAttachmentOption)
void setReturnSchemaOnlyForEditableLayers(bool returnSchemaOnly)
GenerateOfflineMapParameters &operator=(const GenerateOfflineMapParameters &other)
GenerateOfflineMapParameters &operator=(GenerateOfflineMapParameters &&other)

Detailed Description

Parameters used for creating a GenerateOfflineMapJob.

For offline maps, a feature layer is only considered to be editable if all of FeatureTable::canAdd, FeatureTable::canDelete and FeatureTable::canUpdate return true.

The returnLayerAttachmentOption property and the attachmentSyncDirection property work in conjunction with (and in some cases may override) the value returned by attachmentSyncDirection. The table below shows the valid combinations of values for returnLayerAttachmentOption and attachmentSyncDirection. The notes column explains where the behavior for a given layer may differ from the values set for these properties.

ReturnLayerAttachmentOptionValid AttachmentSyncDirectionNote
ReturnLayerAttachmentOption::NoneAttachmentSyncDirection::None
AttachmentSyncDirection::Upload
ReturnLayerAttachmentOption::AllLayersAttachmentSyncDirection::Upload
AttachmentSyncDirection::Bidirectional
ReturnLayerAttachmentOption::ReadOnlyLayersAttachmentSyncDirection::NoneLayers with attachments will treat this as AttachmentSyncDirection::Bidirectional
AttachmentSyncDirection::Upload
AttachmentSyncDirection::BidirectionalLayers without attachments will treat this as AttachmentSyncDirection::None
ReturnLayerAttachmentOption::EditableLayersAttachmentSyncDirection::NoneLayers with attachments will treat this as AttachmentSyncDirection::Bidirectional
AttachmentSyncDirection::Upload
AttachmentSyncDirection::BidirectionalLayers without attachments will treat this as AttachmentSyncDirection::None

Member Function Documentation

GenerateOfflineMapParameters::GenerateOfflineMapParameters()

Default constructor.

GenerateOfflineMapParameters::GenerateOfflineMapParameters(const Geometry &areaOfInterest, double minScale, double maxScale)

Constructor accepting an areaOfInterest, a minScale and a maxScale.

This function was introduced in Esri::ArcGISRuntime 100.4.

GenerateOfflineMapParameters::GenerateOfflineMapParameters(const GenerateOfflineMapParameters &other)

Copy constructor from other GenerateOfflineMapParameters.

GenerateOfflineMapParameters::GenerateOfflineMapParameters(GenerateOfflineMapParameters &&other)

Move constructor from other GenerateOfflineMapParameters.

GenerateOfflineMapParameters::~GenerateOfflineMapParameters()

Destructor.

Geometry GenerateOfflineMapParameters::areaOfInterest() const

Returns the geographic area of interest used to generate the offline map.

See also setAreaOfInterest.

AttachmentSyncDirection GenerateOfflineMapParameters::attachmentSyncDirection() const

Returns the direction for attachments to be synchronized when syncing offline feature layers.

If GenerateOfflineMapParameters is used in conjunction with GenerateOfflineMapParameterOverrides this property is superseded.

See also setAttachmentSyncDirection().

DestinationTableRowFilter GenerateOfflineMapParameters::destinationTableRowFilter() const

Indicates whether tables will contain all rows or can be filtered to a smaller set of related rows.

The default value is DestinationTableRowFilter::RelatedOnly.

This function was introduced in Esri::ArcGISRuntime 100.4.

See also setDestinationTableRowFilter().

bool GenerateOfflineMapParameters::isContinueOnErrors() const

Indicates whether or not a generate offline map job should continue running in the event of failure to take a layer offline.

Returns true if the GenerateOfflineMapJob is to continue running in the event of failure.

If this property is true, failure to take a layer or table offline will not fail the job and 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.

The default value is true.

This function was introduced in Esri::ArcGISRuntime 100.4.

bool GenerateOfflineMapParameters::isDefinitionExpressionFilterEnabled() const

Returns whether layer definition expressions are used when taking features offline.

If this value is true, the GenerateOfflineMapJob applies definition expressions when taking the features offline. If more than one layer uses the same feature service layer, all the definition expressions are combined. If this value is false, definition expressions are not applied and all features are taken offline.

The default value is true.

If GenerateOfflineMapParameters is used in conjunction with GenerateOfflineMapParameterOverrides this property is superseded.

This function was introduced in Esri::ArcGISRuntime 100.3.

bool GenerateOfflineMapParameters::isIncludeBasemap() const

Returns whether the basemap of an online map will be included when the offline map is generated.

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

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

The default value is true.

If GenerateOfflineMapParameters is used in conjunction with GenerateOfflineMapParameterOverrides this property is superseded.

bool GenerateOfflineMapParameters::isReturnSchemaOnlyForEditableLayers() const

Returns whether feature layers taken offline should be schema only and contain no data.

If GenerateOfflineMapParameters is used in conjunction with GenerateOfflineMapParameterOverrides this property is superseded.

OfflineMapItemInfo GenerateOfflineMapParameters::itemInfo() const

Returns the offline map item info used for the local item properties in the offline map.

See also setItemInfo().

double GenerateOfflineMapParameters::maxScale() const

Returns the maximum scale for how far in to extract tiles from tile caches.

This also determines the offline map's minimum scale. The default value of 0 means extract the levels down to the most detailed.

This is used as the input for the levels of detail in a TileCache. This is not applicable to offline data in a VectorTileCache or a Geodatabase.

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.

See also setMaxScale.

double GenerateOfflineMapParameters::minScale() const

Returns the minimum scale for how far out data will be in tile caches.

This also determines the offline map's minimum scale. The default value of 0 means extract all the available detailed levels to global scales.

This is used as the input for the levels of detail in a TileCache. This is not applicable to offline data in a VectorTileCache or a Geodatabase.

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.

See also setMinScale.

QString GenerateOfflineMapParameters::referenceBasemapDirectory() const

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

This function was introduced in Esri::ArcGISRuntime 100.5.

See also setReferenceBasemapDirectory.

QString GenerateOfflineMapParameters::referenceBasemapFilename() const

Gets the name of a local basemap file on the device which can be used rather than downloading an online basemap.

This property can be read directly from settings applied by the author of the online web map (see OfflineSettings) 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 OfflineMapTask::createDefaultGenerateOfflineMapParameters.

To use the specified local basemap rather than downloading, the referenceBasemapDirectory property must also be set.

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

Note that this property is ignored if isIncludeBasemap is false.

This function was introduced in Esri::ArcGISRuntime 100.5.

See also setReferenceBasemapFilename().

ReturnLayerAttachmentOption GenerateOfflineMapParameters::returnLayerAttachmentOption() const

Returns the type of layers we wish to include attachments with when taking feature layers offline.

If GenerateOfflineMapParameters is used in conjunction with GenerateOfflineMapParameterOverrides this property is superseded.

See also setReturnLayerAttachmentOption.

void GenerateOfflineMapParameters::setAreaOfInterest(const Geometry &areaOfInterest)

Sets the geographic area of interest used to generate the offline map to areaOfInterest.

The supported geometry types for the area of interest are Envelope and Polygon. The area of interest must have a spatial reference. Where a Polygon 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.

See also areaOfInterest().

void GenerateOfflineMapParameters::setAttachmentSyncDirection(AttachmentSyncDirection syncDirection)

Sets the direction for attachments to be synchronized when syncing offline feature layers to syncDirection.

See the class description for more information about the interaction of this property with other properties.

If GenerateOfflineMapParameters is used in conjunction with GenerateOfflineMapParameterOverrides this property is superseded.

See also attachmentSyncDirection().

void GenerateOfflineMapParameters::setContinueOnErrors(bool continueOnErrors)

Sets whether a generate offline map job should continue running in the event of failure to take a layer offline to continueOnErrors.

This function was introduced in Esri::ArcGISRuntime 100.4.

See also isContinueOnErrors().

void GenerateOfflineMapParameters::setDefinitionExpressionFilterEnabled(bool definitionExpressionFilterEnabled)

Sets whether layer definition expressions are used when taking features offline to definitionExpressionFilterEnabled.

If GenerateOfflineMapParameters is used in conjunction with GenerateOfflineMapParameterOverrides this property is superseded.

This function was introduced in Esri::ArcGISRuntime 100.3.

See also isDefinitionExpressionFilterEnabled().

void GenerateOfflineMapParameters::setDestinationTableRowFilter(DestinationTableRowFilter destinationTableRowFilter)

Sets whether tables will contain all rows or can be filtered to a smaller set of related rows.

  • destinationTableRowFilter. Value indicating a filter on rows of tables in relationships.

When the property is DestinationTableRowFilter::relatedOnly (the default) this 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 the Map are considered as candidates for filtering. This does not apply when the table:

The relationships of a table are accessible via ArcGISFeatureTable::layerInfo and the ArcGISFeatureLayerInfo::relationshipInfos property.

The default value is DestinationTableRowFilter::RelatedOnly.

This function was introduced in Esri::ArcGISRuntime 100.4.

See also destinationTableRowFilter().

void GenerateOfflineMapParameters::setIncludeBasemap(bool includeBasemap)

Sets whether the basemap of an online map will be included when the offline map is generated to includeBasemap.

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

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

The default value is true.

If GenerateOfflineMapParameters is used in conjunction with GenerateOfflineMapParameterOverrides this property is superseded.

See also isIncludeBasemap().

void GenerateOfflineMapParameters::setItemInfo(const OfflineMapItemInfo &offlineMapItemInfo)

Sets the offline map item info used for the local item properties in the offline map to offlineMapItemInfo.

See also itemInfo().

void GenerateOfflineMapParameters::setMaxScale(double maxScale)

Sets the maximum scale for how far in to extract tiles from tile caches to maxScale.

This also determines the offline map's minimum scale. The default value of 0 means extract the levels down to the most detailed.

This is used as the input for the levels of detail in a TileCache. This is not applicable to offline data in a VectorTileCache or a Geodatabase.

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.

See also maxScale().

void GenerateOfflineMapParameters::setMinScale(double minScale)

Sets the minimum scale for how far out data will be in tile caches to minScale.

This also determines the offline map's minimum scale. The default value of 0 means extract all the available detailed levels to global scales.

This is used as the input for the levels of detail in a TileCache. This is not applicable to offline data in a VectorTileCache or a Geodatabase.

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.

See also minScale().

void GenerateOfflineMapParameters::setReferenceBasemapDirectory(const QString &referenceBasemapDirectory)

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

  • referenceBasemapDirectory. A path to a directory on the device where local basemap files are located.

This property should be set in order to use a basemap which is already on the device, rather than downloading. The directory should only be set when referenceBasemapFilename is set.

This property supports any directory specified as either:

  • An absolute path.
  • A path relative to the parent directory of the resulting mobile map package (the downloadDirectoryPath parameter of OfflineMapTask::generateOfflineMap).

If the directory does not exist, or does not contain the specified basemap, the GenerateOfflineMapJob 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 OfflineMapTask::downloadPreplannedOfflineMap.

For example, to download a mobile map package to "[my root path]/my_offline_maps/my_mobile_map_package", which 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 isIncludeBasemap is false.

This function was introduced in Esri::ArcGISRuntime 100.5.

See also referenceBasemapDirectory().

void GenerateOfflineMapParameters::setReferenceBasemapFilename(const QString &referenceBasemapFilename)

Sets the name of a local basemap file on the device which can be used rather than downloading an online basemap.

  • referenceBasemapFilename. The name of the local basemap file.

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 or set by user code to a file known to be on the device.

This property can be read directly from settings applied by the author of the online web map 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 OfflineMapTask::createDefaultGenerateOfflineMapParameters.

To use the specified local basemap rather than downloading, the referenceBasemapDirectory property must also be set.

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

Note that this property is ignored if isIncludeBasemap is false.

This function was introduced in Esri::ArcGISRuntime 100.5.

See also referenceBasemapFilename().

void GenerateOfflineMapParameters::setReturnLayerAttachmentOption(ReturnLayerAttachmentOption layerAttachmentOption)

Sets the type of layers we wish to include attachments with when taking feature layers offline to layerAttachmentOption.

Values for ReturnLayerAttachmentOption can indicate to return attachments with none of the layers, all of the layers, only read-only layers, or editable layers.

See the class description for more information about the interaction of this property with other properties.

If GenerateOfflineMapParameters is used in conjunction with GenerateOfflineMapParameterOverrides this property is superseded.

See also returnLayerAttachmentOption().

void GenerateOfflineMapParameters::setReturnSchemaOnlyForEditableLayers(bool returnSchemaOnly)

Sets whether feature layers taken offline should be schema only and contain no data to returnSchemaOnly.

If GenerateOfflineMapParameters is used in conjunction with GenerateOfflineMapParameterOverrides this property is superseded.

See also isReturnSchemaOnlyForEditableLayers().

GenerateOfflineMapParameters &GenerateOfflineMapParameters::operator=(const GenerateOfflineMapParameters &other)

Assignment operator from other GenerateOfflineMapParameters.

GenerateOfflineMapParameters &GenerateOfflineMapParameters::operator=(GenerateOfflineMapParameters &&other)

Move operator from other GenerateOfflineMapParameters.


Feedback on this topic?