Class MapboxVectorFeature

Mapbox Vector Feature types are all bundled in one class to make it easier to read. Primarily contains an id, properties, and geometry. The now deprecated S2 model extends this class to include indices and tesselation data.

Constructors

  • Parameters

    • pbf: Pbf

      the pbf protocol we are reading from

    • end: number

      the position to stop at

    • isS2: boolean

      whether the layer is a deprecated S2 layer or Mapbox layer.

    • extent: number

      the extent of the vector tile

    • version: number

      the version of the vector tile. S2 is 5, Mapbox is 1

    • keys: string[]

      the keys in the vector layer to pull from

    • values: Value[]

      the values in the vector layer to pull from

    Returns MapboxVectorFeature

Accessors

  • get hasMValues(): boolean
  • Returns boolean

    • MapboxVectorTile's do not support m-values so we return false

Methods

  • Add tesselation data to the geometry

    Parameters

    • geometry: number[]

      the geometry to add the tesselation data to

    • multiplier: number

      the multiplier to apply the extent shift

    Returns void

  • Returns BBox | BBox3D

    • a default bbox. Since no bbox is present, the default is [0, 0, 0, 0] also MapboxVectorTile's do not support 3D, so we only return a 2D bbox
  • Returns [geometry: VectorGeometry | number[], indices: number[]]

    • [flattened geometry & tesslation if applicable, indices]
  • Returns Point[]

    • regardless of the type, we return a flattend point array
  • Returns number[]

    • an array of indices for the geometry