Token导航 LogoToken导航

Agent Skill · 前端设计

maplibre-pmtiles-patterns(Maplibre pmtiles 模式)

maplibre-pmtiles-patterns 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

maplibre-pmtiles-patterns 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证信息还不明确,第三方扫描有提醒项,按安装量在前端设计类的 10,216 个 Skill 里排第 2,016。

总安装 3,065周安装 129GitHub Stars 105下载 1,073核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:maplibre-pmtiles-patterns(Maplibre pmtiles 模式)
来源仓库:https://github.com/maplibre/maplibre-agent-skills
仓库路径:skills/maplibre-pmtiles-patterns
安装命令:
npx skills add https://github.com/maplibre/maplibre-agent-skills --skill maplibre-pmtiles-patterns
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/maplibre/maplibre-agent-skills --skill maplibre-pmtiles-patterns

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。适合围绕仓库状态、代码变更或协作事项进行整理。通过 npx skills add 命令从 GitHub 仓库安装使用。建议确认权限范围和维护状态,避免触发联网或文件读写操作。

maplibre-pmtiles-patterns 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/maplibre-pmtiles-patterns

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/maplibre/maplibre-agent-skills --skill maplibr…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

maplibre-pmtiles-patterns 怎么安装?

在终端执行 npx skills add https://github.com/maplibre/maplibre-agent-skills --skill maplibre-pmtiles-…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

maplibre-pmtiles-patterns 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

maplibre-pmtiles-patterns 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

maplibre-pmtiles-patterns 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

maplibre-pmtiles-patterns 用的人多吗?

公开数据是累计安装 3,065 次,近一周安装 129 次,下载 1,073 次,GitHub 105 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

maplibre-pmtiles-patterns 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
maplibre-pmtiles-patterns

Maplibre pmtiles 模式 · 本页

3,065105操作浏览器未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

MapLibre PMTiles Patterns

PMTiles is a single-file format for vector or raster map tiles. You host one (or a few) files on any static host; MapLibre requests byte ranges over HTTP. No tile server, no dynamic backend. This skill covers when to use PMTiles, how to generate and host them, and how to connect them to MapLibre GL JS.

When to Use This Skill

  • Hosting map tiles without running a tile server (S3, Cloudflare R2, GitHub Pages, etc.)
  • Building a fully static or serverless map stack
  • Serving large tile sets from a CDN with range requests
  • Generating PMTiles from OSM or other sources (Planetiler, tippecanoe)
  • Using Overture Maps or other single-file tile datasets with MapLibre

What PMTiles Is and Why It Matters

  • Vector and raster — PMTiles supports both. A file can contain vector layers (e.g. water, roads, POIs), raster imagery (PNG/JPEG), or raster-dem (elevation, e.g. Terrarium format for terrain). In the style you use type: 'vector', type: 'raster', or type: 'raster-dem' accordingly.
  • Single file per map — One .pmtiles file typically contains the full tile pyramid (all zoom levels) and all layers (vector or raster) in one archive. The format stores tiles in a compact layout (e.g. Hilbert curve) so the client can request only the byte ranges it needs. For very large coverage you may split by region into multiple files.
  • HTTP range requests — The client requests only the byte ranges it needs (e.g. one tile), so the server does not need to understand x/y/z. Any host that supports Range headers works.
  • Serving — You can serve directly from static storage (S3, R2, GitHub Pages, Netlify): the client uses range requests, so no tile server is required. Alternatively, tileserver-gl or Martin can serve PMTiles (from local paths, HTTP URLs, or S3), useful if you want one server that also provides styles, glyphs, or other sources.
  • Creating — You can get PMTiles by converting from MBTiles (PMTiles CLI) or by generating from source data (Planetiler, tippecanoe, GDAL, etc.). Alternatively, Protomaps is a provider where you can download pre-built PMTiles (e.g. global or regional basemaps) and serve them yourself, or create custom extracts via the PMTiles CLI—no need to generate from OSM yourself. Protomaps basemaps are built from OpenStreetMap data; OSM attribution is required in any map that uses them. See *The PMTiles CLI* and *Generating PMTiles* below.
  • Good for CDNs — Range requests cache well; put the file behind a CDN for fast global access.

When to prefer PMTiles over a traditional tile server:

  • You want zero server logic (static hosting only).
  • You have a bounded dataset (country, region, theme) that fits in one or a few files.
  • You want simple deployment and low ops (upload file, set cache headers, done).

When to prefer a tile server (e.g. tileserver-gl, Martin):

  • You need dynamic tiles from a database (PostGIS) or frequently updated data.
  • You have a very large global dataset and want to generate tiles on demand or by region only.

