Skip to content

ImageOverlayPlugins: Add MVT Support#1575

Merged
gkjohnson merged 63 commits into
masterfrom
mvt-support
May 17, 2026
Merged

ImageOverlayPlugins: Add MVT Support#1575
gkjohnson merged 63 commits into
masterfrom
mvt-support

Conversation

@gkjohnson
Copy link
Copy Markdown
Contributor

@gkjohnson gkjohnson commented May 14, 2026

Based on #1469

Add support for MVT tiles as an image overlay with the goal of supporting MVT and PMTiles formats. MVT is assumed to be served in an XYZ slippy-maps style format.

Future

  • TerrainRGB (somehow enable PMTiles to be a data source instead of fetch?)
  • Hovering, mouse effect
  • Consider performance improvements for drawing
    • "bake" paths into a Path2D, preparse all features
    • redraw only visible tiles
    • webworker-based drawing
    • parsed to 3d assets, drawn (ala MapLibre, Overture Maps, Mapbox)
    • skip redrawing tiles that do not include changed styles
  • Scale lines, points based on projected world size
  • Adjust texture resolution based on world size (possibly fixes above)
  • Register MVT as a "texture type" or "drawable type" and PMTiles as a "fetch protocol" of sorts.
  • Mark associated tiled formats in Plugins: Add support for other tiled formats #943
Style approach
styles: {
  rules: [
    { layer: 'water',    type: 'fill', paint: { 'fill-color': '#a0c8f0' } },
    { layer: 'building', type: 'fill', paint: { 'fill-color': '#e0e0e0', 'fill-opacity': 0.8 } },
    { layer: 'road',     type: 'line', paint: (f, l, z) => ({ 'line-width': z > 10 ? 2 : 1, 'line-color': '#888' }) },
    { type: 'fill',   paint: { 'fill-color': '#ffffff', 'fill-opacity': 0.3 } }, // fallback fill
    { type: 'line',   paint: { 'line-color': '#ffffff', 'line-width': 1 } },     // fallback line
    { type: 'circle', paint: { 'circle-color': '#ffffff', 'circle-radius': 3 } } // fallback circle
  ]
}

--

Triangulated geometry for flat or ellipsoidal surfaces will remain for future work since they are not applicable to overlays.

Vectorized shape notes
  • Vectorized shapes can be triangulated with earcut
  • If projected onto a sphere, the shape can be cut into a grid and projected
  • Edges / points are mitered and scaled to screenspace in the vertex shader with offsets
  • Once supported we could redraw these textures every frame and scale draped features, lines, etc

@gkjohnson

This comment was marked as outdated.

@gkjohnson gkjohnson merged commit 9121fc7 into master May 17, 2026
1 check passed
@gkjohnson gkjohnson deleted the mvt-support branch May 17, 2026 04:15
@gkjohnson gkjohnson added this to the v0.4.25 milestone May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants