Commit c6bd2c3535a3104624e365bcb3ba18655af4ceec
1 parent
85ec4df6
1.GPS测点工具更新,解析处理逻辑更新
Showing
1 changed file
with
7 additions
and
7 deletions
src/main/resources/static/pages/base/line/editRoute.html
| ... | ... | @@ -143,7 +143,7 @@ $('#edit_route_mobal').on('editRouteMobal.show', function(e,transGPS,editRoute,m |
| 143 | 143 | |
| 144 | 144 | // var sectionStr = ""; |
| 145 | 145 | var sections = []; |
| 146 | - let mapping = nearestSectionPoint(stationPointList, sectionPointList); | |
| 146 | + var mapping = nearestSectionPoint(stationPointList, sectionPointList); | |
| 147 | 147 | for (var i = 0; i < sectionPointList.length; i++) { |
| 148 | 148 | var pointStr = sectionPointList[i], |
| 149 | 149 | point = pointStr.split(","); |
| ... | ... | @@ -158,12 +158,12 @@ $('#edit_route_mobal').on('editRouteMobal.show', function(e,transGPS,editRoute,m |
| 158 | 158 | }; |
| 159 | 159 | |
| 160 | 160 | var nearestSectionPoint = function (stationPointList, sectionPointList) { |
| 161 | - let mapping = {}; | |
| 162 | - for (let i = 0;i < stationPointList.length - 1;i++) { | |
| 163 | - let minDistance = 999999999, stationPoint = stationPointList[i].split(","), pointStr; | |
| 164 | - for (let j = 0;j < sectionPointList.length;j++) { | |
| 165 | - let sectionPointStr = sectionPointList[j], sectionPoint = sectionPointStr.split(","); | |
| 166 | - let distance = Math.sqrt(Math.pow(parseFloat(stationPoint[0]) - parseFloat(sectionPoint[0]), 2) + Math.pow(parseFloat(stationPoint[1]) - parseFloat(sectionPoint[1]), 2)); | |
| 161 | + var mapping = {}; | |
| 162 | + for (var i = 0;i < stationPointList.length - 1;i++) { | |
| 163 | + var minDistance = 999999999, stationPoint = stationPointList[i].split(","), pointStr; | |
| 164 | + for (var j = 0;j < sectionPointList.length;j++) { | |
| 165 | + var sectionPointStr = sectionPointList[j], sectionPoint = sectionPointStr.split(","); | |
| 166 | + var distance = Math.sqrt(Math.pow(parseFloat(stationPoint[0]) - parseFloat(sectionPoint[0]), 2) + Math.pow(parseFloat(stationPoint[1]) - parseFloat(sectionPoint[1]), 2)); | |
| 167 | 167 | if (distance < minDistance) { |
| 168 | 168 | minDistance = distance; |
| 169 | 169 | pointStr = sectionPointStr; | ... | ... |