xzw 1 week ago
parent
commit
1e0a963ace
1 changed files with 5 additions and 5 deletions
  1. 5 5
      src/sdk/cover/index.js

+ 5 - 5
src/sdk/cover/index.js

@@ -6,7 +6,7 @@ import libTransform from 'coordtransform';
 
 
  
-let aniPaths = [], pathDevices = [], pathHistorys = new Map,  pathModels = {}, camFollowDevice,  modelDisToCam
+let aniPaths = [], pathDevices = [], pathHistorys = new Map,  pathModels = {}, camFollowDevice,  modelDisToCam, maxDevicePathId=0
 let createAnimatePath = (token)=>{//实时路径  保存:generateAniPathData
     let caseId = Potree.browser.urlHasValue('caseId',true)  
     let count = 0
@@ -2192,12 +2192,12 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
                     props.points = props.points.filter(e=> isValidPoint(e.modelId))
                     info.points_datasets = props.points.map(e=> e.modelId == Id_noIntersect ? null : e.modelId) 
                     info.dataset_points = info.points = props.points.map(e=>e.position)//当该点不在任何模型上时,记录的是世界坐标,所以两个都赋值,过后根据有无datasetID选择
-                    
                 }else{ //设备拍摄
                     props.points = props.points.map(e=>{ 
                         let p = viewer.transform.lonlatToLocal.forward(e)
                         return new THREE.Vector3().copy(p) 
                     })
+                    maxDevicePathId = Math.max(maxDevicePathId,parseInt(props.id))
                 }
                 
                 
@@ -2621,12 +2621,12 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
             modelDisToCam = 4 //拉进
         },
         
-        generateAniPathData(startId=0){//输出实时路径的数据保存
-            startId = parseInt(startId)
+        generateAniPathData( ){//输出实时路径的数据保存
+            let startId = maxDevicePathId + 1
             
             let dataAll = aniPaths.map((path,i)=>{
                 let data = {
-                    "id": startId + '_macId:'+pathDevices[i].macId  ,   //不知道存多少 怕和之前的混淆 
+                    "id": startId + i + '_macId:'+pathDevices[i].macId  ,   //不知道存多少 怕和之前的混淆 
                     isAnimate:1,
                    // "lineColor": "#ffffff",
                     "lineAltitudeAboveGround": 5,