|
@@ -23,7 +23,7 @@ let cesAspect , cesImageryProvider
|
|
|
let isValidPoint = (modelId)=>{//所存的modelId没被删或者它本身不在模型上
|
|
|
return modelId == Id_noIntersect || viewer.objs.children.concat(viewer.scene.pointclouds).some(e=>e.dataset_id == modelId )
|
|
|
}
|
|
|
-
|
|
|
+let curSelectPath
|
|
|
|
|
|
{
|
|
|
// 84坐标转高德 (国外地区用84,所以地理注册时填的是84,我这需要转成高德)
|
|
@@ -660,8 +660,9 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- o.isFlyToTag = true
|
|
|
+
|
|
|
if (o.distance || o.maxDis) {
|
|
|
+ //o.isFlyToTag = true
|
|
|
let requestShowPano
|
|
|
let position = o.target || o.position
|
|
|
if(o.isFlyToTag){
|
|
@@ -939,7 +940,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
let msg = {}
|
|
|
if (!lastState.position || !model.position.equals(lastState.position)) {
|
|
|
lastState.position = msg.position = model.position.clone()
|
|
|
- //console.log('change pos', model.position.toArray())
|
|
|
+ console.log('change pos', model.name, model.position.toArray())
|
|
|
}
|
|
|
if (!lastState.rotation || !model.rotation.equals(lastState.rotation)) {
|
|
|
lastState.rotation = msg.rotation = model.rotation.clone()
|
|
@@ -949,7 +950,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
}
|
|
|
|
|
|
msg = Potree.Common.CloneObject(msg)
|
|
|
- //console.log(msg)
|
|
|
+ //console.log(model.name, msg)
|
|
|
bus.emit('transformChanged', msg)
|
|
|
})
|
|
|
spliceFromArr(model, props, true)
|
|
@@ -1088,12 +1089,17 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
model.dispatchEvent('transformChanged') //改了position */
|
|
|
},
|
|
|
changePosition(pos) {//校准取消时执行
|
|
|
- console.log('changePosition', pos.x, pos.y, pos.z)
|
|
|
- model && model.position.copy(pos)
|
|
|
+ console.log('changePosition', model.name, pos.x, pos.y, pos.z)
|
|
|
+ if(pos.x == 0 && pos.y == 0 && pos.z == 0 && model.lonLatPos ){
|
|
|
+ model && model.position.copy(model.lonLatPos)
|
|
|
+ console.log('changePosition 使用经纬度坐标', model.name )
|
|
|
+ }else{
|
|
|
+ model && model.position.copy(pos)
|
|
|
+ }
|
|
|
model.dispatchEvent({ type: 'position_changed' })
|
|
|
},
|
|
|
changeRotation(rot) {//校准取消时执行
|
|
|
- console.log('changeRotation', rot.x, rot.y, rot.z)
|
|
|
+ console.log('changeRotation', model.name, rot.x, rot.y, rot.z)
|
|
|
model && model.rotation.setFromVector3(rot)
|
|
|
model.dispatchEvent({ type: 'rotation_changed' })
|
|
|
},
|
|
@@ -1478,6 +1484,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
})
|
|
|
|
|
|
path.addEventListener('chose',(e)=>{
|
|
|
+ switchSelect(e.state)
|
|
|
bus.emit('focus', e.state)
|
|
|
})
|
|
|
|
|
@@ -1485,18 +1492,23 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
let funs = getMeasureFunction(path, bus)
|
|
|
|
|
|
|
|
|
- //let fadeFar = -1
|
|
|
-
|
|
|
+
|
|
|
+ let switchSelect = (state)=>{//切换选择,最多一个选中
|
|
|
+ if(state){
|
|
|
+ curSelectPath && curSelectPath.setSelected('unclick' ) //取消上一个选中的
|
|
|
+ curSelectPath = path
|
|
|
+ }else{
|
|
|
+ curSelectPath == path && (curSelectPath = null)
|
|
|
+ }
|
|
|
+ }
|
|
|
let functions = Object.assign(funs,{
|
|
|
bus,
|
|
|
|
|
|
changeEditMode(state){//进入编辑
|
|
|
if(!state){
|
|
|
viewer.dispatchEvent({ type: 'cancel_insertions', dontRemove: true, measure:path })
|
|
|
- }
|
|
|
-
|
|
|
- path.setEditEnable(state)
|
|
|
- //functions.changeVisibilityRange(fadeFar)
|
|
|
+ }
|
|
|
+ path.setEditEnable(state)
|
|
|
},
|
|
|
|
|
|
changeCanEdit(state){//是否点击pen图标以加点和删点
|
|
@@ -1539,23 +1551,19 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
path.setPathWidth(width)
|
|
|
path.setPathColor(color)
|
|
|
},
|
|
|
- changeVisibilityRange(far){//设置消失距离
|
|
|
- //fadeFar = far
|
|
|
- //path.setFadeFar(( far== -1 || path.editEnable) ? null : far) //注意:编辑时显示全部
|
|
|
+ changeVisibilityRange(far){//设置消失距离
|
|
|
path.setFadeFar(far== -1 ? 0 : far)
|
|
|
},
|
|
|
highlight(state){
|
|
|
path.setSelected(state?'hover':'unhover', true)
|
|
|
},
|
|
|
focus(state){
|
|
|
+ switchSelect(state)
|
|
|
path.setSelected(state?'click':'unclick', true)
|
|
|
},
|
|
|
changeDirection(show,reverse){
|
|
|
path.setArrowDisplay(show)
|
|
|
- if(path.reverse != reverse){
|
|
|
- path.reverse = reverse
|
|
|
- path.constructor.updateArrows(true)
|
|
|
- }
|
|
|
+ path.setReverse(reverse)
|
|
|
},
|
|
|
createAni(tension){
|
|
|
let distance = path.getTotalDistance()
|