From f3a211cddc0dc9dba43799dcca3de40e6bc05752 Mon Sep 17 00:00:00 2001
From: zengh <123456>
Date: Fri, 28 May 2021 10:43:31 +0800
Subject: [PATCH] 路线导航修改
---
static/tabbar/investigationH.png | 0
xcxjingqingmap/lxdhmap.html | 2 +-
static/tabbar/investigation.png | 0
xcxjingqingmap/css/lxdhmap.css | 2 +-
xcxjingqingmap/js/lxdhmap.js | 45 ++++++++++++++++++++++++++++++---------------
5 files changed, 32 insertions(+), 17 deletions(-)
diff --git a/static/tabbar/investigation.png b/static/tabbar/investigation.png
index e9dbcc0..42ec163 100644
--- a/static/tabbar/investigation.png
+++ b/static/tabbar/investigation.png
Binary files differ
diff --git a/static/tabbar/investigationH.png b/static/tabbar/investigationH.png
index 9227478..c30ae0c 100644
--- a/static/tabbar/investigationH.png
+++ b/static/tabbar/investigationH.png
Binary files differ
diff --git a/xcxjingqingmap/css/lxdhmap.css b/xcxjingqingmap/css/lxdhmap.css
index 4b79d1a..cebdabf 100644
--- a/xcxjingqingmap/css/lxdhmap.css
+++ b/xcxjingqingmap/css/lxdhmap.css
@@ -73,7 +73,7 @@
}
#mh_query li span {
- font-size: 5px;
+ font-size: 12px;
font-weight: 100;
color: #000000;
}
diff --git a/xcxjingqingmap/js/lxdhmap.js b/xcxjingqingmap/js/lxdhmap.js
index 09cf929..58d0e06 100644
--- a/xcxjingqingmap/js/lxdhmap.js
+++ b/xcxjingqingmap/js/lxdhmap.js
@@ -12,6 +12,9 @@
mh_query_show: true,
ZBCXresult: null,
+
+ LXdhEnd: null,
+ LxdhLine: null,
move: null, //存放移动实例
@@ -224,7 +227,7 @@
$("#mh_query").append(html);
}
- //添加景点li点击事件,地图定位
+ //添加li点击事件,地图定位
$('#mh_query li').click(function() {
var ids = $(this).attr("id");
@@ -255,31 +258,43 @@
xy.push(resdata[i][0]);
data.push(xy);
}
+
+ if(that.LXdhEnd != null){
+ that.map.removeLayer(that.LXdhEnd);
+ }
+ if(that.LxdhLine != null){
+ that.map.removeLayer(that.LxdhLine);
+ }
//绘制起点和终点
- var markers = L.markerClusterGroup();
+ that.LXdhEnd = L.markerClusterGroup();
var transportIcon = L.Icon.extend({ //图标初始化
options: {
- iconSize: [30, 30], // 图标尺寸
+ iconSize: [56, 32], // 图标尺寸
}
});
- var qd = new transportIcon({
- iconUrl: './img/green.png'
- });
+
var zd = new transportIcon({
- iconUrl: './img/green.png'
+ iconUrl: './img/zd.png'
});
+ // var qd = new transportIcon({
+ // iconUrl: './img/qd.png'
+ // });
var qdzb = res.data.result.query;
-
- markers.addLayer(L.marker([qdzb.start.x, qdzb.start.y], {
- icon: qd,
- }));
- markers.addLayer(L.marker([qdzb.end.x, qdzb.end.y], {
+
+ var x = resdata[resdata.length-1][0];
+ var y = resdata[resdata.length-1][1];
+
+ that.LXdhEnd.addLayer(L.marker([y, x], {
icon: zd,
}));
- that.map.addLayer(markers);
+ // markers.addLayer(L.marker([qdzb.start.y, qdzb.start.x], {
+ // icon: qd,
+ // }));
+
+ that.map.addLayer(that.LXdhEnd);
that.showPolyLine(data);
@@ -298,12 +313,12 @@
[28.6876, 115.858],
[28.6791, 115.854]
];
- var polyline = L.polyline(xy, {
+ that.LxdhLine = L.polyline(xy, {
color: 'red'
}).addTo(that.map);
// zoom the map to the polyline
- that.map.fitBounds(polyline.getBounds())
+ that.map.fitBounds(that.LxdhLine.getBounds())
},
},
diff --git a/xcxjingqingmap/lxdhmap.html b/xcxjingqingmap/lxdhmap.html
index 0928f21..b1519eb 100644
--- a/xcxjingqingmap/lxdhmap.html
+++ b/xcxjingqingmap/lxdhmap.html
@@ -5,7 +5,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
- <title>map</title>
+ <title>地图</title>
<!-- vue -->
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.12"></script>
--
Gitblit v1.9.3