| | |
| | | this.listdata.name = null; |
| | | this.option = []; |
| | | }, |
| | | clearQuerInfo() { |
| | | if (this.$store.state.queryInfo.length != 0) { |
| | | for (var i in this.$store.state.queryInfo) { |
| | | sgworld.Viewer.entities.remove(this.$store.state.queryInfo[i]); |
| | | } |
| | | this.$store.state.queryInfo = []; |
| | | if (this.$store.state.primitLayer != null) { |
| | | sgworld.Creator.DeleteObject(this.$store.state.primitLayer); |
| | | this.$store.state.primitLayer = null; |
| | | } |
| | | } |
| | | }, |
| | | setTableAll() { |
| | | this.clearQuerInfo(); |
| | | this.signGetPublicKey(); |
| | | this.startTableMssage(); |
| | | this.listdata.wkt = this.$store.state.mapMenuShpFile; |
| | |
| | | this.showAllImage(data.result); |
| | | }, |
| | | async showAllImage(res) { |
| | | if (window.Viewer.scene.primitives.length != null) { |
| | | window.Viewer.scene.primitives.removeAll(); |
| | | } |
| | | if (this.$store.state.primitLayer != null) { |
| | | sgworld.Creator.DeleteObject(this.$store.state.primitLayer); |
| | | this.$store.state.primitLayer = null; |
| | | } |
| | | |
| | | for (var i in res) { |
| | | var param = { |
| | | gid: res[i].gid, |
| | |
| | | var val1 = decr(data.result); |
| | | if (val1) { |
| | | var wkt = this.$wkt.parse(val1); |
| | | this.getprimitiLayer(wkt); |
| | | // this.getprimitiLayer(wkt); |
| | | this.primitivesAddLayer(wkt); |
| | | } |
| | | } |
| | |
| | | } |
| | | }, |
| | | primitivesAddLayer(res) { |
| | | debugger |
| | | switch (res.type) { |
| | | case "Point": |
| | | var val = Cesium.Cartesian3.fromDegrees( |
| | |
| | | res.coordinates[1], |
| | | 200 |
| | | ); |
| | | this.$store.state.primitLayer.add({ |
| | | var point = Viewer.entities.add({ |
| | | position: val, |
| | | image: SmartEarthRootUrl + "Workers/image/mark.png", |
| | | billboard: { |
| | | // å¾åå°åï¼URIæCanvasç屿§ |
| | | image: SmartEarthRootUrl + "Workers/image/mark.png", |
| | | // 大尿¯å¦ä»¥ç±³ä¸ºåä½ |
| | | sizeInMeters: false, |
| | | // ç¸å¯¹äºåæ çåç´ä½ç½® |
| | | verticalOrigin: Cesium.VerticalOrigin.CENTER, |
| | | // ç¸å¯¹äºåæ çæ°´å¹³ä½ç½® |
| | | horizontalOrigin: Cesium.HorizontalOrigin.LEFT, |
| | | // åºç¨äºå¾åçç»ä¸æ¯ä¾ãæ¯ä¾å¤§äºä¼1.0æ¾å¤§æ ç¾ï¼èæ¯ä¾å°äºä¼1.0ç¼©å°æ ç¾ã |
| | | scale: 1.0, |
| | | // æ¯å¦æ¾ç¤º |
| | | show: true |
| | | } |
| | | }); |
| | | this.$store.state.queryInfo.push(point) |
| | | break; |
| | | case "LineString": |
| | | case "MultiLineString": |
| | | var line = res.coordinates[0]; |
| | | var std = []; |
| | | for (var i in line) { |
| | | std.push(line[i][0], line[i][1]); |
| | | } |
| | | var instance = new Cesium.GeometryInstance({ |
| | | geometry: new Cesium.GroundPolylineGeometry({ |
| | | var polyline = Viewer.entities.add({ |
| | | polyline: { |
| | | positions: Cesium.Cartesian3.fromDegreesArray(std), |
| | | width: 4.0, |
| | | }), |
| | | attributes: { |
| | | color: Cesium.ColorGeometryInstanceAttribute.fromColor( |
| | | new Cesium.Color(1.0, 0.0, 0.0, 0.3) |
| | | ), |
| | | }, |
| | | }); |
| | | window.Viewer.scene.primitives.add( |
| | | new Cesium.GroundPolylinePrimitive({ |
| | | geometryInstances: instance, |
| | | appearance: new Cesium.PolylineColorAppearance(), |
| | | }) |
| | | ); |
| | | width: 5, |
| | | material: new Cesium.Color(1.0, 0.0, 0.0, 0.3), |
| | | clampToGround: true, |
| | | } |
| | | }) |
| | | this.$store.state.queryInfo.push(polyline) |
| | | break; |
| | | case "MultiPolygon": |
| | | var val = res.coordinates[0][0]; |
| | |
| | | for (var i in val) { |
| | | std.push(val[i][0], val[i][1]); |
| | | } |
| | | var primitive = new Cesium.GroundPrimitive({ |
| | | //è´´å°çprimitive |
| | | geometryInstances: new Cesium.GeometryInstance({ |
| | | geometry: new Cesium.PolygonGeometry({ |
| | | //æ¯æCircleGeometryï¼CorridorGeometryï¼EllipseGeometryï¼RectangleGeometry |
| | | polygonHierarchy: new Cesium.PolygonHierarchy( |
| | | Cesium.Cartesian3.fromDegreesArray(std) |
| | | ), |
| | | }), |
| | | attributes: { |
| | | color: Cesium.ColorGeometryInstanceAttribute.fromColor( |
| | | new Cesium.Color(1.0, 0.0, 0.0, 0.3) |
| | | ), |
| | | }, |
| | | }), |
| | | appearance: Cesium.EllipsoidSurfaceAppearance(), |
| | | }); |
| | | window.Viewer.scene.primitives.add(primitive); |
| | | var entity = Viewer.entities.add({ |
| | | polygon: { |
| | | hierarchy: Cesium.Cartesian3.fromDegreesArray(std), |
| | | //height : 100000, |
| | | material: new Cesium.Color(1.0, 0.0, 0.0, 0.3), |
| | | outline: true, |
| | | outlineColor: new Cesium.Color(1.0, 0.0, 0.0, 0.3), |
| | | } |
| | | }) |
| | | this.$store.state.queryInfo.push(entity) |
| | | break; |
| | | } |
| | | }, |
| | |
| | | }, |
| | | |
| | | mounted() { |
| | | // sgworld.Creator.SimpleGraphic.edit(false, { editProp: false }); |
| | | |
| | | this.menuTopFrom.queryType = 'rectangle'; |
| | | this.getAllTable(); |
| | | }, |
| | | methods: { |
| | | flyRemove() { |
| | | |
| | | }, |
| | | flyQuery() { |
| | | // Viewer.flyTo( sgworld.Creator.SimpleGraphic._viewer.entities._entities._array[0]) |
| | | // switch (this.menuTopFrom.queryType) { |
| | | // case 'point': //ç¹ |
| | | // Viewer.camera.flyTo({ |
| | | // destination: Cesium.Cartesian3.fromDegrees(this.flyEntity.lng, this.flyEntity.lat, 3000), |
| | | |
| | | // }); |
| | | |
| | | // break; |
| | | // case 'polyline': //线 |
| | | // debugger |
| | | // break; |
| | | // case 'rectangle': //ç©å½¢ |
| | | |
| | | // debugger |
| | | // break; |
| | | // case 'circle': //å |
| | | // debugger |
| | | // break; |
| | | // case 'polygon': //å¤è¾¹å½¢ |
| | | // debugger |
| | | // break; |
| | | // } |
| | | }, |
| | | changeValue(value) { |
| | | // var obj = {}; |
| | | // obj = this.queryOption.find(function (item) { |
| | | // return item.value === value; |
| | | // }); |
| | | // if (obj.value == 'inputFile') { |
| | | // this.getMenuTopFile(); |
| | | // } |
| | | var obj = {}; |
| | | obj = this.queryOption.find(function (item) { |
| | | return item.value === value; |
| | | }); |
| | | if (obj.value == 'inputFile') { |
| | | this.getMenuTopFile(); |
| | | } |
| | | }, |
| | | async getAllTable() { |
| | | const data = await inquiry_SelectTabs(); |
| | |
| | | //æ¸
空æ ç» |
| | | sgworld.Creator.SimpleGraphic.edit(false, { editProp: false }); |
| | | sgworld.Creator.SimpleGraphic.clear(); |
| | | |
| | | if (this.$store.state.queryInfo.length != 0) { |
| | | for (var i in this.$store.state.queryInfo) { |
| | | sgworld.Viewer.entities.remove(this.$store.state.queryInfo[i]); |
| | | } |
| | | this.$store.state.queryInfo = []; |
| | | } |
| | | if (this.$store.state.primitLayer != null) { |
| | | sgworld.Creator.DeleteObject(this.$store.state.primitLayer); |
| | | this.$store.state.primitLayer = null; |
| | | } |
| | | if (this.treeChange.length == 0) { |
| | | this.$message.error('è¯·éæ©è¦æ¥è¯¢çæ°æ®'); |
| | | return; |
| | |
| | | properties: { foo: 'bar' }, |
| | | }; |
| | | var circle = turf.circle(position, radius, options); |
| | | debugger |
| | | |
| | | this.setJonToWKT(circle); |
| | | }, |
| | | setTurfPolyOrLine(res, type) { |
| | |
| | | showMapMenuPop() { |
| | | this.$store.state.mapSpaceQueryLayer = this.treeChange; |
| | | this.$store.state.mapPopBoxFlag = '1'; |
| | | // this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close(); |
| | | this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close(); |
| | | this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.open("ç©ºé´æ¥è¯¢", null, { |
| | | close: () => { |
| | | |
| | | if (this.$store.state.primitLayer != null) { |
| | | // sgworld.Creator.DeleteObject(this.$store.state.primitLayer); |
| | | this.$store.state.primitLayer = null; |
| | | } |
| | | // if (this.$store.state.primitLayer != null) { |
| | | // // sgworld.Creator.DeleteObject(this.$store.state.primitLayer); |
| | | // this.$store.state.primitLayer = null; |
| | | // } |
| | | |
| | | if (window.Viewer.scene.primitives.length != 0) { |
| | | window.Viewer.scene.primitives.removeAll() |
| | | } |
| | | // if (window.Viewer.scene.primitives.length != 0) { |
| | | // window.Viewer.scene.primitives.removeAll() |
| | | // } |
| | | } |
| | | }); |
| | | this.$bus.$emit('changeMapMenuTop', 'true'); |
| | | sgworld.Creator.SimpleGraphic.edit(false, { editProp: false }); |
| | | // this.$bus.$emit('changeMapMenuTop', 'true'); |
| | | |
| | | // sgworld.Creator.SimpleGraphic.clear(); |
| | | //æ¸
空inputFile |
| | | // var file = document.getElementById('getMenuTopFile'); |
| | |
| | | this.menuTopFrom.queryLayer = null; |
| | | this.menuTopFrom.queryType = 'rectangle'; |
| | | this.$refs.tree.setCheckedKeys([]); |
| | | //æ¸
空æ ç» |
| | | //æ¸
空æ ç» |
| | | sgworld.Creator.SimpleGraphic.edit(false, { editProp: false }); |
| | | sgworld.Creator.SimpleGraphic.clear(); |
| | | |
| | | // //æ¸
é¤å¯¹è±¡ |
| | | // if (window.Viewer.scene.primitives.length != null) { |
| | | // window.Viewer.scene.primitives.removeAll(); |
| | | // } |
| | | // if (this.$store.state.primitLayer != null) { |
| | | // sgworld.Creator.DeleteObject(this.$store.state.primitLayer); |
| | | // this.$store.state.primitLayer = null; |
| | | // } |
| | | if (this.$store.state.queryInfo.length != 0) { |
| | | for (var i in this.$store.state.queryInfo) { |
| | | sgworld.Viewer.entities.remove(this.$store.state.queryInfo[i]); |
| | | } |
| | | this.$store.state.queryInfo = []; |
| | | } |
| | | //å
³éçªå£ |
| | | this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close("queryinfo"); |
| | | |
| | | |
| | | |
| | | |
| | | if (this.$store.state.primitLayer != null) { |
| | | sgworld.Creator.DeleteObject(this.$store.state.primitLayer); |
| | | this.$store.state.primitLayer = null; |
| | | } |
| | | }, |
| | | setCartesianToEightFour(res) { |
| | | var std = {}; |
| | |
| | | isNaviget: false, |
| | | treeData: null, |
| | | checkedKeys: [], |
| | | queryInfo:[], |
| | | }, |
| | | mutations: { |
| | | //è·åæéåé |
| | |
| | | FullScreen, |
| | | ScaleLine, |
| | | Rotate, |
| | | |
| | | } from "ol/control.js" |
| | | import * as turf from '@turf/turf'; |
| | | import { geometry } from '@turf/turf'; |
| | |
| | | css: 'twoMenu_imge86', |
| | | }, |
| | | |
| | | // { |
| | | // id: 'h9', |
| | | // label: 'synthesis.import1', |
| | | // name: '导å
¥SHP', |
| | | // css: 'twoMenu_imge85', |
| | | // }, |
| | | // { |
| | | // id: 'h10', |
| | | // label: 'synthesis.export1', |
| | | // name: '导åºSHP', |
| | | // css: 'twoMenu_imge86', |
| | | // }, |
| | | { |
| | | id: 'h9', |
| | | label: 'synthesis.import1', |
| | | name: '导å
¥SHP', |
| | | css: 'twoMenu_imge85', |
| | | }, |
| | | { |
| | | id: 'h10', |
| | | label: 'synthesis.export1', |
| | | name: '导åºSHP', |
| | | css: 'twoMenu_imge86', |
| | | }, |
| | | |
| | | |
| | | { |
| | |
| | | scaleLine: null, |
| | | Excavation: false, |
| | | entityaLayers: [], |
| | | isMenuFlag: null, |
| | | }; |
| | | }, |
| | | methods: { |
| | | //äºç´èåç¹å»åæ¢ |
| | | setChangeTwoMenu(res) { |
| | | //æ¸
é¤ç»å¶å¾å½¢å¯¹è±¡ |
| | | // sgworld.Creator.SimpleGraphic.clear(); |
| | | if (window.Viewer.scene.primitives.length != null) { |
| | | window.Viewer.scene.primitives.removeAll(); |
| | | } |
| | | if (this.$store.state.primitLayer != null) { |
| | | sgworld.Creator.DeleteObject(this.$store.state.primitLayer); |
| | | this.$store.state.primitLayer = null; |
| | | } |
| | | |
| | | |
| | | |
| | | //å
³éæå¼çä¿¡æ¯çªä½ |
| | | |
| | |
| | | window.model = null; |
| | | } |
| | | |
| | | |
| | | if (this.isMenuFlag != val) { |
| | | sgworld.Creator.SimpleGraphic.clear(); |
| | | this.isMenuFlag = val; |
| | | if (this.entityaLayers.length != 0) { |
| | | for (var i in this.entityaLayers) { |
| | | sgworld.Viewer.entities.remove(this.entityaLayers[i]); |
| | | } |
| | | this.entityaLayers = []; |
| | | } |
| | | for (var i in this.$store.state.queryInfo) { |
| | | sgworld.Viewer.entities.remove(this.$store.state.queryInfo[i]); |
| | | } |
| | | this.$store.state.queryInfo = []; |
| | | if (this.$store.state.primitLayer != null) { |
| | | sgworld.Creator.DeleteObject(this.$store.state.primitLayer); |
| | | this.$store.state.primitLayer = null; |
| | | } |
| | | } |
| | | |
| | | |
| | | switch (val) { |
| | | case 'a': //å¾å±ç®¡ç |
| | | |
| | | this.setCoverage(res.id); |
| | | break; |
| | | case 'b': |
| | |
| | | var north = Cesium.Math.toDegrees(entities[i].rectangle.coordinates.getValue().north); |
| | | var west = Cesium.Math.toDegrees(entities[i].rectangle.coordinates.getValue().west); |
| | | var south = Cesium.Math.toDegrees(entities[i].rectangle.coordinates.getValue().south); |
| | | var line = turf.lineString([[east, north], [west, south]]) |
| | | var line = turf.polygon([[[east, north], [west, north], [west, south], [east, south], [east, north]]]) |
| | | wkt = this.$wkt.convert(line.geometry) |
| | | var fill = entities[i].rectangle._material._color._value; |
| | | fillColor = fill.red + ',' + fill.green + ',' + fill.blue; |
| | |
| | | console.error(e); |
| | | } |
| | | }); |
| | | |
| | | document.getElementById("shpFile").value = "" |
| | | |
| | | }, |
| | | showShpEntity(res) { |
| | | |
| | | for (var i in res) { |
| | | |
| | | var wkt = this.$wkt.parse(res[i].wkt); |
| | | var fillColor = res[i].fillColor.split(","); |
| | | var color = new Cesium.Color(fillColor[0], fillColor[1], fillColor[2], res[i].opacity) |
| | | var color = new Cesium.Color(parseFloat(fillColor[0]), parseFloat(fillColor[1]), parseFloat(fillColor[2]), res[i].opacity); |
| | | var name = res[i].name |
| | | switch (res[i].type) { |
| | | case 'rectangle': |
| | | debugger |
| | | break; |
| | | case 'point': |
| | | debugger |
| | | break; |
| | | case 'polygon': |
| | | |
| | | var std = []; |
| | | var geo = wkt.coordinates[0]; |
| | | for (var i in geo) { |
| | | std.push(geo[i][0]) |
| | | std.push(geo[i][1]) |
| | | } |
| | | const entity = Viewer.entities.add({ |
| | | name: 'Wyoming', |
| | | var entity = Viewer.entities.add({ |
| | | name: name, |
| | | polygon: { |
| | | hierarchy: Cesium.Cartesian3.fromDegreesArray(std), |
| | | //height : 100000, |
| | | material:color, |
| | | material: color, |
| | | outline: true, |
| | | outlineColor: color, |
| | | } |
| | | }) |
| | | this.entityaLayers.push(entity) |
| | | break; |
| | | case 'point': |
| | | let point = Viewer.entities.add({ |
| | | name: name, |
| | | position: Cesium.Cartesian3.fromDegrees(wkt.coordinates[0], wkt.coordinates[1]), //ç»çº¬åº¦è½¬ä¸çåæ |
| | | point: { |
| | | show: true, |
| | | color: color, |
| | | pixelSize: 10, |
| | | outlineColor: color, |
| | | outlineWidth: 3, |
| | | heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, |
| | | disableDepthTestDistance: Number.POSITIVE_INFINITY, |
| | | }, |
| | | }); |
| | | |
| | | this.entityaLayers.push(point) |
| | | break; |
| | | case 'polyline': |
| | | debugger |
| | | var std = []; |
| | | var geo = wkt.coordinates; |
| | | for (var i in geo) { |
| | | std.push(geo[i][0]) |
| | | std.push(geo[i][1]) |
| | | } |
| | | let line = Viewer.entities.add({ |
| | | name: name, |
| | | polyline: { |
| | | //ç»çº¬åº¦æ°ç»è½¬ä¸çåæ ï¼å¸¦é«åº¦çè¯æ¯fromDegreesArrayHeights |
| | | positions: Cesium.Cartesian3.fromDegreesArray(std), |
| | | width: 10, |
| | | material: color, |
| | | clampToGround: true, |
| | | } |
| | | }) |
| | | |
| | | this.entityaLayers.push(line) |
| | | break; |
| | | case 'label': |
| | | debugger |
| | | const label = Viewer.entities.add({ |
| | | position: Cesium.Cartesian3.fromDegrees(wkt.coordinates[0], wkt.coordinates[1]), |
| | | label: { |
| | | text: name, |
| | | fillColor: color, |
| | | font: '28px', |
| | | horizontalOrigin: Cesium.HorizontalOrigin.CENTER, |
| | | verticalOrigin: Cesium.VerticalOrigin.TOP, |
| | | heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, |
| | | disableDepthTestDistance: Number.POSITIVE_INFINITY, |
| | | }, |
| | | }) |
| | | this.entityaLayers.push(label) |
| | | break; |
| | | } |
| | | } |
| | |
| | | font-size: 16px; |
| | | font-family: Microsoft YaHei; |
| | | font-weight: 400; |
| | | |
| | | border: 1px solid rgba(0, 0, 0, 0); |
| | | padding: 10px; |
| | | min-width: 100px; |
| | | margin-left: 10px; |
| | |
| | | <el-divider /> |
| | | <div class="mainBox"> |
| | | <div class="leftTree subpage_Div"> |
| | | <el-input v-model="filterInput" style="width:200px"></el-input> |
| | | <el-input |
| | | v-model="filterInput" |
| | | style="width:200px" |
| | | ></el-input> |
| | | <div style="width:450px"> |
| | | <el-tree |
| | | :data="domainData" |
| | |
| | | val: 'ä¸å¡æ°æ®', |
| | | children: [], |
| | | }, |
| | | { |
| | | val: 'å
æ°æ®', |
| | | children: [], |
| | | }, |
| | | ], |
| | | defaultProps: { |
| | | children: 'children', |
| | |
| | | getDomainTabs().then((res) => { |
| | | let bdres = res.result.filter((item) => item.ns == 'bd'); |
| | | let bsres = res.result.filter((item) => item.ns == 'bs'); |
| | | let mdres = res.result.filter((item) => item.ns == 'md'); |
| | | for (var i in bdres) { |
| | | // bdres[i].val = bdres[i].tabDesc + '(' + bdres[i].tab + ')'; |
| | | bdres[i].val = bdres[i].tabDesc; |
| | |
| | | // bsres[i].val = bsres[i].tabDesc + '(' + bsres[i].tab + ')'; |
| | | bsres[i].val = bsres[i].tabDesc; |
| | | } |
| | | for (var i in mdres) { |
| | | // bsres[i].val = bsres[i].tabDesc + '(' + bsres[i].tab + ')'; |
| | | mdres[i].val = mdres[i].tabDesc; |
| | | } |
| | | this.domainData[0].children = bdres; |
| | | this.domainData[1].children = bsres; |
| | | this.domainData[2].children = mdres; |
| | | }); |
| | | }, |
| | | handleSelectionChange(val) { |