kendrick-oppong/geoskills/maplibre-vector-tile-styling

Claude Code and agent skill by kendrick-oppong/geoskills

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when writing or debugging a MapLibre/Mapbox style spec — layer ordering, data-driven expressions, zoom-dependent styling, sprite/glyph setup, and integrating MapLibre into a React or Angular component.

Install

npx vskill@latest install kendrick-oppong/geoskills/maplibre-vector-tile-styling

SKILL.md

The same SKILL.md was published earlier as kendrick-oppong/geoskills/maplibre-vector-tile-styling.

MapLibre GL Vector Tile Styling

When to use this skill

  • Writing or debugging a MapLibre/Mapbox-compatible style JSON
  • "My layer isn't showing" / "styling doesn't change with zoom" / layer ordering issues
  • Wiring MapLibre into a React component (react-map-gl) or an Angular component

Core concepts

  • Style spec structure: sources (where data comes from — vector tiles, GeoJSON, raster) → layers (how each source is drawn, referencing a source and optionally source-layer for vector tiles) → paint/layout properties per layer.
  • Layer order = paint order: layers later in the array draw on top — a common bug source is a fill layer accidentally covering a line/label layer below it in z-order despite looking "correct" in the source JSON.
  • Expressions (["interpolate", ["linear"], ["zoom"], ...], ["match", ["get", "category"], ...]) drive data-driven and zoom-dependent styling — this is the idiomatic way to do choropleth coloring, zoom-based line width, etc., entirely on the GPU without re-rendering tiles.
  • `source-layer` must match the actual layer name inside the vector tile (set at tile-generation time, e.g. by tippecanoe) — a mismatch here is the most common "nothing renders" bug and produces no error.

Checklist

  • [ ] Does every vector-tile layer reference the correct source-layer name exactly as baked into the tiles?
  • [ ] Is layer order intentional — polygons below lines below points below labels, generally?
  • [ ] Are data-driven styles using expression syntax rather than manually re-styling on every zoomend/data event (expressions run on the GPU and are far cheaper)?
  • [ ] For choropleths, is the color scale using interpolate/step bound to a real data property, with a legend that matches the same breakpoints?
  • [ ] Are custom fonts/icons registered via loadImage/sprite sheet before layers referencing them are added — referencing a missing image/glyph fails silently (icon doesn't render, no console error in older versions)?
  • [ ] In React: is the map instance created once (e.g., in a useEffect with an empty dependency array) and cleaned up on unmount, rather than re-created on every render?
  • [ ] In Angular: is the MapLibre instance held in a component field (not recreated in change detection cycles), with ngOnDestroy calling map.remove()?

Common pitfalls

  • `source-layer` mismatch: single most common "why isn't anything showing" bug with vector tiles — always verify against the actual tile's layer names (tippecanoe/tile inspector output), not assumed names.
  • Re-styling via imperative `setPaintProperty` calls on every state change instead of data-driven expressions bound once — creates React/Angular re-render thrash and defeats GPU-side styling.
  • Adding a layer before its source has finished loading (map.on('load', ...) not awaited) — causes intermittent "layer not found" errors that are hard to reproduce.
  • Z-fighting/label collisions from too many symbol layers competing for space — use layout: { 'symbol-avoid-edges': true } and collision-aware layer ordering rather than manually offsetting labels.
  • Mixing MapLibre and Mapbox style-spec versions: a style authored against Mapbox v3 spec may use properties MapLibre doesn't (yet) support, or vice versa — pin to one spec version and validate against it.

Reference snippets

javascript
map.addSource('buildings', {
type: 'vector',
tiles: ['https://cdn.example.com/tiles/{z}/{x}/{y}.pbf'],
minzoom: 0, maxzoom: 14,
});
map.addLayer({
id: 'buildings-fill',
type: 'fill',
source: 'buildings',
'source-layer': 'buildings', // must match the tile's internal layer name exactly
paint: {
'fill-color': [
'interpolate', ['linear'], ['get', 'height'],
0, '#f2f0f7', 50, '#6a51a3',
],
'fill-opacity': ['interpolate', ['linear'], ['zoom'], 10, 0, 12, 0.8],
},
});
typescript
// React (react-map-gl / MapLibre)
useEffect(() => {
const map = new maplibregl.Map({ container: ref.current!, style, center, zoom });
return () => map.remove();
}, []); // instantiate once

Related skills

  • vector-tile-pipeline — generating the tiles being styled
  • webgis-engine-selection — whether MapLibre is the right engine choice
  • cartographic-design-for-web-maps — the design theory behind color/symbology choices

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/kendrick-oppong/geoskills/maplibre-vector-tile-styling/badge)](https://verified-skill.com/skills/kendrick-oppong/geoskills/maplibre-vector-tile-styling)

Something wrong with this skill or its page? Tell us.