From 5206e7a4f4c5b71c9ddeccdbbe5e7fba5b3eeb9b Mon Sep 17 00:00:00 2001 From: lixuliang <lixuliang_hd@126.com> Date: 星期五, 22 三月 2024 01:05:38 +0800 Subject: [PATCH] YOUHAU --- src/utils/map2.js | 25 +++++++++++++++++++++---- 1 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/utils/map2.js b/src/utils/map2.js index f701baf..9c152c7 100644 --- a/src/utils/map2.js +++ b/src/utils/map2.js @@ -2376,6 +2376,7 @@ window.mapapi.forEachFeatureAtPixel(e.pixel, function (feature) { console.log(feature.getProperties(), 'aaa'); + //鎼滅储鐨勭偣浣� if (window.pointArr.length > 0) { let obj = feature.getProperties().desc @@ -2391,7 +2392,7 @@ for (const propertyNames in properties) { if (propertyNames.indexOf("鐩戞帶鍚�") !== -1) { const infoM = Message({ - message: '璇ョ偣浣嶈棰戠洃鎺ф煡璇腑锛岃绋嶅悗', + message: '璇ョ偣浣嶈棰戠洃鎺у姞杞戒腑锛岃绋嶅悗', type: 'info', offset: 75, center: true, @@ -2402,7 +2403,10 @@ // 璇锋眰鍦ㄧ嚎鐘舵�� window.gisBaseUrl + "BEApi/getCameraDetails?cameraIndexCode=" + properties["JK鍐呯爜"] - ).then(res => { + , { + timeout: 6000 + }) + .then(res => { if (res.data.data.status == 1) { infoM.close(); Message({ @@ -2432,14 +2436,25 @@ } else { infoM.close(); Message({ - message: '璇ョ偣浣嶈棰戠洃鎺х绾夸腑', - type: 'errer', + message: '璇ヨ棰戠洃鎺х绾夸腑', + type: 'error', offset: 75, center: true, duration: 2000, }); return } + }) + .catch(err => { + infoM.close(); + Message({ + message: '璇ヨ棰戠洃鎺ц姹傝秴鏃�', + type: 'error', + offset: 75, + center: true, + duration: 2000, + }); + return }) return } else if (propertyNames.indexOf("閮ㄤ欢鍚嶇О") !== -1) { @@ -2498,6 +2513,7 @@ export function flyToPoint(posisitons) { window.mapapi.getView().animate({ center: ol.proj.fromLonLat(posisitons), + projection: "EPSG:3857", zoom: 18, duration: 1500 }) @@ -2513,6 +2529,7 @@ if (len === 2) { window.mapapi.getView().animate({ center: window.mapapi.getView().getCenter(), + projection: "EPSG:3857", zoom: window.mapapi.getView().getZoom() - 1, duration: 1000, }); -- Gitblit v1.9.3