@antv/l7-component 2.9.37-alpha.3 → 2.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,8 +11,6 @@ export default class LayerSwitch extends SelectControl<ILayerSwitchOption> {
11
11
  getLayerOptions(): ControlOptionItem[];
12
12
  setOptions(option: Partial<ILayerSwitchOption>): void;
13
13
  onAdd(): HTMLElement;
14
- bindLayerVisibleCallback: () => void;
15
- unbindLayerVisibleCallback: () => void;
16
14
  onRemove(): void;
17
15
  protected onLayerChange: () => void;
18
16
  protected onLayerVisibleChane: () => void;
@@ -32,20 +32,6 @@ var LayerSwitch = /*#__PURE__*/function (_SelectControl) {
32
32
 
33
33
  _this = _super.call.apply(_super, [this].concat(args));
34
34
 
35
- _defineProperty(_assertThisInitialized(_this), "bindLayerVisibleCallback", function () {
36
- _this.layers.forEach(function (layer) {
37
- layer.on('show', _this.onLayerVisibleChane);
38
- layer.on('hide', _this.onLayerVisibleChane);
39
- });
40
- });
41
-
42
- _defineProperty(_assertThisInitialized(_this), "unbindLayerVisibleCallback", function () {
43
- _this.layers.forEach(function (layer) {
44
- layer.off('show', _this.onLayerVisibleChane);
45
- layer.off('hide', _this.onLayerVisibleChane);
46
- });
47
- });
48
-
49
35
  _defineProperty(_assertThisInitialized(_this), "onLayerChange", function () {
50
36
  var _this$controlOption$l;
51
37
 
@@ -142,14 +128,9 @@ var LayerSwitch = /*#__PURE__*/function (_SelectControl) {
142
128
  value: function setOptions(option) {
143
129
  var isLayerChange = this.checkUpdateOption(option, ['layers']);
144
130
 
145
- if (isLayerChange) {
146
- this.unbindLayerVisibleCallback();
147
- }
148
-
149
131
  _get(_getPrototypeOf(LayerSwitch.prototype), "setOptions", this).call(this, option);
150
132
 
151
133
  if (isLayerChange) {
152
- this.bindLayerVisibleCallback();
153
134
  this.selectValue = this.getLayerVisible();
154
135
  this.controlOption.options = this.getLayerOptions();
155
136
  this.popper.setContent(this.getPopperContent(this.controlOption.options));
@@ -170,7 +151,6 @@ var LayerSwitch = /*#__PURE__*/function (_SelectControl) {
170
151
 
171
152
  this.on('selectChange', this.onSelectChange);
172
153
  this.layerService.on('layerChange', this.onLayerChange);
173
- this.bindLayerVisibleCallback();
174
154
  return _get(_getPrototypeOf(LayerSwitch.prototype), "onAdd", this).call(this);
175
155
  }
176
156
  }, {
@@ -178,7 +158,6 @@ var LayerSwitch = /*#__PURE__*/function (_SelectControl) {
178
158
  value: function onRemove() {
179
159
  this.off('selectChange', this.onSelectChange);
180
160
  this.layerService.off('layerChange', this.onLayerChange);
181
- this.unbindLayerVisibleCallback();
182
161
  }
183
162
  }, {
184
163
  key: "getIsMultiple",
@@ -48,18 +48,6 @@ var LayerSwitch = /*#__PURE__*/function (_SelectControl) {
48
48
  }
49
49
 
50
50
  _this = _super.call.apply(_super, [this].concat(args));
51
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "bindLayerVisibleCallback", function () {
52
- _this.layers.forEach(function (layer) {
53
- layer.on('show', _this.onLayerVisibleChane);
54
- layer.on('hide', _this.onLayerVisibleChane);
55
- });
56
- });
57
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "unbindLayerVisibleCallback", function () {
58
- _this.layers.forEach(function (layer) {
59
- layer.off('show', _this.onLayerVisibleChane);
60
- layer.off('hide', _this.onLayerVisibleChane);
61
- });
62
- });
63
51
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onLayerChange", function () {
64
52
  var _this$controlOption$l;
65
53
 
@@ -152,15 +140,9 @@ var LayerSwitch = /*#__PURE__*/function (_SelectControl) {
152
140
  key: "setOptions",
153
141
  value: function setOptions(option) {
154
142
  var isLayerChange = this.checkUpdateOption(option, ['layers']);
155
-
156
- if (isLayerChange) {
157
- this.unbindLayerVisibleCallback();
158
- }
159
-
160
143
  (0, _get2.default)((0, _getPrototypeOf2.default)(LayerSwitch.prototype), "setOptions", this).call(this, option);
161
144
 
162
145
  if (isLayerChange) {
163
- this.bindLayerVisibleCallback();
164
146
  this.selectValue = this.getLayerVisible();
165
147
  this.controlOption.options = this.getLayerOptions();
166
148
  this.popper.setContent(this.getPopperContent(this.controlOption.options));
@@ -181,7 +163,6 @@ var LayerSwitch = /*#__PURE__*/function (_SelectControl) {
181
163
 
182
164
  this.on('selectChange', this.onSelectChange);
183
165
  this.layerService.on('layerChange', this.onLayerChange);
184
- this.bindLayerVisibleCallback();
185
166
  return (0, _get2.default)((0, _getPrototypeOf2.default)(LayerSwitch.prototype), "onAdd", this).call(this);
186
167
  }
187
168
  }, {
@@ -189,7 +170,6 @@ var LayerSwitch = /*#__PURE__*/function (_SelectControl) {
189
170
  value: function onRemove() {
190
171
  this.off('selectChange', this.onSelectChange);
191
172
  this.layerService.off('layerChange', this.onLayerChange);
192
- this.unbindLayerVisibleCallback();
193
173
  }
194
174
  }, {
195
175
  key: "getIsMultiple",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/l7-component",
3
- "version": "2.9.37-alpha.3",
3
+ "version": "2.10.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -26,8 +26,8 @@
26
26
  "author": "lzxue",
27
27
  "license": "ISC",
28
28
  "dependencies": {
29
- "@antv/l7-core": "2.9.37-alpha.3",
30
- "@antv/l7-utils": "2.9.37-alpha.3",
29
+ "@antv/l7-core": "2.10.0",
30
+ "@antv/l7-utils": "2.10.0",
31
31
  "@babel/runtime": "^7.7.7",
32
32
  "eventemitter3": "^4.0.0",
33
33
  "inversify": "^5.0.1",
@@ -36,11 +36,11 @@
36
36
  "supercluster": "^7.0.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@antv/l7-test-utils": "2.9.37-alpha.3",
39
+ "@antv/l7-test-utils": "2.10.0",
40
40
  "gcoord": "^0.3.2",
41
41
  "less": "^4.1.3"
42
42
  },
43
- "gitHead": "92f97e637cdeb05895909006e81ba45131154bf8",
43
+ "gitHead": "3a18f28d0c92b49230f1fe3c1acd8c5db820bd63",
44
44
  "publishConfig": {
45
45
  "access": "public"
46
46
  }