MapLibre Integration: The PMTiles Protocol

MapLibre does not speak PMTiles natively. You use the PMTiles library to add a protocol handler so that a pmtiles:// (or https:// to a.pmtiles file) source works.

Install:

npm install pmtiles

Register the protocol and use in a style:

import * as pmtiles from 'pmtiles';
import maplibregl from 'maplibre-gl';
import 'maplibre-gl/dist/maplibre-gl.css';

// Add PMTiles protocol so sources can reference .pmtiles URLs
const protocol = new pmtiles.Protocol();
maplibregl.addProtocol('pmtiles', protocol.tile);

const map = new maplibregl.Map({
  container: 'map',
  style: {
    version: 8,
    sources: {
      tiles: {
        type: 'vector',
        url: 'pmtiles://https://example.com/data.pmtiles'
      }
    },
    layers: [
      {
        id: 'background',
        type: 'background',
        paint: { 'background-color': '#f8f4f0' }
      },
      {
        id: 'water',
        type: 'fill',
        source: 'tiles',
        'source-layer': 'water',
        paint: { 'fill-color': '#a0c8f0' }
      }
      // add more layers as needed — each uses the same source, different 'source-layer'
    ]
  },
  center: [0, 0],
  zoom: 2
});

// Optional: remove protocol on map teardown
// map.on('remove', () => maplibregl.removeProtocol('pmtiles'));

Referencing layers: The style has one source (e.g. sources.tiles) pointing at the.pmtiles URL. Each layer in the layers array that draws from that file uses source: 'tiles' and "source-layer": "layerName", where layerName is the name of a vector layer inside the file (from whatever schema the tiles use). Add multiple style layers with different source-layer values to show roads, labels, etc. from the same file.

Important: The url can be pmtiles://https://... (protocol + HTTPS URL to the.pmtiles file). The library will fetch the file via range requests. Your style must still define glyphs and sprite if you use labels or icons (see maplibre-tile-sources).

Raster and raster-dem: The same protocol works for raster PMTiles. Use a type: 'raster' source for imagery. For terrain/elevation, use a type: 'raster-dem' source with "encoding": "terrarium" (or "mapbox") so MapLibre can apply hillshade or 3D terrain; then reference it in the style’s terrain property. Example source:

"elevation": {
  "type": "raster-dem",
  "url": "pmtiles://https://example.com/elevation.pmtiles",
  "encoding": "terrarium"
}

Using PMTiles with React: Register the protocol once at application startup, not inside each component, so MapLibre has the handler before any map mounts. For example, call maplibregl.addProtocol('pmtiles', protocol.tile) in a root-level effect or when your map provider initializes. On unmount of the last map (or when the app tears down), call maplibregl.removeProtocol('pmtiles') to avoid leaks. See PMTiles for MapLibre GL (Protomaps) for a React-oriented setup.

Hosting PMTiles

Any host that serves the file and supports HTTP Range requests is suitable.

  • AWS S3 — Enable public read (or signed URLs); S3 supports Range. Set Cache-Control and optionally use CloudFront.
  • Cloudflare R2 — S3-compatible; enable public access or use signed URLs. Put behind Cloudflare for caching.
  • GitHub Pages — MapLibre GL JS can load tiles from a.pmtiles file in the same repo as long as the file size is under 100 MB.
  • Netlify / Vercel — Upload the.pmtiles file; static hosting typically supports Range. Check each provider’s file size limits.
  • Any static host — Ensure the server returns Accept-Ranges: bytes and responds correctly to Range headers.

CORS: Browsers will send cross-origin requests to the PMTiles URL. The host must send Access-Control-Allow-Origin: * (or your domain) and Access-Control-Allow-Headers: Range (or allow all). Otherwise MapLibre will fail to load tiles.

Cache headers: For better performance, set long cache for the.pmtiles file (e.g. Cache-Control: public, max-age=31536000 if the file is immutable). CDNs will cache range responses.

The PMTiles CLI

The pmtiles CLI is the official command-line tool for working with PMTiles (and MBTiles for conversion). It’s a single binary with no runtime dependencies—you download it and run it.

Why install and use it:

  • Convert MBTiles to PMTiles — Many tools (tippecanoe, GDAL, martin-cp) output MBTiles. One command turns any.mbtiles file into a.pmtiles file: pmtiles convert in.mbtiles out.pmtiles. This is often the simplest way to get PMTiles when your pipeline already produces MBTiles.
  • Inspect and verify archives — pmtiles show <file> prints header and metadata (bounds, zoom range, tile count). pmtiles verify <file> checks archive integrity. Useful for debugging or confirming a file before uploading.
  • Extract subsets — pmtiles extract creates a smaller.pmtiles file from an existing one (e.g. by bounding box or zoom range), so you can ship a region or a limited zoom band without regenerating from source.

