Class GenerateOfflineMapParameters
GenerateOfflineMapJob
.
Consider using the convenience method OfflineMapTask.createDefaultGenerateOfflineMapParametersAsync(Geometry)
to get a properly initialized instance of this class with appropriate default values for the online map associated
with the task.
- Since:
- 100.1.0
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Indicates whether tables will contain all rows or can be filtered to a smaller set of related rows.static enum
Enumerates the possible options for dealing with online-only services (those which cannot be taken offline).static enum
Indicates the type of layers for which attachments will be included when taking feature layers offline. -
Constructor Summary
ConstructorDescriptionConstructs a new GenerateOfflineMapParameters instance containing basic default values.GenerateOfflineMapParameters
(Geometry areaOfInterest, double minScale, double maxScale) Constructs a new GenerateOfflineMapParameters instance containing the given values for areaOfInterest, minScale and maxScale, and basic default values for the other properties. -
Method Summary
Modifier and TypeMethodDescriptionGets the area of interest for the offline map.Gets the direction for attachments to be synchronized when syncing offline feature layers.Indicates whether tables will contain all rows or can be filtered to a smaller set of related rows.Describes how Esri vector tiled basemap layers will be downloaded.Gets the offline map item info used for the local item properties in the offline map.double
Gets the maximum scale for how far in to extract tiles from tiled services.double
Gets the minimum scale for how far out data will be in tile caches.Describes how data that requires an online service will be handled when taking a map offline.Gets the path to a directory on the device where the local basemap file is located.Gets the name of a local basemap file on the device which can be used rather than downloading an online basemap.Indicates which feature layers will include attachments when taking feature layers offline.Gets the update mode indicating how the offline map will support synchronization with online services.boolean
Indicates whether or not the generate offline map job should continue running in the event of failure to take a layer or table offline.boolean
Indicates if feature layer definition expressions are used when taking feature layers and tables offline using this GenerateOfflineMapParameters instance.boolean
Indicates whether or not a basemap will be included in the offline map.boolean
Indicates whether or not feature layers taken offline should be schema only and contain no data.void
setAreaOfInterest
(Geometry areaOfInterest) Sets the area of interest for the offline map.void
setAttachmentSyncDirection
(GenerateGeodatabaseParameters.AttachmentSyncDirection attachmentSyncDirection) Sets the direction for attachments to be synchronized when syncing offline feature layers.void
setContinueOnErrors
(boolean continueOnErrors) Sets whether or not the generate offline map job should continue running in the event of failure to take a layer or table offline.void
setDefinitionExpressionFilterEnabled
(boolean definitionExpressionFilterEnabled) Sets whether or not feature layer definition expressions are used when taking feature layers and tables offline using this GenerateOfflineMapParameters instance.void
setDestinationTableRowFilter
(GenerateOfflineMapParameters.DestinationTableRowFilter destinationTableRowFilter) Sets whether tables will contain all rows or can be filtered to a smaller set of related rows.void
setEsriVectorTilesDownloadOption
(EsriVectorTilesDownloadOption esriVectorTilesDownloadOption) Sets how Esri vector tiled basemap layers will be downloaded.void
setIncludeBasemap
(boolean includeBasemap) Sets whether or not the basemap of an online map will be included when the offline map is generated using this GenerateOfflineMapParameters instance.void
setItemInfo
(OfflineMapItemInfo itemInfo) Sets the offline map item info used for the local item properties in the offline map.void
setMaxScale
(double maxScale) Sets the maximum scale for how far in to extract tiles from tiled services.void
setMinScale
(double minScale) Sets the minimum scale for how far out data will be in tile caches.void
setOnlineOnlyServicesOption
(GenerateOfflineMapParameters.OnlineOnlyServicesOption onlineOnlyServicesOption) Describes how data that requires an online service will be handled when taking a map offline.void
setReferenceBasemapDirectory
(String referenceBasemapDirectory) Sets the path to a directory on the device where the local basemap file is located.void
setReferenceBasemapFilename
(String referenceBasemapFilename) Sets the name of a local basemap file on the device which can be used rather than downloading an online basemap.void
setReturnLayerAttachmentOption
(GenerateOfflineMapParameters.ReturnLayerAttachmentOption attachmentOption) Sets which feature layers will include attachments when being taken offline.void
setReturnSchemaOnlyForEditableLayers
(boolean schemaOnly) Sets whether or not feature layers taken offline should be schema only and contain no data.void
setUpdateMode
(GenerateOfflineMapUpdateMode updateMode) Sets the update mode indicating how the offline map will support synchronization with online services.
-
Constructor Details
-
GenerateOfflineMapParameters
public GenerateOfflineMapParameters()Constructs a new GenerateOfflineMapParameters instance containing basic default values. Consider using the convenience methodOfflineMapTask.createDefaultGenerateOfflineMapParametersAsync(Geometry)
rather than this constructor to get an instance with default values that are tailored for the online map associated with the task.- Since:
- 100.1.0
-
GenerateOfflineMapParameters
Constructs a new GenerateOfflineMapParameters instance containing the given values for areaOfInterest, minScale and maxScale, and basic default values for the other properties. Consider using the convenience methodOfflineMapTask.createDefaultGenerateOfflineMapParametersAsync(Geometry)
rather than this constructor to get an instance with default values that are tailored for the online map associated with the task.The area of interest must have a spatial reference. If minScale or maxScale is zero there is no bound on the minimum scale or maximum scale respectively. If both are non-zero, they must both be positive with minScale greater than maxScale.
- Parameters:
areaOfInterest
- the region of the online map that is to be taken offline; must be an Envelope or a PolygonminScale
- the minimum scale to be taken offlinemaxScale
- the maximum scale to be taken offline- Throws:
IllegalArgumentException
- if areaOfInterest is null- Since:
- 100.1.0
-
-
Method Details
-
getAreaOfInterest
Gets the area of interest for the offline map. This is used for the extent of offline tile caches, geodatabases and the offline map's initial viewpoint property (seeGeoModel.getInitialViewpoint()
.The supported geometry types for the area of interest are
Envelope
andPolygon
. 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.- Returns:
- the area of interest, or null if none has been set
- Since:
- 100.1.0
- See Also:
-
setAreaOfInterest
Sets the area of interest for the offline map. This is used for the extent of offline tile caches, geodatabases and the offline map's initial viewpoint property.The supported geometry types for the area of interest are
Envelope
andPolygon
. 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.- Parameters:
areaOfInterest
- the region of the online map that is to be taken offline; must be an Envelope or a Polygon- Throws:
IllegalArgumentException
- if areaOfInterest is null- Since:
- 100.1.0
-
getAttachmentSyncDirection
Gets the direction for attachments to be synchronized when syncing offline feature layers. This method is related togetReturnLayerAttachmentOption()
which indicates which layers should be taken offline with attachments included.If GenerateOfflineMapParameters is used in conjunction with
GenerateOfflineMapParameterOverrides
this property is superseded.- Returns:
- the attachment sync direction
- Since:
- 100.1.0
- See Also:
-
setAttachmentSyncDirection
public void setAttachmentSyncDirection(GenerateGeodatabaseParameters.AttachmentSyncDirection attachmentSyncDirection) Sets the direction for attachments to be synchronized when syncing offline feature layers. This method should be used in conjunction withsetReturnLayerAttachmentOption(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
setReturnLayerAttachmentOption(ReturnLayerAttachmentOption)
and in some cases may have its value overridden by the ReturnLayerAttachmentOption. The table below shows the valid combinations of values for layer attachment options and attachment sync direction. The Note column explains where the behavior for a given layer may differ from the values set for these properties.ReturnLayerAttachmentOption Valid AttachmentSyncDirection 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 If GenerateOfflineMapParameters is used in conjunction with
GenerateOfflineMapParameterOverrides
this property is superseded.- Parameters:
attachmentSyncDirection
- the attachment sync direction- Throws:
IllegalArgumentException
- if attachmentSyncDirection is null- Since:
- 100.1.0
- See Also:
-
isContinueOnErrors
public boolean isContinueOnErrors()Indicates whether or not the generate offline map job should continue running in the event of failure to take a layer or table offline.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's or table's error will be available as the job's error.
- Returns:
- true if the job is to continue running in the event of failure to take a layer or table offline, false otherwise
- Since:
- 100.4.0
- See Also:
-
setContinueOnErrors
public void setContinueOnErrors(boolean continueOnErrors) Sets whether or not the generate offline map job should continue running in the event of failure to take a layer or table offline. The default value is true.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's or table's error will be available as the job's error.
- Parameters:
continueOnErrors
- true if the job is to continue running in the event of failure to take a layer or table offline, false otherwise- Since:
- 100.4.0
-
isDefinitionExpressionFilterEnabled
public boolean isDefinitionExpressionFilterEnabled()Indicates if feature layer definition expressions are used when taking feature layers and tables offline using this GenerateOfflineMapParameters instance.If GenerateOfflineMapParameters is used in conjunction with
GenerateOfflineMapParameterOverrides
this property is superseded.- Returns:
- true if layer definition expressions are used when taking feature layers and tables offline, false otherwise
- Since:
- 100.3.0
- See Also:
-
setDefinitionExpressionFilterEnabled
public void setDefinitionExpressionFilterEnabled(boolean definitionExpressionFilterEnabled) Sets whether or not feature layer definition expressions are used when taking feature layers and tables offline using this GenerateOfflineMapParameters instance. The default value is true.A value of true allows
GenerateOfflineMapJob
to use the SQL where clause inFeatureLayer.getDefinitionExpression()
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. For tables the definition expression is taken fromServiceFeatureTable.getDefinitionExpression()
.If GenerateOfflineMapParameters is used in conjunction with
GenerateOfflineMapParameterOverrides
this property is superseded.- Parameters:
definitionExpressionFilterEnabled
- true to use layer definition expressions when taking feature layers and tables offline, false otherwise- Since:
- 100.3.0
-
getDestinationTableRowFilter
Indicates whether tables will contain all rows or can be filtered to a smaller set of related rows.A value of
GenerateOfflineMapParameters.DestinationTableRowFilter.RELATED_ONLY
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 inGeoModel.getTables()
are considered as candidates for filtering. This does not apply when the table:- is the origin of a relationship and not a destination
- is a destination of a relationship from a layer or table which is not in the map
- is editable and
isReturnSchemaOnlyForEditableLayers()
is true - has a definition expression and
isDefinitionExpressionFilterEnabled()
is true
ArcGISFeatureTable.getLayerInfo()
andArcGISFeatureLayerInfo.getRelationshipInfos()
.The default value is
GenerateOfflineMapParameters.DestinationTableRowFilter.RELATED_ONLY
. If set toGenerateOfflineMapParameters.DestinationTableRowFilter.ALL
then all rows in tables are returned.- Returns:
- the current destination table row filter value
- Since:
- 100.4.0
- See Also:
-
setDestinationTableRowFilter
public void setDestinationTableRowFilter(GenerateOfflineMapParameters.DestinationTableRowFilter destinationTableRowFilter) Sets whether tables will contain all rows or can be filtered to a smaller set of related rows.A value of
GenerateOfflineMapParameters.DestinationTableRowFilter.RELATED_ONLY
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 inGeoModel.getTables()
are considered as candidates for filtering. This does not apply when the table:- is the origin of a relationship and not a destination
- is a destination of a relationship from a layer or table which is not in the map
- is editable and
isReturnSchemaOnlyForEditableLayers()
is true - has a definition expression and
isDefinitionExpressionFilterEnabled()
is true
ArcGISFeatureTable.getLayerInfo()
andArcGISFeatureLayerInfo.getRelationshipInfos()
.The default value is
GenerateOfflineMapParameters.DestinationTableRowFilter.RELATED_ONLY
. If set toGenerateOfflineMapParameters.DestinationTableRowFilter.ALL
then all rows in tables are returned.- Parameters:
destinationTableRowFilter
- a value indicating a filter on rows of tables in relationships- Throws:
IllegalArgumentException
- if destinationTableRowFilter is null- Since:
- 100.4.0
-
getEsriVectorTilesDownloadOption
Describes how Esri vector tiled basemap layers will be downloaded.- Returns:
- an enum value describing how Esri vector tiled basemap layers will be downloaded
- Since:
- 100.10.0
- See Also:
-
setEsriVectorTilesDownloadOption
public void setEsriVectorTilesDownloadOption(EsriVectorTilesDownloadOption esriVectorTilesDownloadOption) Sets how Esri vector tiled basemap layers will be downloaded.This property lets you choose how to download Esri vector tiled basemap layers. It only applies when taking an Esri vector tile basemap service offline.
When taking an Esri vector tiled basemap service offline (for example to create a
VectorTileCache
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
VectorTileCache
.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
EsriVectorTilesDownloadOption.USE_ORIGINAL_SERVICE
, the full set of resources used by the original online service, including all fonts, will be downloaded. This increases the download size of the VectorTileCache but ensures that the offline layer will display the same as the original online data. - If you choose
EsriVectorTilesDownloadOption.USE_REDUCED_FONTS_SERVICE
, the smaller set of fonts used by the alternative, for export, version of the service will be downloaded. This reduces the download size of theVectorTileCache
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
EsriVectorTilesDownloadOption.USE_ORIGINAL_SERVICE
.- Parameters:
esriVectorTilesDownloadOption
- describes how Esri vector tiled basemap layers will be downloaded- Throws:
IllegalArgumentException
- if esriVectorTilesDownloadOption is null- Since:
- 100.10.0
- See Also:
- If you choose
-
isIncludeBasemap
public boolean isIncludeBasemap()Indicates whether or not a basemap will be included in the offline map. The default value is true.
The paired methods
isIncludeBasemap
andsetIncludeBasemap
are superseded ifGenerateOfflineMapParameters
is used in conjunction withGenerateOfflineMapParameterOverrides
.If you do not want a basemap in the offline map, then call
setIncludeBasemap(boolean)
and pass in false. 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
setIncludeBasemap(boolean)
and pass in true. You can choose to either:- Generate and download the online basemap using the
GenerateOfflineMapJob
. This is the default. - Use a local basemap on the device by setting the
setReferenceBasemapDirectory(String)
.
- Returns:
- true if the basemap will be included in the offline map, false otherwise
- Since:
- 100.1.0
- See Also:
- Generate and download the online basemap using the
-
setIncludeBasemap
public void setIncludeBasemap(boolean includeBasemap) Sets whether or not the basemap of an online map will be included when the offline map is generated using this GenerateOfflineMapParameters instance. The default value is true.The paired methods
isIncludeBasemap
andsetIncludeBasemap
are superseded ifGenerateOfflineMapParameters
is used in conjunction withGenerateOfflineMapParameterOverrides
.If you do not want a basemap in the offline map, then call
setIncludeBasemap(boolean)
and pass in false. 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
setIncludeBasemap(boolean)
and pass in true. You can choose to either:- Generate and download the online basemap using the
GenerateOfflineMapJob
. This is the default. - Use a local basemap on the device by setting the
setReferenceBasemapDirectory(String)
.
- Parameters:
includeBasemap
- true to include the basemap in the offline map, false otherwise- Since:
- 100.1.0
- See Also:
- Generate and download the online basemap using the
-
getItemInfo
Gets the offline map item info used for the local item properties in the offline map. If item info has not been set, the properties are copied from the portal item.- Returns:
- the offline map item info, or null if none has been set
- Since:
- 100.1.0
- See Also:
-
setItemInfo
Sets the offline map item info used for the local item properties in the offline map. If this is not set, the properties are copied from the portal item.- Parameters:
itemInfo
- the offline map item info- Throws:
IllegalArgumentException
- if itemInfo is null- Since:
- 100.1.0
-
getMaxScale
public double getMaxScale()Gets the maximum scale for how far in to extract tiles from tiled services. This also determines the offline map's maxScale property. The default value of 0 means extract the levels down to the most detailed.- Returns:
- the maximum scale
- Since:
- 100.1.0
- See Also:
-
setMaxScale
public void setMaxScale(double maxScale) Sets the maximum scale for how far in to extract tiles from tiled services. This also determines the offline map's maxScale property. The default value of 0 means extract the levels down to the most detailed.This is used as input for levels of detail for tile cache and vector tile cache. This is not applicable to offline data in a geodatabase. A minScale of 100000 and a maxScale of 500 will select level IDs between 1:500 and 1:100000 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:100000 scale to the most detailed available level.
If GenerateOfflineMapParameters is used in conjunction with
GenerateOfflineMapParameterOverrides
this property is superseded for individual layer's tile caches. However, the maxScale will still be used as the offline map'sArcGISMap.getMaxScale()
property.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.
- Parameters:
maxScale
- the maximum scale- Since:
- 100.1.0
- See Also:
-
getMinScale
public double getMinScale()Gets the minimum scale for how far out data will be in tile caches. This also determines the offline map's minScale property. The default value of 0 means extract all the available detailed levels to global scales.- Returns:
- the minimum scale
- Since:
- 100.1.0
- See Also:
-
setMinScale
public void setMinScale(double minScale) Sets the minimum scale for how far out data will be in tile caches. This also determines the offline map's minScale property. The default value of 0 means extract all the available detailed levels to global scales.This is used as input for levels of detail for tile cache. This is not applicable to offline data in a vector tile cache or geodatabase. A minScale of 100000 and a maxScale of 500 will select level IDs between 1:500 and 1:100000 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:100000 scale to the most detailed available level.
If GenerateOfflineMapParameters is used in conjunction with
GenerateOfflineMapParameterOverrides
,minScale
is superseded for individual layer's tile caches.Note that this method only sets the levels of detail to download for tiled data. The offline basemap layers will use the same minScale as in the online web map (either defined by the service or on the layer itself).
- Parameters:
minScale
- the minimum scale- Since:
- 100.1.0
- See Also:
-
getReturnLayerAttachmentOption
Indicates which feature layers will include attachments when taking feature layers offline. This will include attachments with none of the layers, all of the layers, read only layers or editable layers. This method is related togetAttachmentSyncDirection()
which indicates how the attachments are synced.If GenerateOfflineMapParameters is used in conjunction with
GenerateOfflineMapParameterOverrides
, this property is superseded.- Returns:
- indicates which types of layer, if any, will include attachments
- Since:
- 100.1.0
- See Also:
-
setReturnLayerAttachmentOption
public void setReturnLayerAttachmentOption(GenerateOfflineMapParameters.ReturnLayerAttachmentOption attachmentOption) Sets which feature layers will include attachments when being taken offline. Attachments can be included with none of the layers, all of the layers, read only layers or editable layers. This method should be used in conjuction withsetAttachmentSyncDirection(GenerateGeodatabaseParameters.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, see
ArcGISFeatureServiceInfo.getFeatureServiceCapabilities()
orArcGISFeatureLayerInfo.getCapabilities()
.This property works in conjunction with
setAttachmentSyncDirection(GenerateGeodatabaseParameters.AttachmentSyncDirection)
and in some cases may override the AttachmentSyncDirection. The table below shows the valid combinations of values for layer attachment options and attachment sync direction. The notes column explains where the behavior for a given layer may differ from the values set for these properties.ReturnLayerAttachmentOption Valid AttachmentSyncDirection 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 If GenerateOfflineMapParameters is used in conjunction with
GenerateOfflineMapParameterOverrides
, this property is superseded.- Parameters:
attachmentOption
- indicates which types of layer, if any, will include attachments- Throws:
IllegalArgumentException
- if attachmentOption is null- Since:
- 100.1.0
- See Also:
-
isReturnSchemaOnlyForEditableLayers
public boolean isReturnSchemaOnlyForEditableLayers()Indicates whether or not feature layers taken offline should be schema only and contain no data.If GenerateOfflineMapParameters is used in conjunction with
GenerateOfflineMapParameterOverrides
this property is superseded.- Returns:
- true if the offline layers will be schema only, false otherwise
- Since:
- 100.1.0
- See Also:
-
setReturnSchemaOnlyForEditableLayers
public void setReturnSchemaOnlyForEditableLayers(boolean schemaOnly) Sets whether or not feature layers taken offline should be schema only and contain no data. The default value is false.For an upload only type workflow, this property can be set to true to take feature layers offline with no existing data in them.
If GenerateOfflineMapParameters is used in conjunction with
GenerateOfflineMapParameterOverrides
this property is superseded.- Parameters:
schemaOnly
- true to have offline feature layers with schema only, false otherwise- Since:
- 100.1.0
-
setReferenceBasemapDirectory
Sets the path to a directory on the device where the local basemap file is located.Call this method to use a basemap which is already on the device, rather than downloading. The directory should only be set when the parameters have a
setReferenceBasemapFilename(String)
defined. This property supports any directory specified as either:- an absolute path
- a path relative to the parent directory of the resulting mobile map package.
See downloadDirectoryPath for
OfflineMapTask.generateOfflineMap(GenerateOfflineMapParameters, String)
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 callingOfflineMapTask.generateOfflineMap(GenerateOfflineMapParameters, String)
.For example, to generate 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:GenerateOfflineMapJob.getDownloadDirectoryPath()
to[my root path]/my_offline_maps/my_mobile_map_package
setReferenceBasemapDirectory(String)
to../other_maps
setReferenceBasemapFilename(String)
tomy_basemap.tpk
Note: This property is ignored if
isIncludeBasemap()
is false.- Parameters:
referenceBasemapDirectory
- path to a directory on the device where the local basemap files are located- Since:
- 100.5.0
- See Also:
-
getReferenceBasemapDirectory
Gets the path to a directory on the device where the local basemap file is located.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 downloadDirectoryPath for
OfflineMapTask.generateOfflineMap(GenerateOfflineMapParameters, String)
For more details on how to use a reference basemap directory, see
getReferenceBasemapDirectory()
.- Returns:
- the directory path of the local reference basemap
- Since:
- 100.5.0
- See Also:
-
setReferenceBasemapFilename
Sets 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 webmap (see
ArcGISMap.getOfflineSettings()
) or set by user code to a file known to be on the device. This property will be populated from online settings when created withOfflineMapTask.createDefaultGenerateOfflineMapParametersAsync(Geometry)
.If you wish to use the specified local basemap rather than downloading, you must also set
setReferenceBasemapDirectory(java.lang.String)
. If the directory does not exist, or does not contain the specified basemap, theGenerateOfflineMapJob
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
isIncludeBasemap()
is false.- Parameters:
referenceBasemapFilename
- the filename of the reference basemap- Throws:
IllegalArgumentException
- if referenceBasemapFilename is null- Since:
- 100.5.0
-
getReferenceBasemapFilename
Gets the name of a local basemap file on the device which can be used rather than downloading an online basemap.- Returns:
- the file name of the local basemap
- Since:
- 100.5.0
- See Also:
-
getUpdateMode
Gets the update mode indicating how the offline map will support synchronization with online services.A value of
GenerateOfflineMapUpdateMode.SYNC_WITH_FEATURE_SERVICES
instructsGenerateOfflineMapJob
to create offline geodatabases which support syncing with online feature services.A value of
GenerateOfflineMapUpdateMode.NO_UPDATES
instructsGenerateOfflineMapJob
to disable data synchronization for generated offline geodatabases. In this case no synchronization replicas will be created on corresponding feature services. This not only reduces load on the feature server, but also frees the developer from needing to unregister server replicas when they are no longer needed.The default value is
GenerateOfflineMapUpdateMode.SYNC_WITH_FEATURE_SERVICES
.If GenerateOfflineMapParameters is used in conjunction with
GenerateOfflineMapParameterOverrides
this property is superseded by theGenerateGeodatabaseParameters.getSyncModel()
property of the overridden layer.- Since:
- 100.9.0
- See Also:
-
setUpdateMode
Sets the update mode indicating how the offline map will support synchronization with online services.A value of
GenerateOfflineMapUpdateMode.SYNC_WITH_FEATURE_SERVICES
instructsGenerateOfflineMapJob
to create offline geodatabases which support syncing with online feature services.A value of
GenerateOfflineMapUpdateMode.NO_UPDATES
instructsGenerateOfflineMapJob
to disable data synchronization for generated offline geodatabases. In this case no synchronization replicas will be created on corresponding feature services. This not only reduces load on the feature server, but also frees the developer from needing to unregister server replicas when they are no longer needed.The default value is
GenerateOfflineMapUpdateMode.SYNC_WITH_FEATURE_SERVICES
.If GenerateOfflineMapParameters is used in conjunction with
GenerateOfflineMapParameterOverrides
this property is superseded by theGenerateGeodatabaseParameters.getSyncModel()
property of the overridden layer.- Parameters:
updateMode
- a GenerateOfflineMapUpdateMode- Throws:
IllegalArgumentException
- if updateMode is null- Since:
- 100.9.0
- See Also:
-
getOnlineOnlyServicesOption
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,
WmsLayer
orWmtsLayer
. - The layer or table is using a service that supports offline, such as an {code ArcGISFeatureLayer}, but
synchronization has not been enabled on the service (
FeatureServiceCapabilities.isSupportsSync()
is set to false). 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:
-
GenerateOfflineMapParameters.OnlineOnlyServicesOption.EXCLUDE
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. -
GenerateOfflineMapParameters.OnlineOnlyServicesOption.INCLUDE
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. -
GenerateOfflineMapParameters.OnlineOnlyServicesOption.USE_AUTHORED_SETTINGS
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
GenerateOfflineMapParameters.OnlineOnlyServicesOption.EXCLUDE
.- Returns:
- an enum that describes how data that requires an online service will be handled when taking a map offline
- Since:
- 100.9.0
- The layer or table is using a service that cannot be taken offline. For example,
-
setOnlineOnlyServicesOption
public void setOnlineOnlyServicesOption(GenerateOfflineMapParameters.OnlineOnlyServicesOption onlineOnlyServicesOption) 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,
WmsLayer
orWmtsLayer
. - The layer or table is using a service that supports offline, such as an {code ArcGISFeatureLayer}, but
synchronization has not been enabled on the service (
FeatureServiceCapabilities.isSupportsSync()
is set to false). 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:
-
GenerateOfflineMapParameters.OnlineOnlyServicesOption.EXCLUDE
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. -
GenerateOfflineMapParameters.OnlineOnlyServicesOption.INCLUDE
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. -
GenerateOfflineMapParameters.OnlineOnlyServicesOption.USE_AUTHORED_SETTINGS
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
GenerateOfflineMapParameters.OnlineOnlyServicesOption.EXCLUDE
.- Parameters:
onlineOnlyServicesOption
- describes how data that requires an online service will be handled when taking a map offline- Throws:
IllegalArgumentException
- if onlineOnlyServicesOption is null- Since:
- 100.9.0
- The layer or table is using a service that cannot be taken offline. For example,
-