mapbox地图叠加三维地形
一、地形数据下载
1.在天地图官网查找下载
二、地形数据处理
1.插件 dem2terrain-master(将tif数据转为三维地形数据) 地址:https://github.com/luothink/dem2terrain
以山东省为例:处理好地形数据如下图:

2.将处理好的地形瓦片数据发布在服务器中
三、mapbox地图叠加
mapBox.value.addSource('custom-dem', {
type: 'raster-dem',
tiles: ['http://******/access/dem/yunnan/{z}/{x}/{y}.png'], //此地址为地形发布后的图片路径
tileSize: 256,
maxzoom: 12
});
// 此颜色需要根据地图样式进行修改 待进行
mapBox.value.setFog({
range: [0.8, 8], // 调整范围
color: '#0A1117', // 与背景色一致
'high-color': '#0a1a2a',
'space-color': '#000000',
'horizon-blend': 0.1,
'star-intensity': 0.0
});
mapBox.value.setTerrain({
source: 'custom-dem',
exaggeration: 5
});
效果如下图:


浙公网安备 33010602011771号