ArcGIS Runtime SDK for iOS
100.15
|
A task used to export vector tiles and optionally a portal item's vector tile style resources.
Instances of this class represent a task that can be used to download vector tiles and their associated style resources (as a vector tile package, .vtpk file), see AGSVectorTileCache
.
A portal item can contain a custom style resources overriding the vector tile services default style and this can be checked with AGSExportVectorTilesTask::hasStyleResources
. The custom style is exported separately as an AGSItemResourceCache
.
The export vector tiles task can be initialized with a URL using initWithURL: (AGSExportVectorTilesTask)
.
The URL can be:
AGSBasemapStyle
objectAlternatively an AGSPortalItem
object referencing a vector tile service or a custom style for a vector tiled layer, can be used with initWithPortalItem: (AGSExportVectorTilesTask)
.
When using Esri provided vector basemaps that do not support exporting tiles (such as the ArcGIS streets basemap
AGSBasemapStyleArcGISStreets
), an alternative service that supports exporting tiles will be used instead. Instance Methods | |
(void) | - cancelLoad |
(id< AGSCancelable >) | - defaultExportVectorTilesParametersWithAreaOfInterest:maxScale:completion: |
(void) | - doCancelLoading |
(void) | - doStartLoading: |
(AGSExportVectorTilesJob *) | - exportStyleResourceCacheJobWithDownloadDirectory: |
(AGSExportVectorTilesJob *) | - exportVectorTilesJobWithParameters:downloadFileURL: |
(AGSExportVectorTilesJob *) | - exportVectorTilesJobWithParameters:vectorTileCacheDownloadFileURL:itemResourceCacheDownloadDirectory: |
(instancetype) | - initWithPortalItem: |
(instancetype) | - initWithURL: |
(void) | - loadDidFinishWithError: |
(void) | - loadWithCompletion: |
(void) | - onLoadStatusChanged |
(void) | - retryLoadWithCompletion: |
Class Methods | |
(instancetype) | + exportVectorTilesTaskWithPortalItem: |
(instancetype) | + exportVectorTilesTaskWithURL: |
Properties | |
NSString * | APIKey |
AGSCredential * | credential |
BOOL | hasStyleResources |
NSError * | loadError |
AGSLoadStatus | loadStatus |
AGSPortalItem * | portalItem |
AGSRequestConfiguration * | requestConfiguration |
NSURL * | URL |
AGSVectorTileSourceInfo * | vectorTileSourceInfo |
|
requiredinherited |
Cancels loading if it is in progress, otherwise it does nothing. This should be called carefully because other objects could be waiting for loadWithCompletion:
or retryLoadWithCompletion:
to complete and this will call them all back with the error of NSUserCancelledError
- (id<AGSCancelable>) defaultExportVectorTilesParametersWithAreaOfInterest: | (AGSGeometry *) | areaOfInterest | |
maxScale: | (double) | maxScale | |
completion: | (void(^)(AGSExportVectorTilesParameters *__nullable params, NSError *__nullable error)) | completion | |
A convenience method to get properly initialized parameters for exporting tiles. It will calculate the levels of detail (LODs) required based on the specified max scale and the tiling scheme of the service. Be careful when you provide a large area of interest or a small maximum scale value as this could result in a large number of tiles being requested.
areaOfInterest | A polygon or envelope geometry representing the geographic area for which tiles are needed. Point and polyline geometries are not supported. |
maxScale | The maximum map scale for which tiles are needed. There won't be any tiles when the map is zoomed in beyond this scale. Set the value to 0 to include all levels of detail in the service. |
completion | A block that is invoked when the operation is complete with either the results or an error. |
- (void) doCancelLoading |
Never call this method directly. The framework calls this method on a background thread when cancelLoad (AGSLoadable-p)
is called. It is meant to be overriden by subclasses. Subclasses should override this method to cancel loading their data and call loadDidFinishWithError: (AGSLoadableBase(ForSubclassEyesOnly))
at the end passing in an error representing NSUserCancelledError
.
Provided by category AGSLoadableBase(ForSubclassEyesOnly).
- (void) doStartLoading: | (BOOL) | retrying |
Never call this method directly. The framework calls this method on a background thread when loadWithCompletion: (AGSLoadable-p)
or retryLoadWithCompletion: (AGSLoadable-p)
is called. It is meant to be overriden by subclasses. Subclasses should override this method to load their data and call loadDidFinishWithError: (AGSLoadableBase(ForSubclassEyesOnly))
upon completion, passing in the error if any.
retrying | flag that is true if this method was called from retryLoadWithCompletion: (AGSLoadable-p) . |
Provided by category AGSLoadableBase(ForSubclassEyesOnly).
- (AGSExportVectorTilesJob*) exportStyleResourceCacheJobWithDownloadDirectory: | (NSURL *) | downloadDirectory |
Returns a job which can be used to separately download any associated custom style resources for the vector tiles. Note, it does not download the vector tiles. This is useful if you want to download the style resources once and then re-use them with multiple tile packages containing only the data tiles which keeps their size to a minimum. Only applicable if hasStyleResources
is true indicating that the task's portal item contains style resources.
AGSExportVectorTilesResult::itemResourceCache
representing the cache that will contain the custom style resources. startWithStatusHandler:completion: (AGSExportVectorTilesJob)
downloadDirectory | where the cutom style resources will be saved. |
AGSExportVectorTilesResult
. - (AGSExportVectorTilesJob*) exportVectorTilesJobWithParameters: | (AGSExportVectorTilesParameters *) | parameters | |
downloadFileURL: | (NSURL *) | downloadFileURL | |
Returns a job which can be used to generate and download a vector tile package containing tiles and the default style resources associated with the service. The result of the job will be of type AGSExportVectorTilesResult
. Note, if this task is based on a portal item that has custom style overrides (hasStyleResources
= true), the custom style will not be downloaded and as a result the exported vector tiles may look different when viewed in a map. To download the custom styles, consider using exportStyleResourceCacheJobWithDownloadDirectory:
or exportVectorTilesJobWithParameters:vectorTileCacheDownloadFileURL:itemResourceCacheDownloadDirectory:
.
AGSExportVectorTilesResult::vectorTileCache
representing the cache that will contain the vector tiles. startWithStatusHandler:completion: (AGSExportVectorTilesJob)
. parameters | specifying which tiles to include in the tile package. |
downloadFileURL | where the tile package should be saved on disk, including the desired file name ending with the .vtpk file extension. |
AGSExportVectorTilesResult
. - (AGSExportVectorTilesJob*) exportVectorTilesJobWithParameters: | (AGSExportVectorTilesParameters *) | parameters | |
vectorTileCacheDownloadFileURL: | (NSURL *) | vectorTileCacheDownloadFileURL | |
itemResourceCacheDownloadDirectory: | (NSURL *) | itemResourceCacheDownloadDirectory | |
Returns a job which can be used to generate and download a vector tile package containing the tiles specified by the parameters. The task portal item's associated style resources will be downloaded and saved separately to itemResourceCacheDownloadDirectory
. Only applicable if hasStyleResources
is true indicating that the task's portal item contains style resources. The result of the job will be of type AGSExportVectorTilesResult
AGSExportVectorTilesResult::vectorTileCache
representing the cache that will contain the vector tiles. AGSExportVectorTilesResult::itemResourceCache
representing the cache that will contain the custom style resources. startWithStatusHandler:completion: (AGSExportVectorTilesJob)
. parameters | specifying which tiles to include in the tile package. |
vectorTileCacheDownloadFileURL | where the tile package should be saved on disk, including the desired file name ending with the .vtpk file extension. |
itemResourceCacheDownloadDirectory | where the custom style resources will be saved. |
AGSExportVectorTilesResult
. + (instancetype) exportVectorTilesTaskWithPortalItem: | (AGSPortalItem *) | portalItem |
Creates an export vector tiles task with an item on ArcGIS Online or ArcGIS portal representing an ArcGIS vector tile layer. The item's type must be an AGSPortalItemTypeVectorTileService
object or the task will fail to load.
AGSVectorTileSourceInfo::exportTilesAllowed
. portalItem | A portal item representing an ArcGIS vector tile layer. |
+ (instancetype) exportVectorTilesTaskWithURL: | (NSURL *) | URL |
Creates an export vector tiles task with a URL to a vector tile service.
The URL can be:
AGSBasemapStyle
objectIf the URL represents an AGSPortalItem
object that can be used to download vector tiles or style resources, the AGSExportVectorTilesTask::portalItem
property will be populated when the task is loaded.
URL | The URL of a service or portal item to be used for exporting vector tiles. |
- (instancetype) initWithPortalItem: | (AGSPortalItem *) | portalItem |
Creates an export vector tiles task with an item on ArcGIS Online or ArcGIS portal representing an ArcGIS vector tile layer. The item's type must be AGSPortalItemTypeVectorTileService
.
AGSVectorTileSourceInfo::exportTilesAllowed
. portalItem | A portal item representing an ArcGIS vector tile layer. |
- (instancetype) initWithURL: | (NSURL *) | URL |
Creates an export vector tiles task with a URL to a vector tile service.
The URL can be:
AGSBasemapStyle
objectIf the URL represents an AGSPortalItem
object that can be used to download vector tiles or style resources, the AGSExportVectorTilesTask::portalItem
property will be populated when the task is loaded.
URL | The URL of a service or portal item to be used for exporting vector tiles. |
- (void) loadDidFinishWithError: | (nullable NSError *) | error |
Only subclasses should call this method in doStartLoading: (AGSLoadableBase(ForSubclassEyesOnly))
and doCancelLoading (AGSLoadableBase(ForSubclassEyesOnly))
when done loading or failed to load.
Provided by category AGSLoadableBase(ForSubclassEyesOnly).
|
requiredinherited |
Loads data for the object asynchronously. The completion block is invoked upon completion.
You can call this method any number of times, however only one attempt is made to load the data. If it is already loading, it will just continue to load (i.e. not force a reload). If it has already loaded successfully, the completion block will be invoked right away. If it has already failed to load, the completion block will be invoked right away with error previously encountered. This method supports multiple callers and will call them all back on completion. However, each caller's completion block will be invoked once and only once.
completion | block that is invoked when object loads successfully or fails to load. An error is passed to the block if the object fails to load. |
- cancelLoad
to cancel loading - retryLoadWithCompletion:
to force reload - (void) onLoadStatusChanged |
Never call this method directly. The framework calls this method on a background thread when AGSLoadable::loadStatus
changes is called. Subclasses can optionally implement this to know when their loading status has changed.
Provided by category AGSLoadableBase(ForSubclassEyesOnly).
|
requiredinherited |
Tries to reload when an object has failed to load. This method should be called judiciously. It should be called when:
cancelLoad
and then this methodIf the data hasn't started loading, it will start loading. If it is already loading, it will just continue to load. If it has already loaded successfully, calls back right away. If it has already failed to load, tries again. This method supports multiple callers and will call them all back on completion. However, each caller's completion block will be invoked once and only once.
completion | block that is invoked when object loads successfully or fails to load. An error is passed to the block if the object fails to load. |
|
readwriterequirednonatomiccopyinherited |
The API key to access API key enabled services and resources in ArcGIS Online.
An API key is a unique key used to authorize access to specific services and resources in ArcGIS Online. It is also used to monitor access to those services. An API key is created and managed in the ArcGIS developer dashboard and is tied to a specific ArcGIS account.
In addition to setting an API key at a global level for your application using the AGSArcGISRuntimeEnvironment::APIKey
property, you can set an AGSAPIKeyResource::APIKey
property on any ArcGIS Runtime class that implements AGSAPIKeyResource
. When you set an individual AGSAPIKeyResource::APIKey
property on an AGSAPIKeyResource
it will override the default key at the global level (on the AGSArcGISRuntimeEnvironment::APIKey
property, in other words), enabling more granular usage telemetry and management for ArcGIS Online resources used by your app. Classes that expose an API key property by implementing AGSAPIKeyResource
include:
|
readwritenonatomicstronginherited |
Security credentials to access the remote resource. Only applicable if the resource is secured.
|
readnonatomicassign |
Indicates if the task's portal item has any associated style resources. These resources are typically used to override the service's default style.
exportStyleResourceCacheJobWithDownloadDirectory:
to download the style without any tiles. Use exportVectorTilesJobWithParameters:vectorTileCacheDownloadFileURL:itemResourceCacheDownloadDirectory:
to download the style and the tiles.
|
readnonatomicstronginherited |
The error that was encountered during the most recent load operation. Will be nil if the operation succeeded.
|
readrequirednonatomicassigninherited |
Status of the load operation.
|
readnonatomicstrong |
Portal item representing an ArcGIS vector tile service. The item's type must be AGSPortalItemTypeVectorTileService
.
hasStyleResources
. nil
if the task was initialized with a URL.
|
readwritenonatomicstronginherited |
The AGSRequestConfiguration object which defines the behavior and policies to use when accessing the remote resource. The default will be nil. If it is nil the [AGSRequestConfiguration globalConfiguration] will be used.
|
readnonatomicstrong |
The URL for exporting vector tiles.
This property can be the URL of:
AGSBasemapStyle
objectIf the URL represents an AGSPortalItem
object that can be used to download vector tiles or style resources, the AGSExportVectorTilesTask::portalItem
property will be populated when the task is loaded.
|
readnonatomicstrong |
Information about the source of vector tiles that this task will extract tiles from. The AGSVectorTileSourceInfo::exportTilesAllowed
property should permit the tiles to be exported.