@antv/l7-component
Advanced tools
Comparing version 2.20.10 to 2.20.11
@@ -142,3 +142,3 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2"; | ||
value: function setOptions(option) { | ||
var isLayerChange = this.checkUpdateOption(option, ['layers']); | ||
var isLayerChange = this.checkUpdateOption(option, ['layers', 'multiple']); | ||
_get(_getPrototypeOf(LayerSwitch.prototype), "setOptions", this).call(this, option); | ||
@@ -155,2 +155,9 @@ if (isLayerChange) { | ||
var _this$controlOption$o; | ||
// TODO: 单选模式下,目前默认展示第一项,通过用户提供defaultValue展示默认选项的属性待开发 | ||
// 如果是单选模式,则只显示第一个图层 | ||
if (this.controlOption.multiple === false) { | ||
this.layers.forEach(function (layer, index) { | ||
index === 0 ? layer.show() : layer.hide(); | ||
}); | ||
} | ||
if (!((_this$controlOption$o = this.controlOption.options) !== null && _this$controlOption$o !== void 0 && _this$controlOption$o.length)) { | ||
@@ -160,4 +167,3 @@ this.controlOption.options = this.getLayerOptions(); | ||
if (!this.controlOption.defaultValue) { | ||
var defaultVal = this.controlOption.multiple ? this.getLayerVisible() : this.getLayerVisible()[0]; | ||
this.controlOption.defaultValue = defaultVal; | ||
this.controlOption.defaultValue = this.getLayerVisible(); | ||
} | ||
@@ -164,0 +170,0 @@ this.on('selectChange', this.onSelectChange); |
@@ -148,3 +148,3 @@ "use strict"; | ||
value: function setOptions(option) { | ||
var isLayerChange = this.checkUpdateOption(option, ['layers']); | ||
var isLayerChange = this.checkUpdateOption(option, ['layers', 'multiple']); | ||
(0, _get2.default)((0, _getPrototypeOf2.default)(LayerSwitch.prototype), "setOptions", this).call(this, option); | ||
@@ -161,2 +161,9 @@ if (isLayerChange) { | ||
var _this$controlOption$o; | ||
// TODO: 单选模式下,目前默认展示第一项,通过用户提供defaultValue展示默认选项的属性待开发 | ||
// 如果是单选模式,则只显示第一个图层 | ||
if (this.controlOption.multiple === false) { | ||
this.layers.forEach(function (layer, index) { | ||
index === 0 ? layer.show() : layer.hide(); | ||
}); | ||
} | ||
if (!((_this$controlOption$o = this.controlOption.options) !== null && _this$controlOption$o !== void 0 && _this$controlOption$o.length)) { | ||
@@ -166,4 +173,3 @@ this.controlOption.options = this.getLayerOptions(); | ||
if (!this.controlOption.defaultValue) { | ||
var defaultVal = this.controlOption.multiple ? this.getLayerVisible() : this.getLayerVisible()[0]; | ||
this.controlOption.defaultValue = defaultVal; | ||
this.controlOption.defaultValue = this.getLayerVisible(); | ||
} | ||
@@ -170,0 +176,0 @@ this.on('selectChange', this.onSelectChange); |
{ | ||
"name": "@antv/l7-component", | ||
"version": "2.20.10", | ||
"version": "2.20.11", | ||
"description": "", | ||
@@ -29,4 +29,4 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@antv/l7-core": "2.20.10", | ||
"@antv/l7-utils": "2.20.10", | ||
"@antv/l7-core": "2.20.11", | ||
"@antv/l7-utils": "2.20.11", | ||
"@babel/runtime": "^7.7.7", | ||
@@ -39,8 +39,8 @@ "eventemitter3": "^4.0.0", | ||
"devDependencies": { | ||
"@antv/l7-layers": "2.20.10", | ||
"@antv/l7-test-utils": "2.20.10", | ||
"@antv/l7-layers": "2.20.11", | ||
"@antv/l7-test-utils": "2.20.11", | ||
"gcoord": "^0.3.2", | ||
"less": "^4.1.3" | ||
}, | ||
"gitHead": "228c2056e3c5a7ffb334158dff12c79d55ed4ed7", | ||
"gitHead": "40b9c778934bbcef548f1060bddf6de988b75c00", | ||
"publishConfig": { | ||
@@ -47,0 +47,0 @@ "access": "public" |
596247
12185
+ Added@antv/l7-core@2.20.11(transitive)
+ Added@antv/l7-utils@2.20.11(transitive)
- Removed@antv/l7-core@2.20.10(transitive)
- Removed@antv/l7-utils@2.20.10(transitive)
Updated@antv/l7-core@2.20.11
Updated@antv/l7-utils@2.20.11