Click or drag to resize

ArcGISVectorTiledLayer Class

A class that allows you to display data from an AcrGIS Vector Tile data source.
Inheritance Hierarchy
SystemObject
  Esri.ArcGISRuntime.MappingLayer
    Esri.ArcGISRuntime.MappingArcGISVectorTiledLayer

Namespace:  Esri.ArcGISRuntime.Mapping
Assembly:  Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: 100.7.0.0
Syntax
public sealed class ArcGISVectorTiledLayer : Layer

The ArcGISVectorTiledLayer type exposes the following members.

Constructors
  NameDescription
Public methodArcGISVectorTiledLayer
Initializes a new instance of the ArcGISVectorTiledLayer class.
Public methodCode exampleArcGISVectorTiledLayer(Uri)
Initializes a new instance of the ArcGISVectorTiledLayer class from the specified URI.
Public methodArcGISVectorTiledLayer(Item)
Initializes a new instance of the ArcGISVectorTiledLayer class from the specified Item.
Public methodArcGISVectorTiledLayer(VectorTileCache)
Initializes a new instance of the ArcGISVectorTiledLayer class from the specified VectorTileCache.
Public methodArcGISVectorTiledLayer(VectorTileCache, ItemResourceCache)
Initializes a new instance of the ArcGISVectorTiledLayer class from the specified VectorTileCache and ItemResourceCache.
Top
Properties
  NameDescription
Public propertyAttribution
Gets the attribution text for the layer.
(Inherited from Layer.)
Public propertyCanChangeVisibility
Gets a value indicating whether the layer content's visibility can be changed.
(Inherited from Layer.)
Public propertyCredential
Gets or sets the Credential used to access a remote service.
Public propertyDescription
Gets the description for the layer.
(Inherited from Layer.)
Public propertyCode exampleFullExtent
Gets the full extent of the layer, which is the extent where all the data in the layer is contained.
(Inherited from Layer.)
Public propertyCode exampleId
Gets or sets an identifier for the layer
(Inherited from Layer.)
Public propertyIsIdentifyEnabled
Gets a value indicating whether the layer supports the identify operation.
(Inherited from Layer.)
Public propertyIsVisible
Gets or sets a value indicating whether the layer content is visible.
(Inherited from Layer.)
Public propertyItem
Gets the ArcGIS Item
(Inherited from Layer.)
Public propertyItemResourceCache
Gets the ItemResourceCache or null if no item resource cache is present.
Public propertyLoadError
Gets the load error of the layer, if there is one.
(Inherited from Layer.)
Public propertyCode exampleLoadStatus
Gets the load status of the layer.
(Inherited from Layer.)
Public propertyCode exampleMaxScale
Gets or sets the maximum scale where the layer is visible.
(Inherited from Layer.)
Public propertyCode exampleMinScale
Gets or sets the minimum scale where the layer is visible.
(Inherited from Layer.)
Public propertyCode exampleName
Gets or sets the name of the layer content.
(Inherited from Layer.)
Public propertyCode exampleOpacity
Gets or sets the opacity of the layer.
(Inherited from Layer.)
Public propertyShowInLegend
Gets or sets a value indicating whether the layer content participates in the legend.
(Inherited from Layer.)
Public propertySource
Gets or sets the endpoint of the vector tiled map service or the path to a vector tile package.
Public propertySourceInfo
Gets the VectorTileSourceInfo metadata.
Public propertySpatialReference
Gets the spatial reference of the layer.
(Inherited from Layer.)
Public propertyStyle
Gets the VectorTileStyle.
Public propertyCode exampleSublayerContents
Gets the sub layer contents of a layer content.
(Inherited from Layer.)
Public propertyVectorTileCache
Gets the underlying VectorTileCache or null if no vector tile cache is present.
Top
Methods
  NameDescription
Public methodCancelLoad
Cancels an ongoing load.
(Inherited from Layer.)
Public methodCode exampleClone
Clones this instance of Layer and its members.
(Inherited from Layer.)
Public methodGetLegendInfosAsync
Returns an immutable list of LegendInfo.
(Inherited from Layer.)
Public methodIsVisibleAtScale
Returns the layer content's effective visibility at the specified scale.
(Inherited from Layer.)
Public methodCode exampleLoadAsync
Initiates loading of a layer
(Inherited from Layer.)
Public methodRetryLoadAsync
Retry loading the layer.
(Inherited from Layer.)
Top
Events
  NameDescription
