diff --git a/src/jlmap3d/edit/Jlmap3ddata.js b/src/jlmap3d/edit/Jlmap3ddata.js index 6ee42ad2c..e93eaa0af 100644 --- a/src/jlmap3d/edit/Jlmap3ddata.js +++ b/src/jlmap3d/edit/Jlmap3ddata.js @@ -46,8 +46,8 @@ export function Jlmap3ddata(mapid,scope){ }else{ // console.log(editmapid); // console.log(data.data.id); - // init3d(editmapid,data.data); - initobj(editmapid,data.data.id); + init3d(editmapid,data.data); + // initobj(editmapid,data.data.id); } } @@ -154,7 +154,7 @@ export function Jlmap3ddata(mapid,scope){ }) .then(function(data){ //console.log(data); - return jlmap3ddata.signallist.loadpromise(signaldata,scene,assetloader); + return jlmap3ddata.signallist.loadpromise(signaldata,scene,assetloader,mapdata.signalList); }) .then(function(data){ //console.log(data); diff --git a/src/jlmap3d/edit/editmodel/LinkList.js b/src/jlmap3d/edit/editmodel/LinkList.js index e04436985..094c78b95 100644 --- a/src/jlmap3d/edit/editmodel/LinkList.js +++ b/src/jlmap3d/edit/editmodel/LinkList.js @@ -89,7 +89,7 @@ function linkhelp(data,scene){ testmesh2.lengthfact = data[i].lengthfact; for(let i=0;i link.lengthfact/2){ + posx = link.position.x + signaldata.offset - link.lengthfact/2-10; + }else{ + posx = link.position.x - (link.lengthfact/2 - signaldata.offset)+10; + } + //根据线路方向修改信号灯位置 + if(signaldata.directionType == "01"){ + signaldata.position.set(posx,0,link.position.z-3); + signaldata.rotation.z = ( Math.PI / 2 ); + }else if(signaldata.directionType == "02"){ + signaldata.position.set(posx,0,link.position.z+3); + signaldata.rotation.z = ( - Math.PI / 2 ); + } + } + }; this.init = function(data,realsectionlist,scene,assetloader){ diff --git a/src/jlmap3d/edit/jlmap3dedit.js b/src/jlmap3d/edit/jlmap3dedit.js index f2ee2712f..398870a18 100644 --- a/src/jlmap3d/edit/jlmap3dedit.js +++ b/src/jlmap3d/edit/jlmap3dedit.js @@ -243,6 +243,8 @@ export function JLmap3dEdit(dom, data, mapid) { this.autoss = function(){ console.log("autoss"); + console.log(scope.mapdata); + scope.mapdata.signallist.resetsignal(scope.mapdata.linklist); }; function onWindowResize() { diff --git a/src/jlmap3d/main/control/ScalControls.js b/src/jlmap3d/main/control/ScalControls.js index d6e291b26..a56070eea 100644 --- a/src/jlmap3d/main/control/ScalControls.js +++ b/src/jlmap3d/main/control/ScalControls.js @@ -142,7 +142,7 @@ THREE.ScalControls = function ( scene,_camera, _domElement ) { // _movemesh.geometry.computeBoundingBox(); _movemesh.geometry.computeBoundingSphere(); _movemesh.geometry.center(); - _movemesh.lengthfact = (_movemesh.geometry.attributes.position.array[_movemesh.rightlist[0]] - _movemesh.geometry.attributes.position.array[_movemesh.leftlist[0]])*2+20.5; + _movemesh.lengthfact = (_movemesh.geometry.attributes.position.array[_movemesh.rightlist[0]] - _movemesh.geometry.attributes.position.array[_movemesh.leftlist[0]])*2+28.5; // testmesh2.position.z = 50; // testmesh2.geometry.center();