Cesium package realizes configuration grid and interpolation elevation surface realization

1. Data structure modeling

2. The interpolation result obtained by the interpolation algorithm

3. Layer configuration

primitiveGrid:{

isRLayerPanel: true,

primitives:[],

url: '/static/data/Grid.json',

dataPath: '',

dataIdField: 'code',

options:{

id:'primitiveGrid',

name: 'grid',

type:'grid',

isShow: false

},

location: {

"destination":{"x":-2194142.1719457568,"y":4477352.104342483,"z":3981503.0453665117},

"orientation":{"heading":6.283185231778362,"pitch":-0.6090220537393618,"roll":7.622047348831984e-8},

duration: 2

},

entityType:'primitive'

},

primitiveTriangle:{

isRLayerPanel: true,

primitives:[],

url: '/static/data/Grid1.json',

dataPath: '',

dataIdField: 'code',

options:{

id:'primitiveTriangle',

name: 'triangle grid',

type:'triangleFan',

isShow: false

},

location: {

"destination":{"x":-2194142.1719457568,"y":4477352.104342483,"z":3981503.0453665117},

"orientation":{"heading":6.283185231778362,"pitch":-0.6090220537393618,"roll":7.622047348831984e-8},

duration: 2

},

entityType:'primitive'

}

4. Key code call

export function CommonDrawPrimitiveEntitiesByUrl(zjnCesium,layersInfo,LayersRenderSet,LayersRenderLabelSet,layerId){

getMapData(layersInfo[layerId].url).then((res) => {

if (layersInfo[layerId].dataPath != undefined && layersInfo[layerId].dataPath != "") {

let dp = layersInfo[layerId].dataPath.split('/')

for (let i = 0; i < dp.length; i++) {

res = res[dp[i]]

}

}

if(layersInfo[layerId].options.type=='water'){

CommonDrawPrimitiveEntities(res,zjnCesium,layersInfo,LayersRenderSet,LayersRenderLabelSet,layerId,layersInfo[layerId].dataGeoField,layersInfo[layerId].dataIdField)

}

if(layersInfo[layerId].options.type=='grid'){

CommonCreateMeshGridP(res,zjnCesium,layersInfo,LayersRenderSet,layerId)

}

if(layersInfo[layerId].options.type=='triangleFan'){

CommonCreateMeshTriangleFan(res,zjnCesium,layersInfo,LayersRenderSet,layerId)

}

});

}

五、实现效果展示

如果对您有帮助

感谢支持技术分享,请点赞支持:

技术合作交流qq:2401315930

Guess you like

Origin blog.csdn.net/weixin_42496466/article/details/129279906