antv-l7/examples/point/column/demo/column_dark.js

44 lines
1001 B
JavaScript
Raw Normal View History

2019-11-14 11:50:12 +08:00
import { Scene } from '@l7/scene';
import { PointLayer } from '@l7/layers'
2019-11-14 11:50:12 +08:00
const scene = new Scene({
id: 'map',
pitch: 35.210526315789465,
type: 'amap',
style: 'dark',
center: [108.524505, 29.873128],
zoom: 4.4,
});
window.mapScene = scene;
fetch('https://gw.alipayobjects.com/os/rmsportal/oVTMqfzuuRFKiDwhPSFL.json')
.then((res) => res.json())
.then((data) => {
const pointLayer =
new PointLayer({
2019-11-14 11:50:12 +08:00
})
.source(data.list, {
parser: {
type: 'json',
x: 'j',
y: 'w'
}
})
2019-11-14 11:50:12 +08:00
.shape('cylinder')
.size('t', function (level) {
2019-11-14 11:50:12 +08:00
return [1, 2, level * 2 + 20];
})
.color('t', [
2019-11-14 11:50:12 +08:00
'#094D4A', '#146968',
'#1D7F7E', '#289899',
'#34B6B7', '#4AC5AF',
'#5FD3A6', '#7BE39E',
'#A1EDB8', '#CEF8D6'
])
2019-11-14 11:50:12 +08:00
.style({
opacity: 1.0,
})
scene.addLayer(pointLayer);
console.log(pointLayer);
2019-11-14 11:50:12 +08:00
});