Martin 端点
Martin 数据可通过 HTTP GET 端点获得:
| URL | 描述 |
|---|---|
/ | Web UI |
/catalog | 所有源列表 |
/{sourceID} | 源 TileJSON |
/{sourceID}/{z}/{x}/{y} | 地图瓦片 |
/{source1},…,{sourceN} | 组合源 TileJSON |
/{source1},…,{sourceN}/{z}/{x}/{y} | 组合源瓦片 |
/sprite/{spriteID}[@2x].{json,png} | 精灵图源 |
/sdf_sprite/{spriteID}[@2x].{json,png} | SDF 精灵图源 |
/font/{font}/{start}-{end} | 字体源 |
/font/{font1},…,{fontN}/{start}-{end} | 组合字体源 |
/style/{style} | 样式源 |
/health | Martin 服务器健康检查:返回 200 OK |
/_/metrics | Martin 服务器 Prometheus 指标 |
重复源 ID
如果有多个同名源,例如 PG 函数在两个模式/连接中可用,或表有多个几何列,源将被分配唯一 ID,如 /points、/points.1 等。
保留源 ID
某些源 ID 保留供内部使用。如果您尝试使用它们,它们将自动重命名为唯一 ID,与处理重复源 ID 的方式相同,例如 catalog 源将变为 catalog.1。
一些保留的 ID:_、catalog、config、font、health、help、index、manifest、metrics、refresh、reload、sprite、status。
目录
所有可用源的列表可通过目录端点获得:
curl localhost:3000/catalog | jq
{
"tiles" {
"function_zxy_query": {
"name": "public.function_zxy_query",
"content_type": "application/x-protobuf"
},
"points1": {
"name": "public.points1.geom",
"content_type": "image/webp"
},
...
},
"sprites": {
"cool_icons": {
"images": [
"bicycle",
"bear",
]
},
...
},
"fonts": {
"Noto Mono Regular": {
"family": "Noto Mono",
"style": "Regular",
"glyphs": 875,
"start": 0,
"end": 65533
},
...
},
"styles": {
"maplibre_demo": {
"path": "path/to/maplibre_demo.json",
},
},
}
源 TileJSON
所有瓦片源在 /{SourceID} 处都有一个 TileJSON 端点。
例如,points 函数或表将在 /points 可用。组合 points 和 lines 源的组合源将在 /points,lines 端点可用。
curl localhost:3000/points | jq
curl localhost:3000/points,lines | jq