mapbox-gl-js

mapbox-gl-js is a skill for Claude Code, Codex from znlgis/opengis-skills. It costs 100 tokens per session (5,603 once invoked), scanned A, original, MIT.

A JavaScript library for displaying interactive vector maps in web browsers. It renders map data with WebGL, a browser technology that uses the graphics processor, and supports styled layers, events, and 3D terrain.

In plain words
What is it for?
Use it to build web maps with vector tiles, data-based colours and sizes, clickable or hoverable features, 3D ground, and extruded building shapes.
Why use it?
It avoids building map rendering, styling, zooming, and map interaction from scratch. It also makes it possible to show changing data values through map styles.

Skill for Claude CodeCodex

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

Good fit Use it to build web maps with vector tiles, data-based colours and sizes, clickable or hoverable features, 3D ground, and extruded building shapes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/znlgis/opengis-skills/mapbox-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 mapbox-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 mapbox-gl-js

README.md
[![agentmods](https://agentmods.dev/badge/skills/znlgis/opengis-skills/mapbox-gl-js/github.svg)](https://agentmods.dev/skills/znlgis/opengis-skills/mapbox-gl-js)
Your own site
<a href="https://agentmods.dev/skills/znlgis/opengis-skills/mapbox-gl-js"><img src="https://agentmods.dev/badge/skills/znlgis/opengis-skills/mapbox-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 mapbox-gl-js

Your own site · 80×15
<a href="https://agentmods.dev/skills/znlgis/opengis-skills/mapbox-gl-js"><img src="https://agentmods.dev/badge/skills/znlgis/opengis-skills/mapbox-gl-js.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 100 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,603 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.00100 $0.05603
Opus 5.5 $0.00040 $0.02241
Sonnet 5.5 $0.00020 $0.01121
Haiku 4.5 $0.00010 $0.00560

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

Security

Grade A, and why

mapbox-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 9d 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.

- **先探测版本**:`npm ls mapbox-gl`(未装则 `npm view mapbox-gl version`);本技能按 3.33.0 编写,CDN 的 JS 与 CSS 必须同为 `v3.33.0`,联网时 `curl.exe -I https://api.mapbox.com/mapbox-gl-js/v3.33.0/mapbox-gl.js` 应为 200。
gis/mapbox-gl-js/SKILL.md · 436 lines

How it starts

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

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

官方文档: https://docs.mapbox.com/mapbox-gl-js/

API 参考: https://docs.mapbox.com/mapbox-gl-js/api/

最新版本: 3.33.0(截至 2026-10,npm mapbox-gl 与 GitHub Release 一致)

许可证: v2+ 为 Mapbox 专有许可(v1.x 为 BSD-3-Clause;需 Mapbox 账号 access token)

概述

Mapbox GL JS 是基于 WebGL 的 JavaScript 地图库,用矢量瓦片在浏览器端实时渲染样式。2020 年 v2.0 起许可证由 BSD-3-Clause 变更为 Mapbox 专有许可(TOS),运行时需要 Mapbox 账号 access token 并受配额计费约束;API 兼容的开源分支 MapLibre GL JS(https://github.com/maplibre/maplibre-gl-js)可免 token 使用。主要特性:

  • 矢量瓦片渲染:GPU 加速,任意缩放级别平滑显示,样式由客户端 Style Spec 驱动
  • Style Spec 样式规范:图层、数据源、字体、精灵图均以 JSON 描述,可在 Mapbox Studio 可视化编辑
  • 数据驱动样式(Expressions):按要素属性、缩放级别、feature-state 动态计算颜色、半径、透明度
  • 3D 能力:raster-dem 地形源配合 setTerrain 实现 3D 地形,fill-extrusion 渲染 3D 建筑
  • 图层级交互:事件绑定到具体图层 id,支持点击、悬停查询要素并配合 Popup 展示

环境准备

获取 access token

  1. 注册并登录 https://account.mapbox.com,在 Tokens 页面创建 access token
  2. 浏览器端必须使用以 pk. 开头的 public token;sk. 开头的 secret token 禁止出现在前端代码
  3. 生产环境建议在 token 上配置 URL restrictions(限定可用域名),避免被他人盗用配额
  4. 不要将 token 硬编码提交到仓库,使用构建时注入的环境变量

方式一:npm

npm install mapbox-gl
import mapboxgl from 'mapbox-gl';
import 'mapbox-gl/dist/mapbox-gl.css';

mapboxgl.accessToken = 'YOUR_MAPBOX_ACCESS_TOKEN'; // 或用环境变量注入

v3 提供更小的 ESM 入口:import * as mapboxgl from 'mapbox-gl/esm'。

方式二:CDN

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <link href="https://api.mapbox.com/mapbox-gl-js/v3.33.0/mapbox-gl.css" rel="stylesheet" />
  <script src="https://api.mapbox.com/mapbox-gl-js/v3.33.0/mapbox-gl.js"></script>
  <style>
    /* 容器必须显式设置高度,否则地图不可见 */
    #map { height: 400px; }
  </style>
</head>
<body>
  <div id="map"></div>
  <script>
    mapboxgl.accessToken = 'YOUR_MAPBOX_ACCESS_TOKEN';
    const map = new mapboxgl.Map({
      container: 'map',
      style: 'mapbox://styles/mapbox/streets-v12',
      center: [116.3975, 39.9087], // [经度, 纬度]
      zoom: 12
    });
  </script>
</body>
</html>

Read the full file on GitHub · 436 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. 9d ago Changed · -1 lines 4eb813fef30b
  2. 16d ago Changed · +2 lines · +32 tokens per session a0e6b1ef0610
  3. 21d ago First seen · 435 lines · 68 tokens per session scan A 6c10bf3f7c39

Subscribe to this mod's changes

mapbox-gl-js is a skill published in the GitHub repository znlgis/opengis-skills (76 stars, last pushed 10d ago), licensed MIT. It adds 100 tokens to every session and 5,603 once invoked, about $0.0004 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-10-16.

Related

mapbox-gl-js compared with skills from other repositories

mapbox-gl-js next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
mapbox-gl-jsznlgis/opengis-skillsSkill7610d agoMITA100Claude Code, Codex
angular-developerangular/angularSkill101kyesterdayMITA93Claude Code, Codex
angular-new-appangular/angularSkill101kyesterdayMITA43Claude Code, Codex
game-object-componentsphaserjs/phaserSkill41k2mo agoMITA65Claude Code, Codex
geometry-and-mathphaserjs/phaserSkill41k2mo agoMITA64Claude Code, Codex
physics-arcadephaserjs/phaserSkill41k2mo agoMITA65Claude Code, Codex
physics-matterphaserjs/phaserSkill41k2mo agoMITA57Claude Code, Codex