Class Protocol

MapLibre GL JS protocol. Must be added once globally.

Constructors

Properties

Methods

Constructors

  • Initialize the MapLibre PMTiles protocol.

    • metadata: also load the metadata section of the PMTiles. required for some "inspect" functionality and to automatically populate the map attribution. Requires an extra HTTP request.
    • errorOnMissingTile: When a vector MVT tile is missing from the archive, raise an error instead of returning the empty array. Not recommended. This is only to reproduce the behavior of ZXY tile APIs which some applications depend on when overzooming.

    Parameters

    • Optional options: {
          errorOnMissingTile?: boolean;
          metadata?: boolean;
      }
      • Optional errorOnMissingTile?: boolean
      • Optional metadata?: boolean

    Returns Protocol

Properties

errorOnMissingTile: boolean
metadata: boolean
tile: V3OrV4Protocol = ...

Methods

  • Add a PMTiles instance to the global protocol instance.

    For remote fetch sources, references in MapLibre styles like pmtiles://http://... will resolve to the same instance if the URLs match.

    Parameters

    Returns void

Generated using TypeDoc