mirror of https://gitee.com/antv-l7/antv-l7
60 lines
1.5 KiB
HTML
60 lines
1.5 KiB
HTML
<!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
|
|
center: [ -155, 60 ],
|
|
pitch: 0,
|
|
zoom: 4.5
|
|
});
|
|
window.scene = scene;
|
|
scene.on('loaded', () => {
|
|
$.get('./data/earthquakes.geojson', data => {
|
|
scene.HeatmapLayer({
|
|
zIndex: 2
|
|
})
|
|
.source(data)
|
|
.size('mag', [ 0, 1 ]) // weight映射通道
|
|
.style({
|
|
intensity: 1,
|
|
radius: 10,
|
|
rampColors: {
|
|
colors: [ 'rgba(33,102,172,0)', 'rgb(103,169,207)', 'rgb(209,229,240)', 'rgb(253,219,199)', 'rgb(239,138,98)', 'rgb(178,24,43)' ],
|
|
positions: [ 0.0, 0.2, 0.4, 0.6, 0.8, 1.0 ]
|
|
}
|
|
})
|
|
.render();
|
|
|
|
/* scene.PointLayer({
|
|
zIndex: 3
|
|
})
|
|
.source(data)
|
|
.shape('2d:circle')
|
|
.size(2)
|
|
.color('#EE2C2C')
|
|
.render();*/
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|