antv-l7/demos/08_point_shape.html

64 lines
1.3 KiB
HTML
Raw Normal View History

2018-11-16 17:36:52 +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>point_circle</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: [ 120.037828998113099, 30.086317611850635 ],
2018-11-19 10:45:40 +08:00
pitch: 0,
2018-11-16 17:36:52 +08:00
zoom: 5.44
});
window.scene = scene;
2018-11-19 10:45:40 +08:00
var colorObj={
'黄色':'yellow',
'蓝色':'blue',
'橙色':'orange'
}
2018-11-16 17:36:52 +08:00
scene.on('loaded', () => {
$.get('./data/waringData.json', data => {
scene.PointLayer({
zIndex: 2
})
.source(data, {
type: 'array',
x: 'lon',
y: 'lat',
})
2018-11-19 10:45:40 +08:00
.shape('2d:radar')
.size(80 )
2018-11-16 17:36:52 +08:00
.active(false)
2018-11-19 10:45:40 +08:00
.color('signallevel',(v)=>{
return colorObj[v];
})
.style({
shape:'radar'
})
2018-11-16 17:36:52 +08:00
.render();
});
});
</script>
</body>
</html>