XYZ Maps Documentation
    Preparing search index...

    Interface MVTLayerOptions

    Options to configure a MVTLayer.

    interface MVTLayerOptions {
        attribution?: string | DataSourceAttribution | DataSourceAttribution[];
        margin?: number;
        max?: number;
        maxDataZoom?: number;
        min?: number;
        name?: string;
        pointerEvents?: boolean;
        provider?:
            | TileProvider
            | { max: number; min: number; provider: TileProvider }[];
        providers?: any;
        remote: {
            max?: number;
            min?: number;
            tileSize?: number;
            url:
                | string
                | ((z: number, y: number, x: number, quadkey: string) => string);
        };
        style?: LayerStyle;
        tileSize?: number;
        visible?: boolean;
    }

    Hierarchy (View Summary)

    Index
    attribution?: string | DataSourceAttribution | DataSourceAttribution[]

    Attribution information for data sources used by this layer.

    Attributions are automatically displayed or hidden depending on whether the corresponding data is currently active or visible on the map — e.g., based on zoom level, layer visibility, or usage. This ensures that only active data providers are credited, as required by licensing.

    Can be a simple string (displayed as static text), or an array of structured attribution entries that support clickable labels and optional tooltips.

    // Simple attribution string
    attribution: "© Data Provider"
    // Multiple detailed attributions
    attribution: [
    {
    label: "© Elevation Provider",
    url: "https://elevation.example.com",
    title: "Elevation data source"
    },
    {
    label: "Imagery © HERE Maps",
    url: "https://www.here.com",
    title: "Satellite imagery by HERE"
    }
    ]
    margin?: number

    tileMargin that should be applied to all providers of the layer.

    max?: number

    maximum zoom level at which data from the TileLayer will be displayed.

    maxDataZoom?: number

    Maximum zoom level at which actual tile data is available from the data source.

    When the map is zoomed beyond this level, the layer will load tiles at maxDataZoom instead of the current viewport zoom level. This avoids unnecessary tile requests for zoom levels where no data exists.

    For example, if terrain data is only available up to zoom 15 but the map is at zoom 17, the display will request zoom-15 tiles and scale them up, while other layers (e.g., imagery) can still load tiles at zoom 17.

    Same as TileLayerOptions.max — tiles are loaded up to the layer's maximum visibility zoom level.

    min?: number

    minimum zoom level at which data from the TileLayer will be displayed.

    name?: string

    Name of the TileLayer.

    pointerEvents?: boolean

    Determines whether pointer events are enabled for all features of the layer.

    false
    
    provider?: TileProvider | { max: number; min: number; provider: TileProvider }[]

    The data provider(s) for the TileLayer.

    The provider can either be a single TileProvider or an array of {min: number, max: number, provider: TileProvider}, where "min" and "max" define the minimum and maximum zoom level at which data from the "provider" should be used. If a single provider is defined, it's data will be used for all zoom levels. If several providers are defined for a single zoom level, only the data of the first defined is used.

    Type Declaration

    • TileProvider
    • { max: number; min: number; provider: TileProvider }[]
      • max: number

        The maximum zoom level at which data from the TileProvider will be used.

      • min: number

        The minimum zoom level at which data from the TileProvider will be used.

      • provider: TileProvider

        The Tile Provider for the respective zoom level.

    providers?: any
    remote: {
        max?: number;
        min?: number;
        tileSize?: number;
        url:
            | string
            | ((z: number, y: number, x: number, quadkey: string) => string);
    }

    options to configure the remote MVT datasource

    Type Declaration

    • Optionalmax?: number

      The maximum zoom level for loading map tiles

      16
      
    • Optionalmin?: number

      The minimum zoom level for loading map tiles

      1
      
    • OptionaltileSize?: number

      defines the size of the mvt tile data in pixel.

      512
      
    • url: string | ((z: number, y: number, x: number, quadkey: string) => string)

      URL to the remote MVT endpoint.

      It is either a string which may contain the following flags that will be replaced:

      • {SUBDOMAIN_CHAR}: subdomain id(a, b, c and d) for balancing the load
      • {SUBDOMAIN_INT}: subdomain id(0, 1, 2 and 3) for balancing the load
      • {SUBDOMAIN_INT_1_4}: subdomain id(1, 2, 3 and 4) for balancing the load
      • {QUADKEY}: quadkey of the tile to be requested
      • {Z}: z of the tile to be requested
      • {X}: x of the tile to be requested
      • {Y}: y of the tile to be requested

      or a callback function that's called with the following parameters z,y,x,quadkey and needs to return the url for the respective tile. The callback function needs to handle custom parameters by its own.

      // string
      url: 'https://xyz.api.here.com/tiles/osmbase/512/all/{z}/{x}/{y}.mvt?access_token=YOUR_ACCESS_TOKEN'

      // callback function
      url: (z, y, x, quadkey) => {
      return `https://xyz.api.here.com/tiles/osmbase/512/all/${z}/${x}/${y}.mvt?access_token=YOUR_ACCESS_TOKEN`
      }
    style?: LayerStyle

    Style for rendering features in this layer.

    tileSize?: number

    the size of the tile data in pixel.

    512
    
    visible?: boolean

    Indicates whether the layer should be visible (true) or hidden (false).

    true