maplibre-gl-js

maplibre-gl-js is a skill for Claude Code, Codex from znlgis/opengis-skills. It costs 114 tokens per session (6,577 once invoked), scanned A, original, MIT.

A browser library for displaying interactive vector maps with WebGL2. It loads map tiles and styles, then draws layers, terrain, and geographic data in a web page.

In plain words
What is it for?
Use it to add styled maps, data layers, GeoJSON, terrain, custom tile protocols, or interactive geographic views to web applications.
Why use it?
It provides a web-based map renderer without requiring the reader to build the rendering and tile-loading logic themselves. The guide also helps diagnose issues such as ESM-only imports, missing WebGL2, or blank maps.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to add styled maps, data layers, GeoJSON, terrain, custom tile protocols, or interactive geographic views to web applications.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/znlgis/opengis-skills/maplibre-gl-js
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add znlgis/opengis-skills --skill maplibre-gl-js
Clone the repo
git clone --depth 1 https://github.com/znlgis/opengis-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for maplibre-gl-js

README.md
[![agentmods](https://agentmods.dev/badge/skills/znlgis/opengis-skills/maplibre-gl-js/github.svg)](https://agentmods.dev/skills/znlgis/opengis-skills/maplibre-gl-js)
Your own site
<a href="https://agentmods.dev/skills/znlgis/opengis-skills/maplibre-gl-js"><img src="https://agentmods.dev/badge/skills/znlgis/opengis-skills/maplibre-gl-js/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for maplibre-gl-js

Your own site · 80×15
<a href="https://agentmods.dev/skills/znlgis/opengis-skills/maplibre-gl-js"><img src="https://agentmods.dev/badge/skills/znlgis/opengis-skills/maplibre-gl-js.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 114 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,577 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00114 $0.06577
Opus 5.5 $0.00046 $0.02631
Sonnet 5.5 $0.00023 $0.01315
Haiku 4.5 $0.00011 $0.00658

Measured 19d ago against content hash cda802134376, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

maplibre-gl-js scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 19d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s -o /dev/null -w '%{http_code}\n' https://cdn.jsdelivr.net/npm/[email protected]/dist/maplibre-gl.mjs
gis/maplibre-gl-js/SKILL.md · 479 lines

How it starts

The opening of the file, as written. The whole thing — 479 lines — stays where its author put it; the contents beside it link to each section on GitHub.

项目地址: https://github.com/maplibre/maplibre-gl-js

官方文档: https://maplibre.org/maplibre-gl-js/docs/

API 参考: https://maplibre.org/maplibre-gl-js/docs/API/

样式规范: https://maplibre.org/maplibre-style-spec/

最新版本: 6.17.0(截至 2026-11,npm maplibre-gl dist-tag latest;GitHub Releases 同步)

许可证: BSD-3-Clause(v6 起的发行物为 ESM-only,UMD 构建已移除)

概述

MapLibre GL JS 是基于 WebGL2 的矢量瓦片地图渲染库,源自 Mapbox GL JS v1 的 BSD 分支,现由 MapLibre 社区独立维护。样式由 Style Spec JSON 驱动,客户端按需请求矢量瓦片、字体与精灵图,再用 GPU 逐帧绘制,因此缩放平滑、样式可运行时改动,且不需要任何商业 token。

  • 矢量瓦片渲染:MVT 瓦片 + 客户端样式,任意缩放级别清晰;同时支持栅格瓦片与 GeoJSON 源
  • Style Spec 样式规范:sources / layers / expressions 全部 JSON 化,可版本化、可服务端下发
  • 数据驱动样式:表达式按要素属性、zoom、feature-state 动态计算颜色、宽度、透明度
  • 三维能力:raster-dem 地形源 + setTerrain,配 setSky 做天空与大气;globe 投影可直接切换
  • 可扩展协议:addProtocol 注册自定义加载器,PMTiles、COG 等单文件瓦片方案由此接入
  • 开源免 token:底图可用公共 demotiles、自建 tile server 或 PMTiles,不受 Mapbox 配额与 TOS 约束

与相邻技术的差异:Mapbox GL JS 是同一血统的闭源商业版本(v2 起专有许可、必须 token);OpenLayers 偏全能型二维 GIS(投影、WMS/WMTS 更强);deck.gl 负责大规模数据图层,通常叠在 MapLibre 底图之上。


环境准备

npm 安装

v6 是 ESM-only 发行方式,包内只有 dist/maplibre-gl.mjs,不再提供 maplibre-gl.js 这类 UMD 文件:

npm install maplibre-gl
npm ls maplibre-gl          # 验证:应显示 [email protected]
// v6:用命名空间导入或具名导入,没有 default export
import * as maplibregl from 'maplibre-gl';
import 'maplibre-gl/dist/maplibre-gl.css';

const map = new maplibregl.Map({
  container: 'map',
  style: 'https://demotiles.maplibre.org/style.json',
  center: [116.39, 39.91],
  zoom: 4
});
<!-- 容器必须有显式高度,否则地图不可见 -->
<style>#map { height: 500px; }</style>
<div id="map"></div>

CDN(无构建步骤)

由于 UMD 已移除,CDN 场景也必须走 ES module:

<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/maplibre-gl.css" rel="stylesheet">
<script type="module">
  import * as maplibregl from 'https://cdn.jsdelivr.net/npm/[email protected]/dist/maplibre-gl.mjs';
  const map = new maplibregl.Map({
    container: 'map',
    style: 'https://demotiles.maplibre.org/style.json',
    center: [0, 20],
    zoom: 1
  });
  window.__map = map;   // 便于控制台调试
</script>

Read the full file on GitHub · 479 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 19d ago First seen · 479 lines · 114 tokens per session scan A cda802134376

Subscribe to this mod's changes

maplibre-gl-js is a skill published in the GitHub repository znlgis/opengis-skills (87 stars, last pushed 20d ago), licensed MIT. It adds 114 tokens to every session and 6,577 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-12.

Related

maplibre-gl-js compared with skills from other repositories

maplibre-gl-js next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
maplibre-gl-jsznlgis/opengis-skillsSkill8720d agoMITA114Claude Code, Codex
imagegenopenai/codexSkill137ktodayApache-2.0A113Codex
playwright-climicrosoft/playwrightSkill101ktodayApache-2.0A19Claude Code
browser-automationopenclaw/openclawSkill395ktodayMITA36Claude Code
systematic-debuggingobra/superpowersSkill331k3d agoMITA21Claude Code
free-llm-apismnfst/awesome-free-llm-apisSkill15ktodayCC0-1.0A113Claude Code, Codex
next-cache-components-adoptionvercel/next.jsSkill144ktodayMITA95Claude Code