src/utils/map/grid.js
@@ -84,22 +84,36 @@
 * 文本标记
 * 可修改position
 */
function textMaker(position, text, anchor) {
function textMaker(position, text, anchor, type) {
  let style = {};
  if (type == 'data') {
    style = {
      'font-size': '12px',
      'text-align': 'center',
      color: 'white',
      background: '#122b54a9',
      'text-shadow': 'black 2px 2px 2px',
      border: '0px',
      'margin-top': '4px'
    };
  } else if (type == 'rank') {
    style = {
      'font-size': '14px',
      'text-align': 'center',
      color: 'white',
      background: 'transparent',
      'text-shadow': 'black 2px 2px 2px',
      'border-radius': '2px',
      border: '1px solid #122b54a9',
      'margin-bottom': '4px'
    };
  }
  // eslint-disable-next-line no-undef
  return new AMap.Text({
    text: text,
    anchor,
    position: position,
    style: {
      'font-size': '13px',
      'text-align': 'center',
      color: 'white',
      'background-color': 'transparent',
      'text-shadow': 'black 2px 2px 2px',
      'border-radius': '2px',
      border: '1px',
      padding: '4px'
    }
    style: style
  });
}
@@ -204,7 +218,7 @@
    return gridViews;
  },
  drawGridText(points, textViews, anchor) {
  drawGridText(points, textViews, anchor, type) {
    if (textViews) {
      points.forEach((p, i) => {
        textViews[i].setPosition(p.lnglat_GD);
@@ -214,7 +228,7 @@
    } else {
      const _textViews = [];
      points.forEach((p) => {
        const m = textMaker(p.lnglat_GD, p.data, anchor);
        const m = textMaker(p.lnglat_GD, p.data, anchor, type);
        _textViews.push(m);
      });
      map.add(_textViews);