From a0ac379b28daeac8deddfae34f0015935a811bac Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期五, 07 二月 2025 17:39:47 +0800 Subject: [PATCH] 修改细分网格的展示逻辑 --- src/views/satellitetelemetry/SatelliteProxy.js | 37 +++++++++++++++++++++++++++++++------ 1 files changed, 31 insertions(+), 6 deletions(-) diff --git a/src/views/satellitetelemetry/SatelliteProxy.js b/src/views/satellitetelemetry/SatelliteProxy.js index 1b36366..51334eb 100644 --- a/src/views/satellitetelemetry/SatelliteProxy.js +++ b/src/views/satellitetelemetry/SatelliteProxy.js @@ -14,8 +14,19 @@ } function clearText(mapViews) { - if (mapViews && typeof mapViews.textViews === 'object') { - map.remove(mapViews.textViews); + if (mapViews) { + if (typeof mapViews.dataTxt === 'object') { + map.remove(mapViews.dataTxt); + } + if (typeof mapViews.dataLayer === 'object') { + map.remove(mapViews.dataLayer); + } + if (typeof mapViews.rankTxt === 'object') { + map.remove(mapViews.rankTxt); + } + if (typeof mapViews.rankLayer === 'object') { + map.remove(mapViews.rankLayer); + } } } @@ -24,9 +35,23 @@ // 缁樺埗缃戞牸 const points = gridInfo.map((v) => { return calculate.wgs84_To_Gcj02(v.longitude, v.latitude); - // return [v.longitude, v.latitude] + // return [v.longitude, v.latitude]; }); - const gridPoints = gridMapUtil.parseGridPoint(points); + // const gridPoints = gridMapUtil.parseGridPoint(points); + // console.log('gridPoints:', gridPoints); + + const gridPoints = gridInfo.map((v) => { + return [ + calculate.wgs84_To_Gcj02(v.point1Lon, v.point1Lat), + calculate.wgs84_To_Gcj02(v.point2Lon, v.point2Lat), + calculate.wgs84_To_Gcj02(v.point3Lon, v.point3Lat), + calculate.wgs84_To_Gcj02(v.point4Lon, v.point4Lat) + // [v.point1Lon, v.point1Lat], + // [v.point2Lon, v.point2Lat], + // [v.point3Lon, v.point3Lat], + // [v.point4Lon, v.point4Lat] + ]; + }); const gridViews = gridMapUtil.drawPolylines(gridPoints); return { gridViews, gridPoints, points }; } @@ -41,7 +66,7 @@ }; }); // return gridMapUtil.drawGridTextLabel(data, textViews, labelsLayer, 'bottom'); - return gridMapUtil.drawGridText(data, textViews, 'top-center'); + return gridMapUtil.drawGridText(data, textViews, 'top-center', 'data'); } // 缁樺埗鐩戞祴鏁版嵁鎺掑悕鏂囨湰 @@ -54,7 +79,7 @@ }; }); // return gridMapUtil.drawGridTextLabel(data, textViews, labelsLayer, 'top'); - return gridMapUtil.drawGridText(data, textViews, 'bottom-center'); + return gridMapUtil.drawGridText(data, textViews, 'bottom-center', 'rank'); } // 缁樺埗鐩戞祴鏁版嵁鍊煎搴旂綉鏍奸鑹� -- Gitblit v1.9.3