From 02349238af964e19a46da93e20466a48d755a453 Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期一, 02 九月 2024 17:38:04 +0800 Subject: [PATCH] 正在实现设备管理模块 --- src/utils/map/3dLayer.js | 23 +++-------------------- 1 files changed, 3 insertions(+), 20 deletions(-) diff --git a/src/utils/map/3dLayer.js b/src/utils/map/3dLayer.js index af6ff34..72d0e14 100644 --- a/src/utils/map/3dLayer.js +++ b/src/utils/map/3dLayer.js @@ -30,6 +30,7 @@ const fDatas = _factorDatas; const factor = _factor; drawMesh(fDatas, factor); + // console.log(map.getZoom()); } var _maxHeight = 1000, @@ -90,15 +91,12 @@ /** * 缁樺浘 */ -function drawMesh(fDatas, factor, center, merge) { +function drawMesh(fDatas, factor, merge) { const lnglats_GD = fDatas.lnglats_GD; const coors = fDatas.coors_GD; const heights = factor.heights; const colors = factor.colors; const bColor = factor.bottomColor; - if (center) { - map.setZoomAndCenter(16, center); - } // eslint-disable-next-line no-undef var cylinder = new AMap.Object3D.Mesh(); @@ -198,23 +196,8 @@ _maxH = maxH; } - // 3.纭畾瀹氫綅鍧愭爣鐐� - var center; - if (setCenter && lnglats_GD.length > 0) { - var p = lnglats_GD[0]; - for (let i = 0; i < lnglats_GD.length; i++) { - const e = lnglats_GD[i]; - if (e[0] != 0) { - p = e; - break; - } - } - // eslint-disable-next-line no-undef - center = new AMap.LngLat(...p); - } - // 5.缁樺埗3D鍥惧舰 - this.drawMesh(fDatas, factor, center, merge); + this.drawMesh(fDatas, factor, merge); // 缂╂斁鍦板浘鍒板悎閫傜殑瑙嗛噹绾у埆 // map.setFitView() -- Gitblit v1.9.3