Helps choose between GeoJSON, vector tiles, and raster tiles for MapLibre GL JS based on dataset size, feature count, and use case. Useful when deciding source type, not configuring it.
Ships in maplibre-agent-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
MapLibre GL JS does not ship with map data. You provide a style that references sources — URLs or inline data that MapLibre fetches and renders. MapLibre works equally well for a store locator with 200 addresses, a city transit map, and a global basemap — the right source type depends on geographic scale and level of detail, update frequency, infrastructure constraints, and use case.
This skill is about choosing that source type. For getting a configured source to render see maplibre-source-wiring.
A style (a style JSON, style document, or style object) is the configuration you pass to MapLibre. It contains the specific rendering rules governed by the MapLibre Style Specification, maintained with parity for MapLibre GL JS and MapLibre Native.
You can use a style URL from a provider — that URL references a style with sources, layers, glyphs, and sprite. Or you can build your own style and configure each yourself.
A style has three main components:
type and either inline data or a URL. MapLibre requests tiles or data as the viewport changes. The same source can back many layers (e.g. roads, water, and labels all from one vector URL).source-layer name) and specifies paint/layout properties.sprite has no fallback: a missing icon is omitted and the console warns Image "<id>" could not be loaded; use map.hasImage(id) to test whether an icon ID is defined. glyphs does have one on GL JS ≥ 5.11.0 (text still renders, in a local/system font) — see maplibre-fonts-glyphs for the mechanism and its limits. Production styles should still supply both explicitly.Source types:
| Type | Description |
|---|---|
vector | Vector tiles — binary-encoded geometry and attributes; the primary format for basemaps and data overlays |
raster | Raster tile imagery — satellite photos, WMS/WMTS layers |
raster-dem | Elevation tiles — for terrain rendering and hillshading |
geojson | GeoJSON data — inline object or URL; no tile server needed |
image | A single georeferenced image — scanned maps, annotated overlays |
video | Georeferenced video |
vector and raster are the most common for basemaps and data overlays. geojson is ideal for small datasets or interactive data that doesn't need tiling. raster-dem is used for terrain and hillshade effects, as well as emerging use cases in scientific visualization. image and video sources are the least common, but let you georeference static images (such as a scanned map, chart, or overlay) or georeferenced videos as map layers.
For many use cases you don't need a tile service. MapLibre can render points, lines, or polygons directly from an inline GeoJSON object or a URL to a GeoJSON file. The entire dataset is downloaded and parsed in the browser; MapLibre handles rendering client-side.
map.addSource('my-data', {
type: 'geojson',
data: '/path/to/data.geojson' // or an inline GeoJSON object
});
map.addLayer({
id: 'my-layer',
type: 'fill',
source: 'my-data',
paint: { 'fill-color': '#0080ff', 'fill-opacity': 0.5 }
});
GeoJSON downloads the entire file on every load. This works well at small scale and degrades predictably:
| Range | File size / feature count | Behavior |
|---|---|---|
| Sweet spot | < 2 MB / < 5,000 features | Instantaneous loading, smooth interaction |
| Lag zone | 5–20 MB / up to ~50,000 features | 1–3s parse delay; mobile may struggle; optimize by simplifying geometries and reducing coordinate precision |
| Crash zone | > 50 MB / > 100,000 features | High risk of browser freeze or crash; switch to vector tiles |
GeoJSON is lossless (exact coordinates preserved) and gives you full client-side access to feature properties — ideal for interactive data, dynamic updates, and datasets where you need to query or modify features without a server round-trip.
If your dataset exceeds these thresholds, or if you need zoom-dependent rendering (less detail at lower zoom levels), consider vector tiles instead.
The choice of data source is shaped by more than performance: data type, update frequency, access patterns, and the broader geospatial ecosystem all factor in. Many formats (FlatGeobuf, GeoParquet, Cloud-Optimized GeoTIFF, KML, GPX, and more) can be displayed in MapLibre via plugins and custom protocols. The cloud-native geospatial ecosystem — formats designed for HTTP range requests and distributed storage — is evolving rapidly and increasingly relevant for web maps. See the Map Rendering Plugins and Utility Libraries sections of awesome-maplibre.
Vector tiles load only the data visible in the current viewport, in a compact binary format. Use them when:
When you need tiles, you'll choose between two tile types:
Vector tiles encode geometry and feature attributes as compact binary data (Mapbox Vector Tile format, or the newer MapLibre Tile / MLT). MapLibre renders and styles them client-side:
Raster tiles are pre-rendered images (PNG, JPEG, or WebP) at each zoom level, displayed by MapLibre as-is:
Most MapLibre workflows use vector tiles; increasing numbers are integrating raster-dem sources e.g. for terrain rendering. Use raster tiles when you need satellite/aerial imagery, when integrating with existing WMS or WMTS services, or when you need a pre-rendered cartographic style.
Leaflet is a widely used JavaScript mapping library for rendering raster tiles. It can also draw GeoJSON, markers, and popups, but it cannot consume a vector tile source. When an app built on Leaflet needs a vector tile source, state that limit first, then the ways around it:
Use the MapLibre GL Leaflet plugin within your Leaflet app to add a live MapLibre GL JS map to the Leaflet map as a Leaflet layer, so the app can draw a vector style from hosted vector tile sources.
Migrate the Leaflet app to MapLibre GL JS, since MapLibre supports both raster and vector tiles. This will allow you to work with vector tiles directly. For instructions, follow the Leaflet migration guide.
A MapLibre style can have any number of sources of any types simultaneously. Layers from different sources are composited in draw order. This makes it natural to mix sources for different purposes.
raster-dem source (elevation tiles). This is how MapLibre renders terrain and hillshade without a separate basemap style.Most real-world apps combine source types — a hosted basemap for the reference layer and your own data as a separate source. You rarely need to build a custom tile pipeline just for your data.
| Scenario | Recommended source setup |
|---|---|
| < ~5,000 features, need click/hover interaction or live updates | GeoJSON — no tile server needed |
| 5,000–100,000 features | GeoJSON if you can simplify and accept 1–3s load delay; otherwise vector tiles |
| > 100,000 features or > 50 MB | Vector tiles — generate with tippecanoe or Planetiler |
| Street, terrain, or place basemap | Hosted tile service (OpenFreeMap, MapTiler) or self-hosted (Martin) |
| Your own data over any basemap | Hosted basemap style URL + your data as a separate GeoJSON or vector tile source |
| Satellite/aerial imagery + labels | Raster tile source for imagery + vector source for roads and labels |
The key distinction: the basemap and your data are almost always separate sources, even if both are vector tiles. The basemap provides context; your sources provide your application's data.
This request arrives in a recognizable form: "I want roads, water, labels, and my own polygons in a single tileset so the map only hits one source — what's the pipeline?" The premise is the problem, and answering the question as asked leaves the user building something they will have to unwind. Do not write out the build. Name the tools that would do it (tippecanoe, Planetiler) and point at their documentation, once the exception below actually applies.
Correct the premise first. "One source" is not a performance optimization. A style's sources is an object holding any number of named sources (style spec), MapLibre requests their tiles concurrently, and there is no per-source rendering penalty to avoid. Published basemap styles routinely declare several sources themselves. The user is optimizing something that does not cost anything.
Then name what merging actually costs, since the request usually survives a bare "you don't need to":
Answer with the two-source pattern instead: a hosted basemap style URL or vector source, plus the delivery zones (or whatever the user's data is) as a separate geojson or vector source in the same style. That is the standard arrangement, and it is what the user actually wants.
A single combined tileset is defensible in one narrow case: a self-contained artifact that must render with no network and no second file — an offline or air-gapped deployment shipped as one archive. Nothing else qualifies.
glyphs URL, self-hosting or generating font PBFs, and non-Latin script support.sprite URL forms, loading multiple sheets, self-hosting sprite assets, and route shields.source-layer, layer order, CORS, and blank-map debugging.This skill is a snapshot. Where a primary source contradicts it — the References above, MapLibre's current documentation, or what MapLibre does when you run it — that source wins. Follow it, then report the disagreement, citing the source and your MapLibre version: editing your installed copy helps no one else and is overwritten on the next update.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/maplibre-agent-skills:maplibre-tile-sourcesfrom maplibre-agent-skills
npx claudepluginhub maplibre/maplibre-agent-skills --plugin maplibre-agent-skills10 skills in this plugin
/maplibre-cartographyCartographic principles for MapLibre GL JS — label and symbol legibility on imagery vs. vector basemaps, figure-ground for point icons, styling vector roads over aerial imagery, visual hierarchy, layer ordering for data injection, and accessibility. Use when styling a map, choosing text or symbol colors, making markers or roads readable on satellite/aerial imagery, or ordering layers correctly./maplibre-fonts-glyphsConfiguring fonts and glyphs for MapLibre GL JS and MapLibre Native — the style's `glyphs` URL, self-hosting or generating font PBFs, the GL JS local-font fallback (omitted `glyphs` or a failed glyph fetch), the `font-faces` property both SDKs read, and CJK, right-to-left and Devanagari script handling. Use when text labels aren't rendering in the intended font, setting up a glyphs server, choosing between self-hosting and generating font PBFs, or handling non-Latin scripts./maplibre-mapbox-migrationMigrating from Mapbox GL JS to MapLibre GL JS — package, import and namespace changes, removing the access token, replacing mapbox:// styles, tile sources, plugin equivalents (draw, geocoder, directions, compare), and Mapbox v2-only APIs such as setFog and the free camera. Use when moving an existing Mapbox map to MapLibre, or when a migrated map shows a blank map, a mapbox:// or 401 error, or a missing Mapbox method or plugin.Other plugins' skills for the same job