【mars3d】new mars3d.layer.GeoJsonLayer({实现多孔面遮罩mask: true,

【mars3d】new mars3d.layer.GeoJsonLayer({实现多孔面遮罩

官网测试示例:

1.功能示例(Vue版) | Mars3D三维可视化平台 | 火星科技

测试代码:

export function showDraw(isFlyTo) {

removeLayer()

const geoJsonLayer = new mars3d.layer.GeoJsonLayer({

data: {

type: "FeatureCollection",

features: [

{

type: "Feature",

properties: {},

geometry: {

type: "MultiPolygon",

coordinates: [

\[ \[116.572718, 32.038626, 14.4\], \[118.079673, 31.18226, 11.2\], \[116.932438, 30.87228, 4.2\], \[116.362336, 31.417173, 148.8

]

],

\[ \[117.788689, 32.729397, -585\], \[118.825616, 31.834101, -742.5\], \[119.59371, 32.769803, -455.4\], \[118.600367, 33.462162, -599.5

]

]

]

}

}

]

},

mask: true, // 标识为遮罩层【重点参数】

symbol: {

styleOptions: {

fill: true,

color: "rgb(2,26,79)",

opacity: 0.9,

outline: true,

outlineColor: "#39E09B",

outlineWidth: 8,

outlineOpacity: 0.8,

arcType: Cesium.ArcType.GEODESIC,

clampToGround: true

}

}

// flyTo: true

})

map.addLayer(geoJsonLayer)

}

测试效果:

相关推荐
xiaofeichaichai4 小时前
Webpack
前端·webpack·node.js
fqbqrr5 小时前
2606C++,C++构的多态
开发语言·c++
问心无愧05135 小时前
ctf show web入门111
android·前端·笔记
唐某人丶5 小时前
模型越来越强,我们还需要 Agent 工程吗?—— 从价值重估到 Harness 实践
前端·agent·ai编程
智码看视界5 小时前
现代Web开发基础:全栈工程师的起航点
前端·后端·c5全栈
biter down5 小时前
从 0 到 1 搭建 Python 接口自动化测试框架(博客系统实战)
开发语言·python
JS菌5 小时前
手写一个 AI Agent 全栈项目:从沙箱执行到子智能体的完整实现
前端·人工智能·后端
excel6 小时前
HLS TS 文件损坏的元凶:Git 提交与拉取
前端