月球大数据地理空间分析展示平台-【前端】-月球2期前端
WX
2023-09-14 5d0ad67a45c25938c0ee890083ddb5aa4b97cd40
src/views/plotting/plotting.vue
@@ -142,13 +142,13 @@
      disableDepthTestDistance: Number.POSITIVE_INFINITY,
    },
  });
  var point = turf.point([geom.lat, geom.lng]);
  var point = turf.point([geom.lng, geom.lat]);
  var wkt = WKT.convert(point.geometry);
  list.value.push({
    name: name,
    layer: layer,
    // layer: layer,
    icon: "d.png",
    wkt: wkt,
    lng: geom.lng,
@@ -159,10 +159,11 @@
const setAddEntityPolyline = (res) => {
  var std = [];
  var res_val = res.polyline.positions.getValue();
  var coord = [];
  for (var i in res_val) {
    var geom = setCartesianToEightFour(res_val[i]);
    std.push(geom.lng, geom.lat);
    coord.push([geom.lng, geom.lat]);
  }
  var name = "Plyline#" + plotNum.value.line;
  var layer = Viewer.entities.add({
@@ -171,21 +172,20 @@
      positions: Cesium.Cartesian3.fromDegreesArray(std),
      width: 6,
      material: lineColor.value,
      clampToGround: true,
      //clampToGround: true,
      heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, //设置 HeightReference 高度参考类型为 CLAMP_TO_GROUND 贴地类型
      //classificationType: Cesium.ClassificationType.BOTH, //贴地形和3dtile  BOTH 或 CESIUM_3D_TILE 或 TERRAIN
      verticalOrigin: Cesium.VerticalOrigin.CENTER, // 垂直位置
      horizontalOrigin: Cesium.HorizontalOrigin.CENTER, // 水平位置
    },
  });
  var linestring = turf.lineString([
    [-24, 63],
    [-23, 60],
    [-25, 65],
    [-20, 69],
  ]);
  var linestring = turf.lineString(coord);
  console.log(linestring);
  var wkt = WKT.convert(linestring.geometry);
  list.value.push({
    wkt: wkt,
    name: name,
    layer: layer,
    // layer: layer,
    icon: "x.png",
  });
  plotNum.value.line++;
@@ -209,9 +209,10 @@
      outline: true,
      outlineColor: lineColor.value,
      outlineWidth: 2,
      classificationType: Cesium.ClassificationType.BOTH, //贴地形和3dtile
      classificationType: Cesium.ClassificationType.BOTH, //贴地形和3dtile  BOTH 或 CESIUM_3D_TILE 或 TERRAIN
      clampToGround: true, //开启贴地
      height: 0,
      heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, //设置 HeightReference 高度参考类型为 CLAMP_TO_GROUND 贴地类型
    },
  });
@@ -219,7 +220,7 @@
  var polygon = turf.polygon([coord]);
  var wkt = WKT.convert(polygon.geometry);
  console.log(polygon.geometry);
  let turfPoint = [];
  polygon.geometry.coordinates[0].forEach((e) => {
    turfPoint.push(turf.point(e));
@@ -227,11 +228,11 @@
  var features = turf.featureCollection(turfPoint);
  var center = turf.center(features);
  console.log(center);
  list.value.push({
    wkt: wkt,
    name: name,
    layer: layer,
    // layer: layer,
    icon: "m.png",
    lng: center.geometry.coordinates[0],
    lat: center.geometry.coordinates[1],
@@ -259,6 +260,7 @@
    getData: {},
  };
  // store.commit("SET_plotting", obj);
  store.state.plottingInquireData = obj;
};
watch(