| | |
| | | * @Author: shuishen 1109946754@qq.com |
| | | * @Date: 2022-08-18 17:00:30 |
| | | * @LastEditors: shuishen 1109946754@qq.com |
| | | * @LastEditTime: 2022-12-08 11:22:32 |
| | | * @LastEditTime: 2022-12-10 11:07:13 |
| | | * @FilePath: \srs-police-affairs\src\components\map\index.vue |
| | | * @Description: 公用地图组件 |
| | | * |
| | |
| | | }) |
| | | } |
| | | |
| | | let terrain = global.DC.TerrainFactory.createUrlTerrain({ |
| | | url: 'http://data.marsgis.cn/terrain' |
| | | }) |
| | | global.viewer.addTerrain(terrain) |
| | | |
| | | // 天地图 影像 |
| | | global.viewer.imageryLayers.addImageryProvider( |
| | | new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({ |
| | |
| | | console.log(e) |
| | | }) |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | let positions = [[117.951478782, 28.447896798, 0], [117.951469798, 28.447894686, 0], [117.951397357, 28.447698099, 0], [117.951505114, 28.447674695, 0], [117.951485465, 28.447619271, 0], [117.951706955, 28.447558541, 0], [117.951722755, 28.447611995, 0], [117.951834021, 28.447588427, 0], [117.951896863, 28.447789523, 0], [117.951478782, 28.447896798, 0]] |
| | | |
| | | let MIN_F_H = positions.map(item => { |
| | | item[2] = 70 |
| | | return item |
| | | }) |
| | | |
| | | let MAN_F_H = positions.map(item => { |
| | | item[2] = 80 |
| | | return item |
| | | }) |
| | | |
| | | // 原生Cesium加载多边体 |
| | | let floorEntitysLayers = new global.DC.Namespace.Cesium.CustomDataSource("floorEntitysLayers") |
| | | global.viewer.dataSources.add(floorEntitysLayers) |
| | | let flootEntitysEntites = floorEntitysLayers.entities |
| | | |
| | | let floorPositions = positions.reduce((prev, curr, index, arr) => { |
| | | curr.forEach(item => { |
| | | prev.push(item) |
| | | }) |
| | | return prev |
| | | }, []) |
| | | |
| | | flootEntitysEntites.add({ |
| | | polygon: { |
| | | hierarchy: global.DC.Namespace.Cesium.Cartesian3.fromDegreesArrayHeights(floorPositions), |
| | | heightReference: global.DC.Namespace.Cesium.HeightReference.RELATIVE_TO_GROUND, |
| | | extrudedHeightReference: global.DC.Namespace.Cesium.HeightReference.RELATIVE_TO_GROUND, |
| | | height: 70, |
| | | extrudedHeight: 80, |
| | | material: global.DC.Namespace.Cesium.Color.RED.withAlpha(0.5), |
| | | } |
| | | }) |
| | | |
| | | // console.log(floorPositions) |
| | | |
| | | // let floorPositions = MIN_F_H.concat(MAN_F_H) |
| | | |
| | | // let floorPolygonlayer = new global.DC.VectorLayer('floorPolygonlayer') |
| | | // global.viewer.addLayer(floorPolygonlayer) |
| | | |
| | | // let floorPolygon = new global.DC.Polygon( |
| | | // floorPositions |
| | | // ) |
| | | |
| | | // floorPolygon.setStyle({ |
| | | // height: 70, |
| | | // extrudedHeight: 80, |
| | | // material: global.DC.Color.GREEN.withAlpha(0.5), |
| | | // heightReference: 2, |
| | | // perPositionHeight: true |
| | | // }) |
| | | |
| | | // floorPolygonlayer.addOverlay(floorPolygon) |
| | | |
| | | // global.viewer.flyTo(floorPolygonlayer) |
| | | |
| | | global.viewer.flyTo(sqTileset) |
| | | |
| | | global.viewer.use(new global.DC.Measure()) |
| | |
| | | // global.viewer.scene.morphTo2D(1) |
| | | |
| | | // 清除控制台 |
| | | console.clear() |
| | | // console.clear() |
| | | |
| | | function isEleFullScreen () { |
| | | const fullScreenEle = |