Class DownloadPreplannedOfflineMapParameters

    • Constructor Detail

      • DownloadPreplannedOfflineMapParameters

        public DownloadPreplannedOfflineMapParameters()
        Constructs a new DownloadPreplannedOfflineMapParameters instance.
        Since:
        100.4.0
      • DownloadPreplannedOfflineMapParameters

        public DownloadPreplannedOfflineMapParameters​(PreplannedMapArea preplannedMapArea)
        Constructs a new DownloadPreplannedOfflineMapParameters instance with the given preplanned map area.
        Parameters:
        preplannedMapArea - the preplanned map area to be downloaded
        Throws:
        IllegalArgumentException - if preplannedMapArea is null
        Since:
        100.4.0
    • Method Detail

      • setPreplannedMapArea

        public void setPreplannedMapArea​(PreplannedMapArea preplannedMapArea)
        Sets the preplanned map area that will be downloaded for offline use.
        Parameters:
        preplannedMapArea - the preplanned 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(boolean)
      • 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.

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

        When this property is set to true, the DownloadPreplannedOfflineMapJob will download the online basemap, unless setReferenceBasemapDirectory(String) has been set. Setting a directory indicates that the offline map should use a basemap on the device rather than downloading.

        Returns:
        true if the basemap will be included in the offline map, false otherwise
        Since:
        100.4.0
        See Also:
        setIncludeBasemap(boolean)
      • 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.
        Parameters:
        includeBasemap - true to include the basemap in the offline map, false otherwise
        Since:
        100.4.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 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 calling OfflineMapTask.downloadPreplannedOfflineMap(PreplannedMapArea, 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:

        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 web map (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.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, the DownloadPreplannedOfflineMapJob 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:
        OfflineSettings
      • 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 filename of the local basemap
        Since:
        100.5.0
        See Also:
        setReferenceBasemapFilename(String)