- All Implemented Interfaces:
ApiKeyResource
,RemoteResource
,LayerContent
,Loadable
VectorTileCache
.
An ArcGIS vector tiled layer displays vector tiles from an online vector tile service or a local vector tile cache (.vtpk file). Vector tiled layers are appropriate for basemap, reference, and possibly operational layers. They do not contain feature data, and do not support identify, search, or editing operations.
Vector tiles are an alternative to raster tile basemap layers, such as ArcGISTiledLayer
. Instead of pixels
(raster), the cartography is delivered using 2D points. The points describe lines, polygons, or the locations
of labels and marker symbols. The file format of vector tiles is binary and conforms to the
Mapbox Vector Tile Specification. This specification
allows a more continuous visual experience between levels of detail compared to raster tiles. The vector tile
file format requires less space than raster tiles and is optimized to reduce network bandwidth.
You can create a vector tiled layer using either a URI or a portal item. The URI can point to a vector tile source, a vector tile style sheet, or a local vector tile package (.vtpk) file. The portal item will contain a URI to a vector tile style sheet. The style sheet describes the appearance of the geometry and must be in the Mapbox GL Style format. The style sheet also contains a URI to a vector tile source. The source must be in the Mapbox TileJSON format. The source info includes a URI to a default style sheet.
More than one vector tile style sheet can use the same source. Both the source info and the style sheet are human readable JSON files.
You can also download vector tiles from an online vector tile service using ExportVectorTilesTask
.
The downloaded vector tile package is a single file (.vtpk) that contains all of the tile data files, the
source information, a style sheet, and the font and symbol marker resources required to display the map.
Vector tile packages can be distributed inside mobile map packages (.mmpk). The mobile map package JSON can point to the location of the vector tile style sheet or the root of the vector tile package data.
More information and reference samples on the ArcGIS developer website:
- Since:
- 100.0.0
- See Also:
-
Property Summary
Properties inherited from class com.esri.arcgisruntime.layers.Layer
loadError, loadStatus
-
Constructor Summary
ConstructorDescriptionArcGISVectorTiledLayer
(VectorTileCache vectorTileCache) Creates an ArcGIS Vector Tiled Layer from a vector tile cache.ArcGISVectorTiledLayer
(VectorTileCache vectorTileCache, ItemResourceCache itemResourceCache) Creates an ArcGIS Vector Tiled Layer from a vector tile cache and an item resource cache containingArcGISVectorTiledLayer
(PortalItem portalItem) Creates an ArcGIS Vector Tiled Layer from aPortalItem
.ArcGISVectorTiledLayer
(String dataSourceUri) Creates an ArcGIS Vector Tiled Layer from an ArcGIS Vector Tile Service URL, a Vector Tile Style Sheet URI, or the path to a local vector tile package (.vtpk) file. -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Creates a deep copy of this ArcGISVectorTiledLayer instance.Gets the API key to access API key enabled services and resources in ArcGIS Online.Gets theCredential
that is set on the network-enabled resource.Gets the item resource cache which contains a custom style that can be applied to this layer.Gets theRequestConfiguration
used to modify the parameters of network requests made by thisRemoteResource
.Gets the Vector Tile Source info.getStyle()
Gets the VectorTileStyle.getUri()
Gets the URI of thisRemoteResource
.Gets the underlying vector tile cache for creating the vector tile layer, or null if no vector tile cache is present.void
Sets the API key to access API key enabled services and resources in ArcGIS Online.void
setCredential
(Credential credential) Sets aCredential
to be used by the network-enabled resource in the event of an authentication challenge.void
setRequestConfiguration
(RequestConfiguration requestConfiguration) Sets theRequestConfiguration
used to modify the parameters of network requests made by thisRemoteResource
.Methods inherited from class com.esri.arcgisruntime.layers.Layer
addDoneLoadingListener, addLoadStatusChangedListener, addVisibilityChangedListener, cancelLoad, canChangeVisibility, canShowInLegend, fetchLegendInfosAsync, getAttribution, getDescription, getFullExtent, getId, getItem, getLoadError, getLoadStatus, getMaxScale, getMinScale, getName, getOpacity, getSpatialReference, getSubLayerContents, isIdentifyEnabled, isVisible, isVisibleAtScale, loadAsync, loadErrorProperty, loadStatusProperty, removeDoneLoadingListener, removeLoadStatusChangedListener, removeVisibilityChangedListener, retryLoadAsync, setCanShowInLegend, setDescription, setId, setMaxScale, setMinScale, setName, setOpacity, setVisible
-
Constructor Details
-
ArcGISVectorTiledLayer
Creates an ArcGIS Vector Tiled Layer from an ArcGIS Vector Tile Service URL, a Vector Tile Style Sheet URI, or the path to a local vector tile package (.vtpk) file.- Parameters:
dataSourceUri
- an ArcGIS Vector Tile Service URL, an ArcGIS Vector Tile Style Sheet URI, or the path to a local vector tile package (.vtpk) file- Throws:
IllegalArgumentException
- if dataSourceUri is null or empty- Since:
- 100.0.0
-
ArcGISVectorTiledLayer
Creates an ArcGIS Vector Tiled Layer from aPortalItem
.- Parameters:
portalItem
- the PortalItem associated with this ArcGISVectorTiledLayer instance- Throws:
IllegalArgumentException
- if portalItem is null- Since:
- 100.0.0
-
ArcGISVectorTiledLayer
Creates an ArcGIS Vector Tiled Layer from a vector tile cache.You can download a vector tile cache by using the
ExportVectorTilesTask
.- Parameters:
vectorTileCache
- the vector tile cache to use- Throws:
IllegalArgumentException
- if vectorTileCache is null- Since:
- 100.2.0
-
ArcGISVectorTiledLayer
Creates an ArcGIS Vector Tiled Layer from a vector tile cache and an item resource cache containing- Parameters:
vectorTileCache
- the vector tile cache to useitemResourceCache
- the item resource cache contains a custom style, may be null- Throws:
IllegalArgumentException
- if vectorTileCache is null.- Since:
- 100.2.0
-
-
Method Details
-
getSourceInfo
Gets the Vector Tile Source info.- Returns:
- the source info
- Since:
- 100.0.0
-
getStyle
Gets the VectorTileStyle.- Returns:
- the style
- Since:
- 100.0.0
-
copy
Creates a deep copy of this ArcGISVectorTiledLayer instance.- Returns:
- a deep copy of this ArcGISVectorTiledLayer instance, which means that copies of all fields of this layer are made including its loading state
- Since:
- 100.1.0
-
getVectorTileCache
Gets the underlying vector tile cache for creating the vector tile layer, or null if no vector tile cache is present.If this layer was created from a vector tile cache or a local file URI, then it will return the vector tile cache. If this layer was created from a remote URI, it will return null.
- Returns:
- the vector tile cache or null if no vector tile cache available
- Since:
- 100.2.0
-
getItemResourceCache
Gets the item resource cache which contains a custom style that can be applied to this layer.- Returns:
- the item resource cache or null if no item resource cache available
- Since:
- 100.2.0
-
getCredential
Description copied from interface:RemoteResource
Gets theCredential
that is set on the network-enabled resource.Only applicable if the resource is secured.
- Specified by:
getCredential
in interfaceRemoteResource
- Returns:
- the Credential, or null if there is none
-
setCredential
Description copied from interface:RemoteResource
Sets aCredential
to be used by the network-enabled resource in the event of an authentication challenge. The default credential is null.Only applicable if the resource is secured.
- Specified by:
setCredential
in interfaceRemoteResource
- Parameters:
credential
- the Credential to be used for authentication
-
getRequestConfiguration
Description copied from interface:RemoteResource
Gets theRequestConfiguration
used to modify the parameters of network requests made by thisRemoteResource
.- Specified by:
getRequestConfiguration
in interfaceRemoteResource
- Returns:
- the
RequestConfiguration
used to modify network requests
-
setRequestConfiguration
Description copied from interface:RemoteResource
Sets theRequestConfiguration
used to modify the parameters of network requests made by thisRemoteResource
. If not set, the globalRequestConfiguration
will be used (seeRequestConfiguration.getGlobalRequestConfiguration()
).- Specified by:
setRequestConfiguration
in interfaceRemoteResource
- Parameters:
requestConfiguration
- the RequestConfiguration used to modify network requests
-
getUri
Description copied from interface:RemoteResource
Gets the URI of thisRemoteResource
. Typically this is the URI used to instantiate the object.- Specified by:
getUri
in interfaceRemoteResource
- Returns:
- the URI of this RemoteResource
-
getApiKey
Description copied from interface:ApiKeyResource
Gets the API key to access API key enabled services and resources in ArcGIS Online.An API key is a unique long-lived access token that is used to authenticate and monitor requests to ArcGIS location services and private portal items. You can create and manage an API key using your portal when you sign in with an ArcGIS Location Platform account or an ArcGIS Online account with administrator access or a custom role that has the Generate API keys privilege. To learn how to create and manage API keys, go to the Create an API Key tutorial. You must ensure that your API key has the correct privileges to access secure resources.
In addition to setting an API key at a global level for your application using
ArcGISRuntimeEnvironment.setApiKey(String)
, you can callApiKeyResource.setApiKey(String)
on any class that implementsApiKeyResource
. When you callsetApiKey(String)
on anAPIKeyResource
, it will override the default key at the global level (the key returned byArcGISRuntimeEnvironment.getApiKey()
, 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 APIKeyResource include:
- Specified by:
getApiKey
in interfaceApiKeyResource
- Returns:
- the API key to access API key enabled services and resources in ArcGIS Online
- See Also:
-
setApiKey
Description copied from interface:ApiKeyResource
Sets 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
ArcGISRuntimeEnvironment.setApiKey(String)
, you can callsetApiKey(String)
on any class that implementsApiKeyResource
. When you callsetApiKey(String)
on anAPIKeyResource
, it will override the default key at the global level (the key returned byArcGISRuntimeEnvironment.getApiKey()
, 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 APIKeyResource include:
- Specified by:
setApiKey
in interfaceApiKeyResource
- Parameters:
apiKey
- the API key to access API key enabled services and resources in ArcGIS Online- See Also:
-