添加特效球
构建特效球模型。

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>添加特效球</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no"/>
<style>
body {
margin: 0;
padding: 0;
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
</style>
<script src="https://delivery.mapmost.com/cdn/sdk/webgl/v9.0.0/mapmost-webgl-min.js"></script>
</head>
<body>
<div id="map"></div>
<script>
let map = new mapmost.Map({
container: 'map',
style: "<your style url>",
center: [120.74603465203592, 31.30505899929158],
zoom: 16.810035105070947,
pitch: 60,
bearing: 0,
userId: '***', // 授权码
});
map.on('load', function () {
let options = {
id: 'model_id',
type: 'model',
callback: function (group, layer) {
let sphere = layer.addSphere({
color: "#ff0000",
radius: 100,
wSegment: 64,
hSegment: 64,
phiLength: 180,
speed: 3,
opacity: 0.8,
center: [120.74579465203592, 31.30505899929158, 0.0]
});
}
};
map.addLayer(options);
})
</script>
</body>
</html>