Loading...
Loading...
Compare original and translation side by side
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);
});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);
});1. 场景初始化 (Scene) → 2. 数据准备 → 3. 创建图层 (Layer) → 4. 添加交互 → 5. 优化性能1. 场景初始化 (Scene) → 2. 数据准备 → 3. 创建图层 (Layer) → 4. 添加交互 → 5. 优化性能| 用户请求示例 | 加载的文档 |
|---|---|
| "创建一个地图" | core/scene.md |
| "显示点位数据" | layers/point.md, data/geojson.md |
| "绘制路径" | layers/line.md |
| "热力图" | layers/heatmap.md |
| "添加点击事件" | interaction/events.md |
| "显示弹窗" | interaction/components.md |
| 用户请求示例 | 加载的文档 |
|---|---|
| "创建一个地图" | core/scene.md |
| "显示点位数据" | layers/point.md, data/geojson.md |
| "绘制路径" | layers/line.md |
| "热力图" | layers/heatmap.md |
| "添加点击事件" | interaction/events.md |
| "显示弹窗" | interaction/components.md |
城市可视化 = scene + polygon + point + events + popup
轨迹动画 = scene + line + animation
热力分析 = scene + heatmap + data/json城市可视化 = scene + polygon + point + events + popup
轨迹动画 = scene + line + animation
热力分析 = scene + heatmap + data/jsonmetadata/skill-dependency.json{
"point-layer": {
"requires": ["scene-initialization"],
"optional": ["source-geojson", "color-mapping"],
"nextSteps": ["event-handling", "popup"]
}
}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';// 核心
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''light''dark''normal''satellite''blank'[经度, 纬度]; // [120.19, 30.26]
// 经度: -180 ~ 180
// 纬度: -90 ~ 90[经度, 纬度]; // [120.19, 30.26]
// 经度: -180 ~ 180
// 纬度: -90 ~ 90