WMTS layer

View inWPFUWPFormsiOSAndroid
View on GitHub

Display a layer from a Web Map Tile Service.

Image of WMTS layer

Use case

WMTS services can have several layers. You can use Runtime to explore the layers available from a service. This would commonly be used to enable a browsing experience where users can choose which layers they want to display at run time.

How to use the sample

The layer will be displayed automatically. Use the buttons to choose a different method of loading the layer.

How it works

To display a WMTS layer directly from a URL:

  1. Create a WmtsService object using the URL of the WMTS service.
  2. Create a WmtsLayer object with the ID of the layer to display.

To explore layers from a WMTS service:

  1. Create a WmtsService object using the URL of the WMTS service.
  2. After loading the WMTS service, get the list of WmtsLayerInfo objects from the service info of the WMTS service.
  3. Use one of the layer infos to create the WMTS layer.
  4. Create a basemap with the WMTS layer and set it to the map.

Relevant API

  • WmtsLayer
  • WmtsLayerInfo
  • WmtsService
  • WmtsServiceInfo

About the data

The map visualizes world time zones.


layer, OGC, raster, tiled, web map tile service

Sample Code

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
            <RowDefinition Height="60" />
            <RowDefinition Height="60" />
            <RowDefinition Height="*" />
        <Button x:Name="UriButton" Text="WMTSLayer via Uri" Clicked="UriButton_Click" Grid.Row="0" IsEnabled="false" />
        <Button x:Name="InfoButton" Text="WMTSLayer via WmtsLayerInfo" Clicked="InfoButton_Click" Grid.Row="1" />
        <esriUI:MapView x:Name="MyMapView" Grid.Row="2" />