diff --git a/src/views/xuncha/components/inspection.vue b/src/views/xuncha/components/inspection.vue index f835e41..e9978cc 100644 --- a/src/views/xuncha/components/inspection.vue +++ b/src/views/xuncha/components/inspection.vue @@ -182,6 +182,7 @@ getPostionNow(); console.log('AllData.PostionValue.lonLat--', AllData.PostionValue.lonLat); AllData.currentPath.push(AllData.PostionValue.lonLat.split(',').map(Number)); + console.log('AllData.currentPath--', AllData.currentPath); //渲染当前位置 let currentPositionGeojson = { type: 'FeatureCollection', @@ -192,7 +193,7 @@ } else { newfiberMap.map.getSource('currentPosition').setData(currentPositionGeojson); } - if (AllData.currentPath.leng > 1) { + if (AllData.currentPath.length > 1) { let currentPathGeojson = { type: 'FeatureCollection', features: [turf.lineString(AllData.currentPath)],