管道基础大数据平台系统开发-【前端】-新系統界面
TreeWish
2023-03-06 4aa41941b8f3ebb2c5524035ff6d2d8207c62ab6
src/components/MapView/mapSpacePop.vue
@@ -192,7 +192,6 @@
      // this.getTableselectFields();
      // this.restSpacePopLayer();
    },
  },
  created() {
    this.spaceLayer = this.$store.state.mapSpaceQueryLayer
@@ -411,12 +410,13 @@
      }
      var coord = res.coordinates
      if (res.type == "Point") {
      switch (res.type) {
        case "Point":
        var val = Cesium.Cartesian3.fromDegrees(
          res.coordinates[0],
          res.coordinates[1]
        )
        this.$store.state.primitLayer = Viewer.entities.add({
          var point = Viewer.entities.add({
          properties: properties,
          tag: "properties_point",
          position: val,
@@ -436,23 +436,22 @@
            show: true,
          },
        })
        this.$store.state.primitLayer.billboard.disableDepthTestDistance =
          Number.POSITIVE_INFINITY
          point.billboard.disableDepthTestDistance = Number.POSITIVE_INFINITY
          this.$store.state.queryInfo.push(point)
          sgworld.Navigate.flyToObj(point)
          this.$store.state.primitLayer = point
        sgworld.Navigate.flyToObj(this.$store.state.primitLayer)
      } else if (res.type == "MultiPolygon" || res.type == "LineString") {
        var val = res.coordinates[0][0]
          break
        case "LineString":
        case "MultiLineString":
          var line = res.coordinates[0]
        var std = []
        for (var i in val) {
          std.push(val[i][0])
          std.push(val[i][1])
          for (var i in line) {
            std.push(line[i][0], line[i][1])
        }
        this.$store.state.primitLayer = Viewer.entities.add({
          var polyline = Viewer.entities.add({
          properties: properties,
          tag: "properties_line",
          polyline: {
            positions: Cesium.Cartesian3.fromDegreesArray(std),
            width: 5,
@@ -460,34 +459,31 @@
            clampToGround: true,
          },
        })
        // this.$store.state.primitLayer = sgworld.Creator.createPolygon(std, {
        //   fillColor: '#ffff00',
        //   outlineColor: '#fff',
        //   outlineWidth: 2
        // }, 1, 0, "面");
        sgworld.Navigate.flyToObj(this.$store.state.primitLayer)
      } else if (res.type == "MultiLineString") {
        var line = res.coordinates[0]
        var std = []
        for (var i in line) {
          std.push({ x: line[i][0], y: line[i][1], z: 1000 })
        }
        const polyline = sgworld.Creator.createPolyline(
          std,
          "#ffff00",
          1,
          0,
          "线"
        )
        const entity =  polyline.item
        entity.properties = properties
        entity.tag =   "properties_line"
          this.$store.state.queryInfo.push(polyline)
          sgworld.Navigate.flyToObj(polyline)
        this.$store.state.primitLayer = polyline
          break
        case "MultiPolygon":
          var val = res.coordinates[0][0]
          var std = []
          for (var i in val) {
            std.push(val[i][0], val[i][1])
          }
          var entity = Viewer.entities.add({
            properties: properties,
            tag: "properties_polygon",
            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)
        sgworld.Navigate.flyToObj(entity)
          this.$store.state.primitLayer = entity
          break
      }
      this.setMapHandler()
    },
@@ -497,24 +493,12 @@
      )
      window.propertieshandler.setInputAction(event => {
        let pick = sgworld.Viewer.scene.pick(event.position)
        // ;
        if (pick && pick.id && pick.id.tag == "properties_point") {
          this.$store.state.propertiesFlag = "1"
          let properties = pick.id.properties
          let propertyNames = pick.id.properties.propertyNames
          let obj = {}
          obj["eventid"] = properties["_eventid"]._value
          //
          this.attributeData.forEach(item => {
            propertyNames.forEach(itemElement => {
              if (itemElement == item.field) {
                obj[item.alias] = properties[itemElement]._value
              }
            })
          })
          this.$store.state.propertiesInfo = obj
        } else if (pick && pick.id && pick.id._polyline && pick.id.tag == "properties_line") {
        if (
          pick &&
          pick.id &&
          pick.id.tag &&
          pick.id.tag.includes("properties_")
        ) {
          this.$store.state.propertiesFlag = "1"
          let properties = pick.id.properties
          let propertyNames = pick.id.properties.propertyNames