Riku
2025-03-20 7d02024c5351e620dcc2d49f36331e4a37228ea4
src/utils/map/grid.js
@@ -264,7 +264,8 @@
        strokeWeight: 1, //线条宽度,默认为 2
        strokeColor: 'white', //线条颜色
        fillOpacity: 0,
        extData: p.extData
        extData: p.extData,
        zIndex: 11
      });
      if (typeof event === 'function') {
@@ -348,7 +349,13 @@
   * @param {string} factorName 监测因子名称
   * @param {number} opacity 透明度
   */
  drawGridColor(gridViews, gridDataDetail, factorName, opacity, zIndex) {
  drawGridColor(gridViews, gridDataDetail, factorName, style) {
    let {
      strokeWeight = 1,
      strokeColor = 'white',
      opacity = 1,
      zIndex = 11
    } = style;
    const res = [];
    // 遍历卫星遥测数据数组
    gridDataDetail.forEach((d, i) => {
@@ -365,11 +372,27 @@
          nextColor.map((v) => v * 255),
          ratio
        );
        const _extData = grid.getExtData();
        grid.setOptions({
          zIndex: zIndex ? zIndex : 10,
          fillColor: _color,
          fillOpacity: opacity ? opacity : color[3] == 0 ? 0 : 0.7
          strokeWeight,
          strokeColor,
          zIndex,
          fillColor: _color, //多边形填充颜色
          fillOpacity: opacity,
          extData: {
            ..._extData,
            gridData: d
          }
        });
        if (d.gridStyle && style.isMixGridHighlight) {
          const _strokeWeight = d.gridStyle.strokeWeight;
          const _strokeColor = d.gridStyle.strokeColor;
          grid.setOptions({
            strokeWeight: _strokeWeight, //线条宽度,默认为 1
            strokeColor: _strokeColor //线条颜色
          });
        }
        res.push(grid);
      }
@@ -378,7 +401,8 @@
    return res;
  },
  drawGridColorCustom(gridViews, gridDataDetail, opacity) {
  drawGridColorCustom(gridViews, gridDataDetail) {
    var max, min;
    gridDataDetail.forEach((t) => {
      if (!t.pm25) return;
@@ -407,8 +431,8 @@
          ratio
        );
        grid.setOptions({
          fillColor: _color,
          fillOpacity: opacity ? opacity : color[3] == 0 ? 0 : 0.7
          fillColor: _color, //多边形填充颜色
          // fillOpacity: style.opacity ? style.opacity : color[3] == 0 ? 0 : 1
        });
        res.push(grid);