|
@@ -338,9 +338,8 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
if (measure.parent) {
|
|
|
//未被删除
|
|
|
console.warn('changePoints', measure.dataset_points.length )
|
|
|
- if(measure.type == 'Path'){
|
|
|
-
|
|
|
- bus.emit('changePoints', measure.dataset_points.map((p,i)=>{return {position:p.clone(), modelId:measure.points_datasets[i]}}))
|
|
|
+ if(measure.type == 'Path'){
|
|
|
+ bus.emit('changePoints', measure.dataset_points.map((p,i)=>{return {position:p.clone(), modelId:measure.points_datasets[i], name:measure.markerLabels[i].text}}))
|
|
|
}else{
|
|
|
bus.emit('update', [
|
|
|
measure.dataset_points.map(p => p.clone()),
|
|
@@ -1332,7 +1331,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
|
|
|
}
|
|
|
{
|
|
|
- let curSelectMarker = {}
|
|
|
+ let curSelectMarker
|
|
|
path.addEventListener('markerSelect',(e)=>{
|
|
|
let msg
|
|
|
if(e.cancel){
|
|
@@ -1341,7 +1340,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
curSelectMarker = e.marker
|
|
|
msg = path.markers.indexOf(e.marker)
|
|
|
}
|
|
|
- msg != void 0 && console.log('msg',msg)
|
|
|
+ //msg != void 0 && console.log('msg',msg)
|
|
|
msg != void 0 && bus.emit('activePoint', msg )
|
|
|
})
|
|
|
path.addEventListener('titlePosChanged',(e)=>{
|
|
@@ -1362,8 +1361,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
let functions = Object.assign(funs,{
|
|
|
bus,
|
|
|
|
|
|
- changeEditMode(state){//进入编辑
|
|
|
- console.log('changeEditMode', path.title, state)
|
|
|
+ changeEditMode(state){//进入编辑
|
|
|
if(!state){
|
|
|
viewer.dispatchEvent({ type: 'cancel_insertions', dontRemove: true, measure:path })
|
|
|
}
|
|
@@ -1382,9 +1380,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
}
|
|
|
}else{
|
|
|
viewer.dispatchEvent({ type: 'cancel_insertions', dontRemove: true, measure:path })
|
|
|
- }
|
|
|
-
|
|
|
- console.log('changeCanEdit', path.title, state)
|
|
|
+ }
|
|
|
path.setAddOrRemPoint(state)
|
|
|
},
|
|
|
visibility(v){
|
|
@@ -1394,8 +1390,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
visibilityName(v){
|
|
|
path.setTitleVisi(path.titleLabel.parent, v, 'user')
|
|
|
},
|
|
|
- changeName(name){
|
|
|
- console.log('changeName, oldName:', path.title, 'newName', name )
|
|
|
+ changeName(name){
|
|
|
path.setTitle(name)
|
|
|
},
|
|
|
changePointName(index,name){
|
|
@@ -1407,8 +1402,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
deletePoint(index){
|
|
|
path.removePoint(index)
|
|
|
},
|
|
|
- changeFontSize(fontsize){
|
|
|
- console.log('changeFontSize', path.title, fontsize)
|
|
|
+ changeFontSize(fontsize){
|
|
|
path.setFontSize(fontsize)
|
|
|
},
|
|
|
changeLine({width,color,altitudeAboveGround}){
|
|
@@ -1502,8 +1496,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
}
|
|
|
path.editEnable && functions.changeEditMode(false)
|
|
|
path.addOrRemovePoint && path.setAddOrRemPoint(false)
|
|
|
-
|
|
|
- console.log('play')
|
|
|
+
|
|
|
functions.createAni();//不传参数时路径最圆润缓和,但会脱离原路径。传参后除了拐弯都按路径,参数越大越圆润,但容易有折回的bug。 如果没有严格要求就不传参效果最佳。
|
|
|
path.animation_.play()
|
|
|
path.animation_.addEventListener('playDone', () => {
|
|
@@ -1522,10 +1515,21 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
|
|
|
})
|
|
|
|
|
|
+
|
|
|
+ for(let i in functions){
|
|
|
+ if(functions[i] instanceof Function){
|
|
|
+ let oldFun = functions[i]
|
|
|
+ functions[i] = function(){
|
|
|
+ console.warn('path', i, path.title, ...arguments)
|
|
|
+ oldFun.apply(this, arguments)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
path.functions = functions
|
|
|
|
|
|
props.line && functions.changeLine(props.line)
|
|
|
-
|
|
|
+ functions
|
|
|
|
|
|
return functions
|
|
|
|