cesium之添加3DTileset
cesium之添加3DTileset
//加载无锡三维模型-3D Tiles格式 addWXModelBy3DTiles() { let tiles = new Cesium.Cesium3DTileset({ url: '/wuxi7/tileset.json', // 带网络属性模板 maximumScreenSpaceError: 1, // Temporary workaround for low memory mobile devices - Increase maximum error to 8. maximumNumberOfLoadedTiles: 1000 // Temporary workaround for low memory mobile devices - Decrease (disable) tile cache. }) this.modalEntities = this.viewer.scene.primitives.add(tiles) this.setmodalEntitiesStyle( 'rgba(246,247,241,1)', 'rgba(185,70,31,1)', 'rgba(23,171,220,1)', 'rgba(254,253,143,1)' ) }, // 设置模型颜色渲染 setmodalEntitiesStyle(color, color1, color2, color3) { this.modalEntities.style = new Cesium.Cesium3DTileStyle({ color: { conditions: [ ['${pmark} >= 3', color3], ['${pmark} >= 2', color2], ['${pmark} >= 1', color1], ['${pmark} >= 0', color], ['true', color] // 普通楼 ] } }) },
钻研不易,转载请注明出处。。。。。。