antv-l7/demos/heatmap.html

60 lines
1.5 KiB
HTML
Raw Normal View History

2019-02-27 14:50:10 +08:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="geometry" content="diagram">
<link rel="stylesheet" href="./assets/common.css">
<title>heatmap</title>
<style>
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
<body>
<div id="map"></div>
<script src="https://webapi.amap.com/maps?v=1.4.8&key=15cd8a57710d40c9b7c0e3cc120f1200&plugin=Map3D"></script>
<script src="./assets/jquery-3.2.1.min.js"></script>
<script src="./assets/dat.gui.min.js"></script>
<script src="../build/L7.js"></script>
<script>
const scene = new L7.Scene({
id: 'map',
mapStyle: 'dark', // 样式URL
2019-03-14 15:00:07 +08:00
center: [ -155, 60 ],
2019-02-27 14:50:10 +08:00
pitch: 0,
zoom: 4.5
});
2019-03-14 15:00:07 +08:00
2019-02-27 14:50:10 +08:00
window.scene = scene;
scene.on('loaded', () => {
2019-03-01 13:09:41 +08:00
$.get('https://gw.alipayobjects.com/os/basement_prod/08c6ea00-dc5f-4bb0-b0b5-52bde5edf0a3.json', data => {
2019-02-27 14:50:10 +08:00
scene.HeatmapLayer({
zIndex: 2
})
2019-03-14 15:00:07 +08:00
.source(data)
.size('mag', [ 0, 1 ]) // weight映射通道
2019-02-27 14:50:10 +08:00
.style({
2019-03-16 20:49:30 +08:00
intensity: 100,
2019-03-14 15:00:07 +08:00
radius: 30,
2019-02-27 14:50:10 +08:00
rampColors: {
colors: [ 'rgba(33,102,172,0.0)', 'rgb(103,169,207)', 'rgb(209,229,240)', 'rgb(253,219,199)', 'rgb(239,138,98)', 'rgb(178,24,43,1.0)' ],
positions: [ 0, 0.2, 0.4, 0.6, 0.8, 1.0 ]
2019-02-27 14:50:10 +08:00
}
})
.render();
/*scene.PointLayer({
zIndex: 2
})
.source(data)
.shape('2d:circle')
.size(2) // weight映射通道
.color('red')
.render();*/
2019-02-27 14:50:10 +08:00
});
});
</script>
</body>
</html>