Class DownloadPreplannedOfflineMapParameters
DownloadPreplannedOfflineMapJob
.- Since:
- 100.4.0
- See Also:
-
Constructor Summary
ConstructorDescriptionConstructs a new DownloadPreplannedOfflineMapParameters instance.DownloadPreplannedOfflineMapParameters
(PreplannedMapArea preplannedMapArea) Constructs a new DownloadPreplannedOfflineMapParameters instance with the given offline map area. -
Method Summary
Modifier and TypeMethodDescriptionGets the offline map area that will be downloaded for offline use.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.Describes how the offline map will obtain feature updates from the online service.boolean
Indicates whether or not the download preplanned offline map job should continue running in the event of failure to take a layer or table offline.boolean
Indicates whether or not the basemap will be included in the offline map to be downloaded using this DownloadPreplannedOfflineMapParameters instance.void
setContinueOnErrors
(boolean continueOnErrors) Sets whether or not the download preplanned offline map job should continue running in the event of failure to take a layer or table offline.void
setIncludeBasemap
(boolean includeBasemap) Sets whether or not the basemap will be included in the offline map to be downloaded using this DownloadPreplannedOfflineMapParameters instance.void
setPreplannedMapArea
(PreplannedMapArea preplannedMapArea) Sets the offline map area that will be downloaded for offline use.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
setUpdateMode
(PreplannedUpdateMode updateMode) Sets the update mode that describes how the offline map will obtain feature updates from the online service.
-
Constructor Details
-
DownloadPreplannedOfflineMapParameters
public DownloadPreplannedOfflineMapParameters()Constructs a new DownloadPreplannedOfflineMapParameters instance.- Since:
- 100.4.0
-
DownloadPreplannedOfflineMapParameters
Constructs a new DownloadPreplannedOfflineMapParameters instance with the given offline map area.- Parameters:
preplannedMapArea
- the preplanned map area to be downloaded- Throws:
IllegalArgumentException
- if preplannedMapArea is null- Since:
- 100.4.0
-
-
Method Details
-
getPreplannedMapArea
Gets the offline map area that will be downloaded for offline use.- Returns:
- the offline map area, or null if none has been set
- Since:
- 100.4.0
- See Also:
-
setPreplannedMapArea
Sets the offline map area that will be downloaded for offline use.- Parameters:
preplannedMapArea
- the offline map area- Throws:
IllegalArgumentException
- if preplannedMapArea is null- Since:
- 100.4.0
-
isContinueOnErrors
public boolean isContinueOnErrors()Indicates whether or not the download preplanned 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 download preplanned 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
-
isIncludeBasemap
public boolean isIncludeBasemap()Indicates whether or not the basemap will be included in the offline map to be downloaded using this DownloadPreplannedOfflineMapParameters instance. The default value is true.If you do not want a basemap in the offline map, then this property should be false. (See
setIncludeBasemap(boolean)
). 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 this
#isIncludeBasemap()
should be true. You can choose to either:- Download and use the basemap that is part of the
PreplannedMapArea
. This is the default. - Use the local basemap on the device by setting
setReferenceBasemapDirectory(String)
.
- Returns:
- true if the basemap will be included in the offline map, false otherwise
- Since:
- 100.4.0
- See Also:
- Download and use the basemap that is part of the
-
setIncludeBasemap
public void setIncludeBasemap(boolean includeBasemap) Sets whether or not the basemap will be included in the offline map to be downloaded using this DownloadPreplannedOfflineMapParameters instance. The default value is true.If you do not want a basemap in the offline map, then set this property to 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 you call this method and pass true. You can choose to either:
- Download and use the basemap that is part of the
PreplannedMapArea
. This is the default. - Use the local basemap on the device by setting
setReferenceBasemapDirectory(String)
.
- Parameters:
includeBasemap
- true to include the basemap in the offline map, false otherwise- Since:
- 100.4.0
- Download and use the basemap that is part of the
-
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
setReferenceBasemapFilename(String)
is defined. You can use any directory that is specified as either:- an absolute path
- a path relative to the parent directory of the resulting mobile map package.
See downloadDirectoryPath for
OfflineMapTask.downloadPreplannedOfflineMap(DownloadPreplannedOfflineMapParameters, String)
DownloadPreplannedOfflineMapJob
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 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:DownloadPreplannedOfflineMapJob.getDownloadDirectoryPath()
to[my root path]/my_offline_maps/my_mobile_map_package
DownloadPreplannedOfflineMapParameters.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
-
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 web map (seeArcGISMap.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.createDefaultDownloadPreplannedOfflineMapParametersAsync(PreplannedMapArea)
.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, theDownloadPreplannedOfflineMapJob
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 the
isIncludeBasemap()
is false.- Parameters:
referenceBasemapFilename
- the name of the local basemap file on the device.- Throws:
IllegalArgumentException
- if referenceBasemapFilename is null- Since:
- 100.5.0
- See Also:
-
getReferenceBasemapDirectory
Gets the path to a directory on the device where the local basemap file is located.This method 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.downloadPreplannedOfflineMap(DownloadPreplannedOfflineMapParameters, String)
setReferenceBasemapDirectory(String)
- Returns:
- the directory path of the local basemap file
- Since:
- 100.5.0
- See Also:
-
getReferenceBasemapFilename
Gets the name of a local basemap file on the device which can be used rather than downloading an online basemap.- Returns:
- the filename of the local basemap
- Since:
- 100.5.0
- See Also:
-
getUpdateMode
Describes how the offline map will obtain feature updates from the online service.The preplanned workflow offers three modes for updating the feature data in your offline map:
- Sync feature changes directly with online feature services.
- Download a set of scheduled update packages (geodatabase delta files that are cached on the server) from the online map area.
- Download scheduled updates from the online map area and upload new features to the feature service.
PreplannedUpdateMode.SYNC_WITH_FEATURE_SERVICES
. Syncing allows you to upload as well as download changes, so this approach should be used when you need full control to edit your data. As you sync changes directly with the back-end services, you will receive the most up-to-date feature data available. This is the default mode if you construct the DownloadPreplannedOfflineMapParameters. To download a set of cached updates (delta files) from the online map area, set this property toPreplannedUpdateMode.DOWNLOAD_SCHEDULED_UPDATES
. With this approach, updates are generated whenever the online map area is refreshed - for example according to its update schedule. Updates are prepared once and cached for download by all users of the offline map area. Sharing a single set of cached updates, rather than performing individual sync operations, reduces the load on the back-end services - this makes this approach scalable for large deployments. As updates are only downloaded, this approach can only be used with read-only workflows. The updates also reflect a snapshot of the feature data at the time the online map area was refreshed - rather than the most up-to-date information. The web map author must configure the online map to store cached updates for this approach. To use a hybrid approach where you download scheduled updates and upload new features, set this property toPreplannedUpdateMode.DOWNLOAD_SCHEDULED_UPDATES_AND_UPLOAD_NEW_FEATURES
. This approach combines the scalability of downloading scheduled updates with the ability to collect and share data in the field. Note that this approach is strictly add only, meaning that you cannot delete or edit features once they have been uploaded to the feature service. If you use agetUpdateMode()
ofPreplannedUpdateMode.DOWNLOAD_SCHEDULED_UPDATES
orPreplannedUpdateMode.DOWNLOAD_SCHEDULED_UPDATES_AND_UPLOAD_NEW_FEATURES
, with a web map that does not support scheduled updates, the resultantDownloadPreplannedOfflineMapJob
will fail with anArcGISRuntimeException
.- Returns:
- describes how the offline map will obtain feature updates from the online service
- Since:
- 100.6.0
-
setUpdateMode
Sets the update mode that describes how the offline map will obtain feature updates from the online service.The preplanned workflow offers three modes for updating the feature data in your offline map:
- Sync feature changes directly with online feature services.
- Download a set of scheduled updates (geodatabase delta files which are cached on the server) from the online map area.
- Download scheduled updates from the online map area and upload new features to the feature service.
PreplannedUpdateMode.SYNC_WITH_FEATURE_SERVICES
. Syncing allows you to upload as well as download changes, so this approach should be used when you need full control to edit your data. As you sync changes directly with the back-end services, you will receive the most up-to-date feature data available. This is the default mode if you construct theDownloadPreplannedOfflineMapParameters
.To download a set of cached updates (delta files) from the online map area, set this property to
PreplannedUpdateMode.DOWNLOAD_SCHEDULED_UPDATES
. With this approach, updates are generated whenever the online map area is refreshed - for example according to its update schedule. Updates are prepared once and cached for download by all users of the offline map area. Sharing a single set of cached updates, rather than performing individual sync operations, reduces the load on the back-end services - this makes this approach scalable for large deployments. As updates are only downloaded, this approach can only be used with read-only workflows. The updates also reflect a snapshot of the feature data at the time the online map area was refreshed - rather than the most up-to-date information. The web map author must configure the online map to store cached updates for this approach.To use a hybrid approach where you download scheduled updates and upload new features, set this property to
PreplannedUpdateMode.DOWNLOAD_SCHEDULED_UPDATES_AND_UPLOAD_NEW_FEATURES
. This approach combines the scalability of downloading scheduled updates with the ability to collect and share data in the field. Note that this approach is strictly add only, meaning that you cannot delete or edit features once they have been uploaded to the feature service. If you use agetUpdateMode()
ofPreplannedUpdateMode.DOWNLOAD_SCHEDULED_UPDATES
orPreplannedUpdateMode.DOWNLOAD_SCHEDULED_UPDATES_AND_UPLOAD_NEW_FEATURES
, with a web map that does not support scheduled updates, the resultantDownloadPreplannedOfflineMapJob
will fail with anArcGISRuntimeException
.- Parameters:
updateMode
- describes how the offline map will obtain feature updates from the online service- Throws:
IllegalArgumentException
- if updateMode is null- Since:
- 100.6.0
-