Commit da65f50e authored by daniel's avatar daniel

feat(road-new): 轨迹优化

parent 2bad5cc2
......@@ -464,6 +464,10 @@ function getPlaceMakers(roadId, pathId) {
$("#editCpDisBtn").css("display", "none");
var editCpDisHtml = "";
if (content.length == 0) {
layer.msg("没有标记点,请导入有标记点的路线,以免影响您的后续使用!");
return
}
if (data.content.length == 0) {
layer.msg("没有标记点,请导入有标记点的路线,以免影响您的后续使用!");
return
......@@ -473,7 +477,13 @@ function getPlaceMakers(roadId, pathId) {
html: '<div class="cp-div"><span>' + e.name + '</span></div>',
iconSize: 30
});
var marker = L.marker([Number(e.latitude), Number(e.longitude)]).setIcon(myIcon1);
let latitude = Number(e.latitude)
let longitude = Number(e.longitude)
if (latitude > longitude) {
latitude = longitude;
longitude = e.latitude
}
var marker = L.marker([latitude, longitude]).setIcon(myIcon1);
marker.addTo(map.instance);
layers.push(marker);
$('.markers').append('<div data-checkpointId="' + e.checkpointId + '" class="marker"><label for="" class="marker-name">' + e.name + '</label>\n' +
......@@ -499,7 +509,6 @@ function getPlaceMakers(roadId, pathId) {
' </div>';
}
}
});
// 初始化智能步道数据
initCpDis(editCpDisHtml, roadId, pathId);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment