Class ArcGISVectorTiledLayer
- java.lang.Object
-
- com.esri.arcgisruntime.layers.Layer
-
- com.esri.arcgisruntime.layers.ArcGISVectorTiledLayer
-
- All Implemented Interfaces:
ApiKeyResource
,RemoteResource
,LayerContent
,Loadable
public final class ArcGISVectorTiledLayer extends Layer implements RemoteResource, ApiKeyResource
Displays data from an ArcGIS vector tiled data source.The ArcGIS vector tiled layer is similar to the ArcGIS tiled layer. An ArcGIS vector tiled Layer is loaded from ArcGIS Online, ArcGIS Enterprise, ArcGIS Server, or a local vector tiled layer package file. The tile data format is optimized to reduce network bandwidth and reduce CPU load while rendering the tiles. Vector tiled layers are appropriate for basemap, reference and possibly operational layers. They do not contain any feature data, and do not support identify or search operations.
Vector tiles are an alternative to raster tile basemap layers. 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 tiles is binary and conforms to the Mapbox Vector Tile Specification. The vector tile file format requires much less space than raster tiles. Also, because the cartography is rendered at runtime, the differences between levels of detail appear more continuous than with raster tiles.
To create a vector tiled layer, the runtime client is given either a URI or a
PortalItem
. The URI can point to a vector tile source, a vector tile style sheet, or a local vector tile package file. The portal item will contain a URI to a vector tile stylesheet. 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.
Vector tile packages can also be downloaded from a ArcGIS Online vector tile service. The vector tile package is a single file (.vptk) 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 are also distributed inside Mobile Map Packages. The MMPK contains JSON that points to the location of the vector tile style sheet or the root of the vector tile package data.
- Since:
- 100.0.0
- See Also:
Layer
-
-
Constructor Summary
Constructors Constructor Description ArcGISVectorTiledLayer(VectorTileCache vectorTileCache)
Creates a new ArcGISVectorTiledLayer from a vector tile cache.ArcGISVectorTiledLayer(VectorTileCache vectorTileCache, ItemResourceCache itemResourceCache)
Creates a new ArcGISVectorTiledLayer from the specified VectorTileCache and ItemResourceCache objects.ArcGISVectorTiledLayer(PortalItem portalItem)
Creates a new ArcGISVectorTiledLayer based on the portal item.ArcGISVectorTiledLayer(String dataSourceUri)
Creates a new ArcGISVectorTiledLayer from either the ArcGIS Vector Tile Service, Vector Tile Style Sheet indicated by the given URI, or the path to a Local Vector tile package(VTPK).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArcGISVectorTiledLayer
copy()
Creates a deep copy of this ArcGISVectorTiledLayer instance.String
getApiKey()
Gets the API key to access API key enabled services and resources in ArcGIS Online.Credential
getCredential()
Gets theCredential
that is set on the network-enabled resource.ItemResourceCache
getItemResourceCache()
Gets the item resource cache or null if no item resource cache is present.RequestConfiguration
getRequestConfiguration()
Gets theRequestConfiguration
used to modify the parameters of network requests made by thisRemoteResource
.VectorTileSourceInfo
getSourceInfo()
Gets the Vector Tile Source info.VectorTileStyle
getStyle()
Gets the VectorTileStyle.String
getUri()
Gets the URI of thisRemoteResource
.VectorTileCache
getVectorTileCache()
Gets the underlying vector tile cache for creating the vector tile layer, or null if no vector tile cache is present.void
setApiKey(String apiKey)
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, removeDoneLoadingListener, removeLoadStatusChangedListener, removeVisibilityChangedListener, retryLoadAsync, setCanShowInLegend, setDescription, setId, setMaxScale, setMinScale, setName, setOpacity, setVisible
-
-
-
-
Constructor Detail
-
ArcGISVectorTiledLayer
public ArcGISVectorTiledLayer(String dataSourceUri)
Creates a new ArcGISVectorTiledLayer from either the ArcGIS Vector Tile Service, Vector Tile Style Sheet indicated by the given URI, or the path to a Local Vector tile package(VTPK).- Parameters:
dataSourceUri
- the Vector Tile Source service URL, Vector Tile Style Sheet URL, Path to local VTPK- Throws:
IllegalArgumentException
- if dataSourceUri is null or empty- Since:
- 100.0.0
-
ArcGISVectorTiledLayer
public ArcGISVectorTiledLayer(PortalItem portalItem)
Creates a new ArcGISVectorTiledLayer based on the portal item.- Parameters:
portalItem
- the PortalItem associated with this ArcGISVectorTiledLayer instance- Throws:
IllegalArgumentException
- if portalItem is null- Since:
- 100.0.0
-
ArcGISVectorTiledLayer
public ArcGISVectorTiledLayer(VectorTileCache vectorTileCache)
Creates a new ArcGISVectorTiledLayer from a vector tile cache.- Parameters:
vectorTileCache
- the vector tile cache to use- Throws:
IllegalArgumentException
- if vectorTileCache is null- Since:
- 100.2.0
-
ArcGISVectorTiledLayer
public ArcGISVectorTiledLayer(VectorTileCache vectorTileCache, ItemResourceCache itemResourceCache)
Creates a new ArcGISVectorTiledLayer from the specified VectorTileCache and ItemResourceCache objects. If itemResourceCache is null, it is equivalent to the constructorArcGISVectorTiledLayer(VectorTileCache)
.- Parameters:
vectorTileCache
- the vector tile cache to useitemResourceCache
- the vector tile style to use- Throws:
IllegalArgumentException
- if vectorTileCache is null.- Since:
- 100.2.0
-
-
Method Detail
-
getSourceInfo
public VectorTileSourceInfo getSourceInfo()
Gets the Vector Tile Source info.- Returns:
- the source info
- Since:
- 100.0.0
-
getStyle
public VectorTileStyle getStyle()
Gets the VectorTileStyle.- Returns:
- the style
- Since:
- 100.0.0
-
copy
public ArcGISVectorTiledLayer 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
public VectorTileCache 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 this property will return the vector tile cache. If this layer was created from a remote URI, this property will return null.
- Returns:
- the vector tile cache or null if no vector tile cache available
- Since:
- 100.2.0
-
getItemResourceCache
public ItemResourceCache getItemResourceCache()
Gets the item resource cache or null if no item resource cache is present.- Returns:
- the item resource cache or null if no item resource cache available
- Since:
- 100.2.0
-
getCredential
public Credential 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
public void setCredential(Credential credential)
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
public RequestConfiguration 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
public void setRequestConfiguration(RequestConfiguration requestConfiguration)
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
public String 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
public String 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 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 callApiKeyResource.setApiKey(String)
on any ArcGIS Runtime 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:
ApiKeyResource.setApiKey(String)
-
setApiKey
public void setApiKey(String apiKey)
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 ArcGIS Runtime 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:
ApiKeyResource.getApiKey()
-
-