| | |
| | | * @Author: shuishen 1109946754@qq.com |
| | | * @Date: 2022-08-18 16:18:17 |
| | | * @LastEditors: shuishen 1109946754@qq.com |
| | | * @LastEditTime: 2023-04-21 16:39:18 |
| | | * @LastEditTime: 2023-04-25 16:30:36 |
| | | * @FilePath: \srs-police-affairs\src\views\home\index.vue |
| | | * @Description: 小区-栋-层-房屋 |
| | | * |
| | |
| | | const that = this |
| | | this.clearPolygonLayer() |
| | | this.areaOptions.forEach((item, index) => { |
| | | |
| | | item.position && item.position.forEach(sourceItem => { |
| | | const Json = { ...JSON.parse(sourceItem) } |
| | | global.DC.Namespace.Cesium.GeoJsonDataSource.load(Json, { |
| | |
| | | }, |
| | | |
| | | initHousingLayer () { |
| | | const that = this |
| | | let positionArr = JSON.parse(this.areaChecked.position).coordinates[0][0] |
| | | let polygon = this.$turf.polygon([positionArr]) |
| | | let center = this.$turf.centroid(polygon) |
| | |
| | | siteHeading: -3, |
| | | sitePitch: -45 |
| | | }) |
| | | let str = '' |
| | | positionArr.forEach(it => { |
| | | str = str + `${it[0]},${it[1]};` |
| | | }) |
| | | this.$EventBus.$emit('layerPolygonAdd', { |
| | | layerName: 'polygonLayer', |
| | | positions: str, |
| | | material: positionColor[0] |
| | | |
| | | this.areaChecked.position && this.areaChecked.position.forEach(sourceItem => { |
| | | const Json = { ...JSON.parse(sourceItem) } |
| | | global.DC.Namespace.Cesium.GeoJsonDataSource.load(Json, { |
| | | stroke: positionColor[0], |
| | | fill: positionColor[0], //注意:颜色必须大写,即不能为blue |
| | | strokeWidth: 0, |
| | | clampToGround: true |
| | | }).then(function (dataSource) { |
| | | DataSourcesArray.push(dataSource) |
| | | |
| | | that.areaPolygonLayerShow == false ? dataSource.show = false : dataSource.show = true |
| | | |
| | | global.viewer.dataSources.add(dataSource) |
| | | }) |
| | | }) |
| | | |
| | | this.housingOptions.length > 0 && this.housingOptions.forEach(item => { |