Commit 4bbe8ed4 authored by 单奇雲's avatar 单奇雲

bug

parent 9ce53a10
......@@ -22,7 +22,8 @@ import {
tirggerPlanTopic,
tirggerTransTopic,
cacheObjsSave,
flyToSubView
flyToSubView,
convertMarkerType
} from './dataProcessor';
import {
dealTroubleMarkers,
......@@ -569,7 +570,7 @@ class View3D extends Component {
treeData.forEach( t => {
if (t.isRegion && t.children && t.children.length > 0){
this.getPointLoop( { markers }, pointType, t.children);
} else if (t.position3d && !t.isRegion){
} else if (t.position3d && t.position3d.length > 0 && !t.isRegion){
t.position = t.position3d;
t.key = `${t.type}-${t.id}`;
t.label = t.name;
......@@ -1336,10 +1337,10 @@ class View3D extends Component {
changeMarkersData = (position,type,id) => {
const me = this;
const { markers, selectPoints } = me.state;
const index = markers[type].findIndex(e=>e.id === id);
const index = markers[convertMarkerType(type)].findIndex(e=>e.id === id && e.type === type);
if (index >= 0){
markers[type][index].position = position;
markers[type][index].isEdit = true;
markers[convertMarkerType(type)][index].position = position;
markers[convertMarkerType(type)][index].isEdit = true;
selectPoints.position = position;
me.setState({
markers,
......
......@@ -400,7 +400,7 @@ export const flyToSubView = (instance,obj,LENS_LEVEL) =>{
//改变marker坐标
export const changeMarkerPosition = (instance,obj,data) => {
const { id, type, position } = data;
(instance.markerList[convertType(type)] || []).forEach( mc => {
(instance.markerList[convertMarkerType(type)] || []).forEach( mc => {
const extData = mc.getExtData();
if (extData.id === id && extData.type === type) {
mc.baseObjHelper.position = position;
......@@ -408,7 +408,7 @@ export const changeMarkerPosition = (instance,obj,data) => {
});
};
const convertType = (type) => {
export const convertMarkerType = (type) => {
const fireEquipmentStr = 'fireCar,fireEquipment,fireChamber,fireFoamRoom,hydrant,pool';
return fireEquipmentStr.indexOf(type) > -1 ? 'fireEquipment' : type ;
};
......@@ -134,7 +134,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
planeOptions: {
width: 20,
height: 10,
position: [0, 20, 0],
position: [0, 10, 0],
doubleSide: true
},
canvasOptions: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment