antv-l7/examples/gallery/basic/demo/normal.js

35 lines
672 B
JavaScript
Raw Normal View History

2019-11-18 16:13:15 +08:00
import { Scene } from '@l7/scene';
import { PointNormalLayer } from '@l7/layers'
const scene = new Scene({
id: 'map',
type: 'amap',
style: 'dark',
center: [121.417463, 31.215175],
pitch: 0,
zoom: 11
});
window.mapScene = scene;
fetch('https://gw.alipayobjects.com/os/rmsportal/BElVQFEFvpAKzddxFZxJ.txt')
.then((res) => res.text())
.then((data) => {
const pointLayer =
new PointNormalLayer({
})
.source(data, {
parser: {
type: 'csv',
y: 'lat',
x: 'lng'
}
}).size(0.5)
.color('#080298')
.style({
opacity:1.,
})
scene.addLayer(pointLayer);
})