Jelajahi Sumber

分层分户

maxiaoxiao 6 bulan lalu
induk
melakukan
5c7cbe25c2

+ 2 - 1
src/components/Combinations/LayerManage/LayerManage.vue

@@ -266,7 +266,8 @@ export default {
             });
           } else if (obj.dataexplain == "分层分户") {
             store.setLayerList(layers[0][0]);    
-            layers[0][0].indexedDBSetting.isAttributesSave = true;
+            layers[0][0].title = obj.title
+            // layers[0][0].indexedDBSetting.isAttributesSave = true;
           }
           // store.state.S3MList.push(layers[0]);
           store.state.tempLatData = layers;

+ 23 - 8
src/components/Query/clickQuery/clickQuery.vue

@@ -740,13 +740,29 @@ export default {
       removeGeoJSON("geoserver");
       clearTranslate()
       let title;
-      if (store.state.checkedData) title = store.state.checkedData.title;
-      //  超图分层分户
-      if (title == "分层分户" || title == "8号楼-谷") {
-        let id = handModel(movement);
-      } else {
-        handnew(movement,(id)=> this.getFenCengFenHu(id,store.state.checkedData));
-      }
+      // if (store.state.checkedData) title = store.state.checkedData.title;
+      // //  超图分层分户
+      // if (title == "分层分户" || title == "8号楼-谷") {
+      //   let id = handModel(movement);
+      // } else {
+      //   handnew(movement,(id)=> this.getFenCengFenHu(id,store.state.checkedData));
+      // }
+      let { id, primitive } = handnew(movement);
+      let obj = store.state.vectorlayerlist.find(
+        (o) => o.title == primitive.title
+      );
+      console.log(obj, "res");
+      let queryByIDPar = {
+        getFeatureMode: "ID",
+        datasetNames: [`${obj.fwgzkj}:${obj.fwmc.replace("data", "model")}`],
+        ids: [id],
+      };
+      let url2 = calcIserverURI(obj.url).replace("3D-", "data-");
+      mapQuery(url2, queryByIDPar).then((mores) => {
+        let feature = mores.features[0];
+        let mi = feature.fieldNames.findIndex((n) => n == "模型名称");
+        this.getFenCengFenHu(feature.fieldValues[mi], obj);
+      });
       // let newArr = [];
       // GetHouseInfo({ id: "2c01647f-4533-4472-b20b-f5caa4c705b0" }).then(
       //   (res) => {
@@ -768,7 +784,6 @@ export default {
       };
      let url2 = calcIserverURI(obj.url).replace("3D-", "data-");
       mapQuery(url2, queryByIDPar).then(
-        
         (res) => {
           if (res && res.totalCount > 0) {
             let feature = res.features[0];

+ 10 - 8
src/components/Query/clickQuery/modelLayering.js

@@ -1,4 +1,5 @@
 import { GetFloorIds } from "../../../api/map";
+let layer = {}
 var dataurl = "https://www.supermapol.com/realspace/services/data-HeBing8HaoLou/rest/data/featureResults.rjson?returnContent=true";
 var
     idList = [],
@@ -53,13 +54,14 @@ export function handnew(e, fun) { //得到户型id
     //拾取模型
     let pickedFeature = scene.pick(e.position);
     let id = pickedFeature.id;
+    layer = pickedFeature.primitive
     Translate([id], e)
+    console.log(id, pickedFeature, 'pickedFeature')
     // var properties = pickedFeature.getPropertyNames();
-    let layer = store.state.chooseLayer
-    layer.getAttributesById(id).then((data, t, i) => {
-        // console.log(id, data, 'pickedFeature')
-        fun(data['模型名称'])
-    })
+    // layer.getAttributesById(id).then((data, t, i) => {
+    //     fun(data['模型名称'])
+    // })
+    return pickedFeature
 
     // GetFloorIds({ id }).then((res) => {
     //     console.log('idList', res.data)
@@ -72,14 +74,14 @@ function Translate(idList, e) {
         let normal = scene.pickNormal(e.position);
         Array.prototype.push.apply(totalList, idList);
         var offsetNormal = Cesium.Cartesian3.multiplyByScalar(normal, Number(20), scratchNromal); //可以更改偏移默认值
-        store.state.chooseLayer.setObjsTranslate(idList, offsetNormal);
+        layer.setObjsTranslate(idList, offsetNormal);
     }
 }
 
 //清除偏移
 export function clearTranslate() {
-    if (store.state.chooseLayer.setObjsTranslate)
-        store.state.chooseLayer.setObjsTranslate(totalList, new Cesium.Cartesian3(0, 0, 0));
+    if (layer.setObjsTranslate)
+        layer.setObjsTranslate(totalList, new Cesium.Cartesian3(0, 0, 0));
     idList = [];
     totalList = [];
 }