Skip to content

Design Proposal: Add encoding field to vector source #1252

@TimSylvester

Description

@TimSylvester

Design Proposal: Add encoding field to vector source to allow for alternative tile formats.

Motivation

To support MapLibre Tiles, or other formats, MapLibre needs to know that a source is in that format.

Proposed Change

Add an encoding field to vector source, closely based on the same field from raster source.

The default is "mvt," indicating the existing behavior.

Examples

These are equivalent, both producing the same results as any previous style:

"source-vector-default": {
      "type": "vector",
      "url": "https://demotiles.maplibre.org/tiles/tiles.json"
    },
    "source-vector-mapbox": {
      "type": "vector",
      "url": "https://demotiles.maplibre.org/tiles/tiles.json",
      "encoding": "mvt"
    },

This would cause MapLibre to expect MLT-format tiles:

    "source-vector-maplibre": {
      "type": "vector",
      "url": "https://demotiles.maplibre.org/mlt-tiles/tiles.json",
      "encoding": "mlt"
    },

API Modifications

No API changes are necessary.

Migration Plan and Compatibility

Proposed changes are fully backward-compatible, so no migration is needed.

Rejected Alternatives

A new source type.

References

#1251

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions