| | |
| | | linePath: null, |
| | | richTextPoint1: null, |
| | | wfsLayer: null, |
| | | dataSource: null, |
| | | init(url) { |
| | | this.url = url; |
| | | this.getJsonLayer(); |
| | |
| | | }); |
| | | }, |
| | | setQueryTF2(name) { |
| | | // const obj = "weaponname like '%" + name + "%'" + ""; |
| | | // const obj = "weaponname like '%堤丰系统%'" + ""; |
| | | const filed = this.getPublickey(name); |
| | | const layer = modelLayer.layers.filter((item) => { |
| | | if (item.name == "武器点") { |
| | |
| | | dbid: modelLayer.dbid, |
| | | where: filed |
| | | }).then((response) => { |
| | | |
| | | if (response.code != 200) return; |
| | | const geom = response.data.items[0]; |
| | | |
| | | const position = [geom._x, geom._y, 0]; |
| | | const cylinder = { |
| | | radius: 1500, //半径 |
| | | radius: 400000, //半径 |
| | | angle: 30, //扫描角度(可选) |
| | | speed: 5, //倍速(可选) |
| | | stackPartitions: 80, //横向网格数(可选) |
| | |
| | | position, |
| | | cylinder |
| | | ); |
| | | // Viewer.zoomTo(this.rectangularSensor.item); |
| | | Viewer.zoomTo(this.rectangularSensor.item); |
| | | }); |
| | | }, |
| | | setQueryByFiled(name, color) { |
| | |
| | | }, |
| | | setTitleSetRest() { |
| | | this.targetList = []; |
| | | if (this.dataSource) { |
| | | Viewer.dataSources.remove(this.dataSource); |
| | | this.dataSource = null |
| | | } |
| | | if (this.wfsLayer) { |
| | | // this.wfsLayer.removeFromMap(); |
| | | this.wfsLayer.destroy(); |
| | |
| | | }, |
| | | setAddWfsJson() { |
| | | const url = this.getQueryUrl("SubicBayWeapon_wfs", "weapons"); |
| | | |
| | | const that = this; |
| | | Cesium.GeoJsonDataSource.load(url, { |
| | | fill: Cesium.Color.fromCssColorString("#FFFFFF00"), |
| | | stroke: Cesium.Color.fromCssColorString("#FFFFFF00"), //多边形或线的颜色 |
| | | |
| | | strokeWidth: 0 //多边形或线 宽度 |
| | | }).then((dataSource) => { |
| | | const entities = dataSource.entities.values; |
| | | that.dataSource = dataSource; |
| | | const entities = that.dataSource.entities.values; |
| | | entities.map((item) => { |
| | | item.polygon._material.color = |
| | | Cesium.Color.fromCssColorString("#FFFFFF00"); |
| | | |
| | | item.polygon.heightReference = |
| | | Cesium.HeightReference.RELATIVE_TO_GROUND; // 贴地 |
| | | item.polygon.height = 0; // 距地高度0米 |
| | |
| | | positions: positions, |
| | | clampToGround: true, // 贴地 |
| | | width: 5, |
| | | material: Cesium.Color.fromCssColorString("#FF0000") |
| | | material: Cesium.Color.fromCssColorString("#FFA500") |
| | | }); |
| | | console.log(item._name); |
| | | |
| | | const label_name = item.name ?item.name :""; |
| | | item.label = { |
| | | text: label_name, |
| | |
| | | fillColor: new Cesium.Color.fromCssColorString("#FFFFFF"), |
| | | outlineWidth: 1, // 字体外圈线宽度(同样也有颜色可设置) |
| | | outlineColor: new Cesium.Color.fromCssColorString("#FFFFFF"), |
| | | verticalOrigin: Cesium.VerticalOrigin.BOTTOM, // 垂直位置 |
| | | verticalOrigin: Cesium.VerticalOrigin.BASELINE, // 垂直位置 |
| | | pixelOffset: new Cesium.Cartesian2(0, 0), // 中心位置 |
| | | disableDepthTestDistance: Number.POSITIVE_INFINITY, |
| | | distanceDisplayCondition: new Cesium.DistanceDisplayCondition( |
| | | 500.0, |
| | | 3000.0 |
| | | ), |
| | | ) |
| | | // showBackground:true, |
| | | // backgroundColor: new Cesium.Color(26 / 255, 196 / 255, 228 / 255, 1.0) //背景顔色 |
| | | }; |
| | | }); |
| | | |
| | | Viewer.dataSources.add(dataSource); |
| | | Viewer.dataSources.add(that.dataSource); |
| | | }); |
| | | }, |
| | | getTileSet() { |