1、1-3步骤和前面的一样
2、使用
let resData = res.data || [];
let maxArea = 0;
resData.forEach((item) => {
if (item.seArea > maxArea) {
maxArea = item.seArea;
}
item.value = item.seArea;
item.name = item.areaName;
});
maxArea = Math.ceil(maxArea);
this.mapData = resData;
this.mapOption = getMapRayOption(resData, "fxtrStr");
this.mapOption.visualMap = {
type: "continuous",
show: true,
right: "10%",
min: 0,
max: maxArea,
color: ["#13A95E", "#E2F0EB"],
text: ["高(" + maxArea + ")", "低(" + 0 + ")"],
calculable: false,
textStyle: {
color: "#fff",
fontSize: 12,
},
align: "left",
};
this.$refs.mymapHeat.registerMap(this.name);