Comprehensive guide for AntV L7 geospatial visualization library. Use when users need to: (1) Create interactive maps with WebGL rendering (2) Visualize geographic data (points, lines, polygons, heatmaps) (3) Build location-based data dashboards (4) Add map layers, interactions, or animations (5) Process and display GeoJSON, CSV, or other spatial data (6) Integrate maps with AMap (GaodeMap), Mapbox, Maplibre, or standalone L7 Map (7) Optimize performance for large-scale geographic datasets
66
80%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
AntV L7 是基于 WebGL 的大规模地理空间数据可视化引擎,支持多种地图底图和丰富的可视化图层类型。
创建最简单的 L7 地图应用:
import { Scene, PointLayer } from '@antv/l7';
import { GaodeMap } from '@antv/l7-maps';
// 1. 初始化场景
const scene = new Scene({
id: 'map',
map: new GaodeMap({
center: [120.19, 30.26],
zoom: 10,
style: 'light',
}),
});
// 2. 添加图层
scene.on('loaded', () => {
const pointLayer = new PointLayer()
.source(data, {
parser: { type: 'json', x: 'lng', y: 'lat' },
})
.shape('circle')
.size(10)
.color('#5B8FF9');
scene.addLayer(pointLayer);
});L7 的典型开发流程:
1. 场景初始化 (Scene) → 2. 数据准备 → 3. 创建图层 (Layer) → 4. 添加交互 → 5. 优化性能详细文档按领域组织,根据需要加载:
| 用户请求示例 | 加载的文档 |
|---|---|
| "创建一个地图" | core/scene.md, core/map-types.md |
| "显示点位数据" | layers/point.md, data/geojson.md |
| "绘制路径" | layers/line.md |
| "热力图" | layers/heatmap.md |
| "加载卫星影像" | layers/tile-raster.md, data/source-raster.md |
| "添加点击事件" | interaction/events.md |
| "显示弹窗" | interaction/popup.md, interaction/layer-popup.md |
| "添加标注" | interaction/components.md, interaction/marker-layer.md |
| "添加控件" | interaction/controls.md |
复杂需求需要组合多个技能:
城市可视化 = scene + polygon + point + events + popup
轨迹动画 = scene + line + animation
热力分析 = scene + heatmap + data/json使用 metadata/skill-dependency.json 检查技能依赖关系:
{
"point-layer": {
"requires": ["scene-initialization"],
"optional": ["source-geojson", "color-mapping"],
"nextSteps": ["event-handling", "popup"]
}
}// 核心
import { Scene } from '@antv/l7';
import { GaodeMap } from '@antv/l7-maps';
// 图层
import { PointLayer, LineLayer, PolygonLayer, HeatmapLayer } from '@antv/l7';
// 组件
import { Popup, Marker } from '@antv/l7';'light' - 浅色风格'dark' - 深色风格'normal' - 标准风格'satellite' - 卫星影像'blank' - 空白底图(独立 Map)[经度, 纬度]; // [120.19, 30.26]
// 经度: -180 ~ 180
// 纬度: -90 ~ 90查看 index.md 获取完整技能列表和导航。
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.