From 9c2908d8a110eaa28ec63a877291aeea61ee4e60 Mon Sep 17 00:00:00 2001
From: zuoxiao <470321431@qq.com>
Date: 星期二, 03 十二月 2024 09:38:24 +0800
Subject: [PATCH] 优化自定义二次确认Dialog回调
---
app/src/main/assets/js/map.js | 21 ++++++++++++++++++++-
1 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/app/src/main/assets/js/map.js b/app/src/main/assets/js/map.js
index 130aa4b..1f20526 100644
--- a/app/src/main/assets/js/map.js
+++ b/app/src/main/assets/js/map.js
@@ -166,6 +166,7 @@
window.showToast = showToast;
window.addMarker = addMarker;
window.setCenterAndZoom = setCenterAndZoom;
+ window.updateLocation=updateLocation;
}
// 璋冪敤鍘熺敓瀹夊崜鏂规硶鏄剧ず鍙栨按鍙h鎯�
@@ -259,7 +260,7 @@
position: marker.getLngLat(),
offset: new T.Point(-35, 8), // 璁剧疆鏍囨敞鏂囧瓧鐨勪綅缃�
opacity: 1, // 璁剧疆鏂囨湰鐨勬樉绀轰笉閫忔槑搴︼紙鑼冨洿0-1锛�
- });
+ });
label.setBorderLine(0); // 璁剧疆鏂囨湰鐨勮竟妗嗙嚎瀹�
label.setBackgroundColor("transparent"); // 璁剧疆鏂囨湰鐨勮儗鏅壊锛堥�忔槑鑹诧級
label.setFontColor("#0000FF");
@@ -268,6 +269,24 @@
});
return "addMarker鍔犺浇鎴愬姛"
}
+ //淇濆瓨瀹氫綅鍧愭爣鐢熸垚杞ㄨ抗
+ var path=[];
+ var lineLayer = new T.Polyline([], { color: '#ff4500', weight: 3, opacity: 0.8 });
+
+ function updateLocation(log,lat){
+ var lastLat=lat;
+ // const intervalId = setInterval(() => {
+ // lastLat=lastLat+0.0001;
+ var newPoint = new T.LngLat(log,lastLat);
+ path.push(newPoint);
+ lineLayer.setLngLats(path);
+ map.addOverLay(lineLayer);
+ // 绉诲姩鍦板浘瑙嗚鍒版渶鍚庝竴涓綅缃�
+ map.panTo(newPoint);
+ // }, 500);
+
+ }
})();
+
\ No newline at end of file
--
Gitblit v1.8.0