跳到主要内容
版本:9.14.0-beta

3DGS模型颜色效果设置

在地图中加载3DGS模型,支持对模型进行对比度、亮度、饱和度和不透明度等颜色效果设置。

show

   <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>3DGS模型颜色效果设置</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.14.0-beta/mapmost-webgl-min.js"></script>
</head>
<body>
<div id="map"></div>
<script>
var map = new mapmost.Map({
container: 'map',
style: "<your style url>",
center: [120.74449559193792, 31.30775326748954],
zoom: 16,
pitch: 60,
userId: '***', // 授权码
});

map.on('load', function () {
map.addLayer({
id: 'gs-3d-layer',
type: '3DGS',
url: './building.splat',
coord: [121.6857884, 30.6702618, -30],
colorFactor: {
contrast: 1.5, // 设置对比度
brightness: 0.5, // 设置亮度
saturation: 1.5, // 设置饱和度
},
opacity: 0.5, // 设置不透明度
});
})
</script>
</body>
</html>