Install: Download the binary for your OS/arch from GitHub Releases (go-pmtiles), or use Docker: protomaps/go-pmtiles.

What it does not do: The CLI only works with tile archives (MBTiles and PMTiles). It does not read GeoJSON, Shapefile, OSM, or other source formats. To create PMTiles from those, use a tool that generates tiles (see *Generating PMTiles* below) and, if that tool outputs MBTiles, run pmtiles convert to get PMTiles.

Generating PMTiles

Two paths: (1) Convert — The PMTiles CLI converts MBTiles ↔ PMTiles only; it does not read GeoJSON, Shapefile, OSM, or other source formats. (2) Generate from source data — Tools like tippecanoe, Planetiler and ogr2ogr via GDAL read from many file types or databases and produce vector tiles (PMTiles or MBTiles). If they output MBTiles, use pmtiles convert to get PMTiles.

PMTiles CLI (convert only: MBTiles ↔ PMTiles)

See *The PMTiles CLI* above for why to install it and other commands (show, verify, extract). To convert MBTiles to PMTiles:

pmtiles convert input.mbtiles output.pmtiles

The following tools generate tiles from source data (GeoJSON, OSM, Shapefile, PostGIS, etc.). They output PMTiles or MBTiles; if MBTiles, run pmtiles convert to get PMTiles.

Planetiler (OSM / OpenMapTiles schema)

Planetiler reads OpenStreetMap (or other sources) and outputs PMTiles or MBTiles in the OpenMapTiles schema.

# Example: build a PMTiles file for a region (e.g. from a .osm.pbf download)
java -jar planetiler.jar --area=monaco --output=monaco.pmtiles

See Planetiler docs for area names, custom sources, and schema options. Output is a single.pmtiles file you can upload to S3/R2/static host.

tippecanoe

tippecanoe generates vector tiles from source formats: GeoJSON, FlatGeobuf, CSV. From v2.17 onward it can output PMTiles directly (-o output.pmtiles). You can also output MBTiles and convert with pmtiles convert.

# Direct PMTiles output (v2.17+)
tippecanoe -zg -o output.pmtiles input.geojson
# Or MBTiles then convert: tippecanoe -o output.mbtiles -z 14 input.geojson && pmtiles convert output.mbtiles output.pmtiles

ogr2ogr (GDAL)

GDAL’s ogr2ogr generates tiles from many geospatial formats (Shapefile, PostGIS, GeoJSON, etc.) and can write MBTiles or PMTiles (GDAL 3.8+). Best for smaller datasets; tippecanoe is more efficient for large vector tile sets.

Raster and raster-dem PMTiles

PMTiles supports raster tiles (PNG/JPEG, e.g. satellite or pre-rendered imagery) and raster-dem (elevation/terrain, e.g. Terrarium or Mapbox encoding). Use tools that produce raster or raster-dem PMTiles; the same protocol and hosting apply. In the style use type: 'raster' for imagery or type: 'raster-dem' with "encoding": "terrarium" (or "mapbox") for terrain—see *MapLibre Integration* above for an example.

Overture Maps

Overture Maps publishes global open map data. Some providers distribute Overture-derived data as PMTiles (e.g. for buildings, places, transportation). You can also build PMTiles from Overture data with Planetiler or other pipelines. Use the PMTiles URL in your MapLibre style as above.

Performance Tips

  • CDN — Serve the.pmtiles file from a CDN (CloudFront, Cloudflare) so range requests are fast globally.
  • Compression — PMTiles stores tiles compressed; the library handles decompression. Ensure the server does not double-compress (e.g. gzip) the whole file in a way that breaks range requests.
  • Multiple files — For very large coverage, split by region into several.pmtiles files and switch the source URL or use multiple sources by bounds.
  • Caching — Set strong cache headers on the file; the browser and CDN will cache range responses.

Related Skills

  • maplibre-tile-sources — Choosing tile sources (OpenFreeMap, MapTiler, PMTiles, self-hosted); glyphs and sprites.
  • maplibre-style-patterns — Layer and paint configuration for vector sources (including PMTiles-backed sources). (Not yet in repo.)

References

平台分布

Codex

38.55%
按下载量换算414

Claude

28.25%
按下载量换算303

Cursor

20.44%
按下载量换算219

Gemini CLI

9.44%
按下载量换算101

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills