From c9f622302bbc5a9a30cff341200334c3dd23ffe0 Mon Sep 17 00:00:00 2001
From: zuoxiao <470321431@qq.com>
Date: 星期一, 21 十月 2024 17:50:56 +0800
Subject: [PATCH] 1.巡检相关代码 2.保存地图中心点 3.缓存等级相关
---
app/src/main/assets/js/map.js | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/app/src/main/assets/js/map.js b/app/src/main/assets/js/map.js
index cdd6aef..0ab38db 100644
--- a/app/src/main/assets/js/map.js
+++ b/app/src/main/assets/js/map.js
@@ -31,6 +31,9 @@
var lay = new T.TileLayer(imageURL, { minZoom: 1, maxZoom: 18 });
var config = { layers: [lay] };
map = new T.Map("mapDiv", config);
+ var scale = new T.Control.Scale();
+ //娣诲姞姣斾緥灏烘帶浠�
+ map.addControl(scale);
map.centerAndZoom(new T.LngLat(116.40769, 39.89945), zoom); //鍦板浘鐨勫垵濮嬪寲涓績鐐癸紝姝や负鍖椾含鐨勭粡绾害
map.addEventListener("click", closeWaterIntakeDetail);
}
@@ -131,21 +134,21 @@
// 鎵嬫満鑾峰彇鍒板畾浣嶅悗鏄剧ず瀹氫綅
function locationOverLay(lng, lag) {
console.log("function銆嬨�嬨�嬨�嬨�媗ocationOverLay");
- map.centerAndZoom(new T.LngLat(lng, lag), 18);
+ map.centerAndZoom(new T.LngLat(lng, lag), map.getZoom());
let icon = new T.Icon({
iconUrl: locationIMGPath,
iconSize: new T.Point(27, 27),
iconAnchor: new T.Point(10, 25)
});
-
let marker = new T.Marker(new T.LngLat(lng, lag), { icon: icon });
map.addOverLay(marker);
}
//璁剧疆鍦板浘涓績鐐�
- function setCenterAndZoom(lng, lat) {
+ function setCenterAndZoom(lng, lat,thiszoom) {
+ zoom=thiszoom;
console.log("function銆嬨�嬨�嬨�嬨�媠etCenterAndZoom>>>>lng:" + lng + ",lat:" + lat);
map.centerAndZoom(new T.LngLat(lng, lat), zoom);
}
--
Gitblit v1.8.0