From ec6193939600ca7930193b1d5942b1700baf9e06 Mon Sep 17 00:00:00 2001
From: zuoxiao <470321431@qq.com>
Date: 星期五, 21 二月 2025 09:20:15 +0800
Subject: [PATCH] 1.巡检记录列表页的实现 2.巡检记录地图展示路径的详情页。 3.处理巡检记录详情页因打开同一个网址导致的webView不显示问题。 4.实现地图页搜索后的地图跳转功能。 5.巡检记录详情页数据加载的优化,默认加载本地数据,当本地没有数据时从服务端获取数据。
---
app/src/main/assets/js/map.js | 43 ++++++++++++++++++++++++++++++++++++-------
1 files changed, 36 insertions(+), 7 deletions(-)
diff --git a/app/src/main/assets/js/map.js b/app/src/main/assets/js/map.js
index af17e60..aed2047 100644
--- a/app/src/main/assets/js/map.js
+++ b/app/src/main/assets/js/map.js
@@ -8,7 +8,9 @@
MARKER_BLUE: 'img/marker_blue.svg',
CENTER_PIN: 'img/push_pin.svg',
DIVIDE_BLUE: 'img/divide_home_blue.svg',
- DIVIDE_RED: 'img/divide_home_red.svg'
+ DIVIDE_RED: 'img/divide_home_red.svg',
+ MARKER_START: 'img/marker_blue_start.svg',
+ MARKER_END: 'img/marker_blue_end.svg'
},
MAP: {
DEFAULT_ZOOM: 12,
@@ -56,6 +58,7 @@
window.showAllWaterIntakes = showAllWaterIntakes;
window.hideAllDivides = hideAllDivides;
window.showAllDivides = showAllDivides;
+ window.showHistoryLocation = showHistoryLocation;
}
@@ -143,7 +146,7 @@
// 鎵嬫満鑾峰彇鍒板畾浣嶅悗鏄剧ず瀹氫綅
function locationOverLay(lng, lag) {
-// console.log("function銆嬨�嬨�嬨�嬨�媗ocationOverLay");
+ // console.log("function銆嬨�嬨�嬨�嬨�媗ocationOverLay");
map.centerAndZoom(new T.LngLat(lng, lag), map.getZoom());
let icon = new T.Icon({
iconUrl: CONFIG.IMAGES.LOCATION,
@@ -161,7 +164,7 @@
//璁剧疆鍦板浘涓績鐐�
function setCenterAndZoom(lng, lat, thiszoom) {
zoom = thiszoom;
-// console.log("function銆嬨�嬨�嬨�嬨�媠etCenterAndZoom>>>>lng:" + lng + ",lat:" + lat);
+ // console.log("function銆嬨�嬨�嬨�嬨�媠etCenterAndZoom>>>>lng:" + lng + ",lat:" + lat);
map.centerAndZoom(new T.LngLat(lng, lat), zoom);
}
@@ -322,7 +325,7 @@
},
addPoint(lng, lat, isNewLine, isShow) {
-// console.log(`Adding point: ${lng}, ${lat}, isNewLine: ${isNewLine}`); // 娣诲姞鏃ュ織
+ // console.log(`Adding point: ${lng}, ${lat}, isNewLine: ${isNewLine}`); // 娣诲姞鏃ュ織
const point = new T.LngLat(lng, lat);
@@ -352,7 +355,7 @@
},
showAll() {
-// console.log("showAllpipe" + this.lines.length);
+ // console.log("showAllpipe" + this.lines.length);
this.lines.forEach(line => {
if (line.overlay) {
map.addOverLay(line.overlay);
@@ -362,7 +365,7 @@
},
hideAll() {
-// console.log("hideAllpipe" + this.lines.length);
+ // console.log("hideAllpipe" + this.lines.length);
this.lines.forEach(line => {
if (line.overlay) {
map.removeOverLay(line.overlay);
@@ -610,5 +613,31 @@
map.addOverLay(item.label);
});
}
+ var historyPoint = [];
+ //鏄剧ず鍘嗗彶宸℃璁板綍
+ function showHistoryLocation(lng, lat, start, end) {
+ // 璋冪敤 Android 鎻愪緵鐨勬帴鍙o紝鑾峰彇鏁版嵁
+ console.log("aginShowLocation>>lng:" + lng + ">>>lat:" + lat+">>>start:"+start+">>>end:"+end);
+ var newPoint = new T.LngLat(lng, lat);
+ historyPoint.push(newPoint);
+ if (start === "true" || start === true) {
+ map.panTo(newPoint);
+ let marker = new T.Marker(
+ newPoint,
+ { icon: createIcon(CONFIG.IMAGES.MARKER_START, 35) }
+ );
+ map.addOverLay(marker);
+ } else if (end === "true" || end === true) {
+ let marker = new T.Marker(
+ newPoint,
+ { icon: createIcon(CONFIG.IMAGES.MARKER_END, 35) }
+ );
+ map.addOverLay(marker);
+ }
+ oldLineLayer.setLngLats(historyPoint);
+ map.addOverLay(oldLineLayer);
+ }
-})();
+}
+
+)();
--
Gitblit v1.8.0