Common style patterns, layer configurations, and recipes for typical mapping scenarios including restaurant finders, real estate, data visualization, navigation, delivery/logistics, and more. Use when implementing specific map use cases or looking for proven style patterns.
本技能为常见地图场景提供经过实战检验的样式模式与图层配置。
使用场景: 展示餐厅、咖啡馆、酒吧或其他兴趣点的消费类应用
视觉要求:
推荐图层:
json
{
layers: [
{
id: background,
type: background,
paint: {
background-color: #f5f5f5
}
},
{
id: water,
type: fill,
source: mapbox-streets,
source-layer: water,
paint: {
fill-color: #d4e4f7,
fill-opacity: 0.6
}
},
{
id: landuse-parks,
type: fill,
source: mapbox-streets,
source-layer: landuse,
filter: [==, class, park],
paint: {
fill-color: #e8f5e8,
fill-opacity: 0.5
}
},
{
id: roads-minor,
type: line,
source: mapbox-streets,
source-layer: road,
filter: [in, class, street, street_limited],
paint: {
line-color: #e0e0e0,
line-width: {
base: 1.5,
stops: [
[12, 0.5],
[15, 2],
[18, 6]
]
}
}
},
{
id: roads-major,
type: line,
source: mapbox-streets,
source-layer: road,
filter: [in, class, primary, secondary, tertiary],
paint: {
line-color: #ffffff,
line-width: {
base: 1.5,
stops: [
[10, 1],
[15, 4],
[18, 12]
]
}
}
},
{
id: restaurant-markers,
type: symbol,
source: restaurants,
layout: {
icon-image: restaurant-15,
icon-size: 1.5,
icon-allow-overlap: false,
text-field: [get, name],
text-offset: [0, 1.5],
text-size: 12,
text-allow-overlap: false
},
paint: {
icon-color: #FF6B35,
text-color: #333333,
text-halo-color: #ffffff,
text-halo-width: 2
}
}
]
}
关键特性:
问题1:主要内容是什么?
问题2:查看环境是什么?
问题3:用户的主要操作是什么?
问题4:平台是什么?
json
{
id: roads,
type: line,
source: mapbox-streets,
source-layer: road,
filter: [
step,
[zoom],
[in, class, motorway, trunk],
8,
[in, class, motorway, trunk, primary],
12,
[in, class, motorway, trunk, primary, secondary],
14,
true
],
paint: {
line-width: {
base: 1.5,
stops: [
[4, 0.5],
[10, 1],
[15, 4],
[18, 12]
]
}
}
}
其他模式和配置可在 references/ 目录中找到。当需要特定模式时,加载相应文件。
| 文件 | 内容 |
|---|---|
| references/real-estate.md | 模式2:房地产地图 -- 房产边界、价格颜色编码、便利设施标记 |
| references/data-viz-base.md |
加载说明: 读取与用户用例匹配的参考文件。例如,如果实现配送追踪地图,加载 references/delivery-logistics.md。
在以下情况下调用本技能:
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 mapbox-style-patterns-1775919075 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 mapbox-style-patterns-1775919075 技能
skillhub install mapbox-style-patterns-1775919075
文件大小: 15.1 KB | 发布时间: 2026-4-12 10:31