3DTiles瓦片清晰度调整
通过设置参数,降低远处瓦片的清晰度,从而提升整体场景的流畅度。


<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>3DTiles瓦片清晰度调整</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.6.0/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.67157852295259, 31.32119811567432],
zoom: 17,
bearing: 165,
pitch: 73,
userId: '***', // 授权码
});
map.on('load', function () {
// 加载3DTiles
const TILESET_URL = "<your 3dtiles url>";
map.addLayer(
{
id: 'tile-3d-layer',
type: "3DTiles",
data: TILESET_URL,
enableDynamicTileAdujst: true, // 开启瓦片清晰度调整
dynamicTileAdjustFactor: 49, // 设置模糊的强度
dynamicTileAdjustRange: 0.002, // 设置模糊的范围
}
)
})
</script>
</body>
</html>