Public eventLoaded
Occurs when the layer is loaded.
(Inherited from Layer.)
Public eventCode exampleLoadStatusChanged
Occurs when the layer LoadStatus is changed.
(Inherited from Layer.)
Public eventPropertyChanged
Occurs when a property value changes.
(Inherited from Layer.)
Top
Remarks

Vector Tiled Layers are much like ArcGIS Tiled Layer. They are a layer in the map loaded from ArcGIS online, Portal for ArcGIS, ArcGIS for server, or a local vector tile 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, 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, since 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 portal item. 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.

Examples

WPF

Example Name: ArcGISVectorTiledLayerUrl

Load an ArcGIS Vector Tiled Layer from a URL.

Code example screen shot.

C#
// Copyright 2018 Esri.
// 
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
// language governing permissions and limitations under the License.

using Esri.ArcGISRuntime.Mapping;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Controls;

namespace ArcGISRuntime.WPF.Samples.ArcGISVectorTiledLayerUrl
{
    [ArcGISRuntime.Samples.Shared.Attributes.Sample(
        "ArcGIS vector tiled layer (URL)",
        "Layers",
        "This sample demonstrates how to create a ArcGISVectorTiledLayer and bind this to a Basemap which is used in the creation of a map.",
        "")]
    public partial class ArcGISVectorTiledLayerUrl
    {
        // Dictionary associates layer names with URIs
        private Dictionary<string, Uri> _layerUrls = new Dictionary<string, Uri>()
        {
            {"Mid-Century", new Uri("https://www.arcgis.com/home/item.html?id=7675d44bb1e4428aa2c30a9b68f97822")},
            {"Colored Pencil", new Uri("https://www.arcgis.com/home/item.html?id=4cf7e1fb9f254dcda9c8fbadb15cf0f8")},
            {"Newspaper", new Uri("https://www.arcgis.com/home/item.html?id=dfb04de5f3144a80bc3f9f336228d24a")},
            {"Nova", new Uri("https://www.arcgis.com/home/item.html?id=75f4dfdff19e445395653121a95a85db")},
            {"World Street Map (Night)", new Uri("https://www.arcgis.com/home/item.html?id=86f556a2d1fd468181855a35e344567f")}
        };

        public ArcGISVectorTiledLayerUrl()
        {
            InitializeComponent();

            // Create the UI, setup the control references and execute initialization
            Initialize();
        }

        private void Initialize()
        {
            // Create a new ArcGISVectorTiledLayer
            ArcGISVectorTiledLayer vectorTiledLayer = new ArcGISVectorTiledLayer(_layerUrls.Values.First());

            // Create new Map with basemap
            Map myMap = new Map(new Basemap(vectorTiledLayer));

            // Set titles as items source
            VectorLayersChooser.ItemsSource = _layerUrls.Keys;

            // Select the first item
            VectorLayersChooser.SelectedIndex = 0;

            // Assign the map to the MapView
            MyMapView.Map = myMap;
        }

        private void OnVectorLayersChooserSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            // Get the user's selection
            string selectedVectorLayer = e.AddedItems[0].ToString();

            // Get the URL from the dictionary
            Uri vectorTiledLayerUrl = _layerUrls[selectedVectorLayer];

            // Create a new ArcGISVectorTiledLayer with the URI Selected by the user
            ArcGISVectorTiledLayer vectorTiledLayer = new ArcGISVectorTiledLayer(vectorTiledLayerUrl);

            // Create new Map with basemap 
            MyMapView.Map = new Map(new Basemap(vectorTiledLayer));
        }
    }
}
XAML
<UserControl x:Class="ArcGISRuntime.WPF.Samples.ArcGISVectorTiledLayerUrl.ArcGISVectorTiledLayerUrl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013"
             mc:Ignorable="d">
    <Grid>
        <esri:MapView x:Name="MyMapView" />
        <Border Style="{StaticResource BorderStyle}">
            <StackPanel>
                <TextBlock Text="Select a vector layer." 
                           Margin="5" TextAlignment="Center" TextWrapping="Wrap" />
                <ComboBox x:Name="VectorLayersChooser" 
                          Margin="5" 
                          SelectionChanged="OnVectorLayersChooserSelectionChanged"/>
            </StackPanel>
        </Border>
    </Grid>
</UserControl>
See Also
Additional Examples
Hyperlink to ExampleDescription
ArcGISVectorTiledLayerUrlLoad an ArcGIS Vector Tiled Layer from a URL.