|
|
@@ -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 = [];
|
|
|
}
|