antv-l7/examples/point/dot/demo/normal.js

33 lines
653 B
JavaScript
Raw Normal View History

2019-11-21 17:52:18 +08:00
import { Scene, PointLayer } from '@antv/l7';
import { GaodeMap } from '@antv/l7-maps';
2019-11-14 11:50:12 +08:00
const scene = new Scene({
id: 'map',
map: new GaodeMap({
style: 'dark',
center: [ 121.417463, 31.215175 ],
pitch: 0,
2019-11-26 19:17:39 +08:00
zoom: 11
})
2019-11-14 11:50:12 +08:00
});
2019-11-14 11:50:12 +08:00
fetch('https://gw.alipayobjects.com/os/rmsportal/BElVQFEFvpAKzddxFZxJ.txt')
2019-11-20 17:26:24 +08:00
.then(res => res.text())
.then(data => {
const pointLayer = new PointLayer({})
2019-11-14 11:50:12 +08:00
.source(data, {
parser: {
type: 'csv',
y: 'lat',
x: 'lng'
}
2019-11-20 17:26:24 +08:00
})
.size(0.5)
2019-11-14 11:50:12 +08:00
.color('#080298')
.style({
2019-11-20 17:26:24 +08:00
opacity: 1
});
2019-11-14 11:50:12 +08:00
2019-11-20 17:26:24 +08:00
scene.addLayer(pointLayer);
});