From 42f42dc88214f283b43c422f37e10ab45c5c5578 Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期三, 12 三月 2025 17:32:13 +0800 Subject: [PATCH] 1. 新增绘图模式的切换 2. 新增行政区划的切换展示 --- src/model/Factor.js | 40 +++++++++++++++++++++++++--------------- 1 files changed, 25 insertions(+), 15 deletions(-) diff --git a/src/model/Factor.js b/src/model/Factor.js index 3af0452..5a720c1 100644 --- a/src/model/Factor.js +++ b/src/model/Factor.js @@ -61,22 +61,32 @@ this.standardMax = -1; //鐩戞祴鍥犲瓙绫诲瀷瀵瑰簲鐨勬爣鍑嗘渶澶у�� this.legendType = Legend.S_TYPE; //鍥句緥妯″紡 + // this.legendType = Legend.D_TYPE; //鍥句緥妯″紡 - if (options != undefined) { - this.datas = options.datas; - this.heights = options.heights; - this.min = options.min; - this.max = options.max; - this.originMin = options.originMin; - this.originMax = options.originMax; + if (typeof options === 'object') { + for (const key in options) { + if (Object.prototype.hasOwnProperty.call(options, key)) { + const value = options[key]; + this[key] = value; + } + } - this.factorName = options.factorName; - this.factorId = options.factorId; - this.colors = options.colors; - this.bottomColors = options.bottomColors; - this.bottomColor = options.bottomColor; - this.standardMin = options.standardMin; - this.standardMax = options.standardMax; + // this.datas = options.datas; + // this.heights = options.heights; + // this.min = options.min; + // this.max = options.max; + // this.originMin = options.originMin; + // this.originMax = options.originMax; + + // this.factorName = options.factorName; + // this.factorId = options.factorId; + // this.colors = options.colors; + // this.bottomColors = options.bottomColors; + // this.bottomColor = options.bottomColor; + // this.standardMin = options.standardMin; + // this.standardMax = options.standardMax; + + // this.legendType = options.legendType; } } @@ -127,7 +137,7 @@ this.heights = []; this.colors = []; this.datas.forEach((d) => { - const h = getFactorHeight(d.factorId, d.factorData, [this.min, this.max]); + let h = getFactorHeight(d.factorId, d.factorData, [this.min, this.max]); if (d.factorData == -1) { h = -1; } -- Gitblit v1.9.3