Class GenerateOfflineMapParameters

    • Constructor Detail

      • GenerateOfflineMapParameters

        public GenerateOfflineMapParameters()
        Constructs a new GenerateOfflineMapParameters instance containing basic default values. Consider using the convenience method OfflineMapTask.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

        public 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. Consider using the convenience method OfflineMapTask.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 Polygon
        minScale - the minimum scale to be taken offline
        maxScale - the maximum scale to be taken offline
        Throws:
        IllegalArgumentException - if areaOfInterest is null
        Since:
        100.1.0
    • Method Detail

      • getAreaOfInterest

        public Geometry 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.

        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.

        Returns:
        the area of interest, or null if none has been set
        Since:
        100.1.0
        See Also:
        setAreaOfInterest(Geometry)
      • setAreaOfInterest

        public void setAreaOfInterest​(Geometry areaOfInterest)
        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 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.

        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
      • 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 with setReturnLayerAttachmentOption(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 overriden by the ReturnLayerAttachmentOption as shown below:

        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
      • 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(boolean)
      • 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(boolean)
      • 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 in FeatureLayer.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 from ServiceFeatureTable.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
      • isIncludeBasemap

        public boolean isIncludeBasemap()
        Indicates whether or not the basemap of an online map will be included when the offline map is generated using this GenerateOfflineMapParameters instance.

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

        Returns:
        true if the basemap will be included in the offline map, false otherwise
        Since:
        100.1.0
        See Also:
        setIncludeBasemap(boolean)
      • 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.

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

        Parameters:
        includeBasemap - true to include the basemap in the offline map, false otherwise
        Since:
        100.1.0
      • getItemInfo

        public OfflineMapItemInfo 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(OfflineMapItemInfo)
      • setItemInfo

        public void setItemInfo​(OfflineMapItemInfo itemInfo)
        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 tile caches. 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's ArcGISMap.getMaxScale() property.

        Returns:
        the maximum scale
        Since:
        100.1.0
        See Also:
        setMaxScale(double)
      • setMaxScale

        public void setMaxScale​(double maxScale)
        Sets the maximum scale for how far in to extract tiles from tile caches. 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's ArcGISMap.getMaxScale() property.

        Parameters:
        maxScale - the maximum scale
        Since:
        100.1.0
      • 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.

        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 this property is superseded for individual layer's tile caches. However, the minScale will still be used as the offline map's ArcGISMap.getMinScale() property.

        Returns:
        the minimum scale
        Since:
        100.1.0
        See Also:
        setMinScale(double)
      • 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 this property is superseded for individual layer's tile caches. However, the minScale will still be used as the offline map's ArcGISMap.getMinScale() property.

        Parameters:
        minScale - the minimum scale
        Since:
        100.1.0
      • 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 with setAttachmentSyncDirection(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() or ArcGISFeatureLayerInfo.getCapabilities().

        This property works in conjunction with setAttachmentSyncDirection(GenerateGeodatabaseParameters.AttachmentSyncDirection) and in some cases may override the AttachmentSyncDirection value as shown below:

        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
      • 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(boolean)
      • 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

        public void setReferenceBasemapDirectory​(String referenceBasemapDirectory)
        Sets the path to a directory on the device where the local basemap file is 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 the parameters have a setReferenceBasemapFilename(String) defined. This property supports any directory specified as either:

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

        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
        Throws:
        IllegalArgumentException - if referenceBasemapDirectory is null
        Since:
        100.5.0
      • setReferenceBasemapFilename

        public 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.

        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 with OfflineMapTask.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, the GenerateOfflineMapJob 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

        public String 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:
        setReferenceBasemapFilename(String)