@antv/l7-component 2.21.0 → 2.21.1

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.
@@ -55,7 +55,6 @@ var Swipe = /*#__PURE__*/function (_Control) {
55
55
  });
56
56
  // fallthrough
57
57
  }
58
-
59
58
  case 'mousemove':
60
59
  case 'touchmove':
61
60
  {
@@ -121,12 +120,10 @@ var Swipe = /*#__PURE__*/function (_Control) {
121
120
  }
122
121
  });
123
122
  _defineProperty(_assertThisInitialized(_this), "getMaskLayer", function () {
123
+ console.log(_this.getMaskGeoData());
124
124
  return new PolygonLayer({
125
125
  visible: false
126
- }).source({
127
- type: 'FeatureCollection',
128
- features: []
129
- }).shape('fill').color('red').style({
126
+ }).source(_this.getMaskGeoData()).shape('fill').color('red').style({
130
127
  opacity: 0.1
131
128
  });
132
129
  });
@@ -204,17 +201,16 @@ var Swipe = /*#__PURE__*/function (_Control) {
204
201
  // this.scene.getSceneContainer().appendChild(this.container);
205
202
  this.mapsService.getMarkerContainer().appendChild(this.container);
206
203
  this.maskLayer = this.getMaskLayer();
207
- this.updateMask();
208
204
  this.registerEvent();
209
205
 
210
- // 给图层挂载掩膜
211
- this.addMaskToLayers(layers, false);
212
- this.addMaskToLayers(rightLayers, true);
213
-
214
206
  // 添加掩膜图层到 scene
215
207
  var layerContainer = createLayerContainer(sceneContainer);
216
208
  this.maskLayer.setContainer(layerContainer);
217
209
  this.scene.addLayer(this.maskLayer);
210
+
211
+ // 给图层挂载掩膜
212
+ this.addMaskToLayers(layers, false);
213
+ this.addMaskToLayers(rightLayers, true);
218
214
  this.emit('add', this);
219
215
  return this;
220
216
  }
@@ -63,7 +63,6 @@ var MarkerLayer = /*#__PURE__*/function (_EventEmitter) {
63
63
  this.mapsService.on('camerachange', this.update); // amap1.x 更新事件
64
64
  this.mapsService.on('viewchange', this.update); // amap2.0 更新事件
65
65
  }
66
-
67
66
  this.mapsService.on('camerachange', this.setContainerSize.bind(this)); // amap1.x 更新事件
68
67
  this.mapsService.on('viewchange', this.setContainerSize.bind(this)); // amap2.0 更新事件
69
68
  this.addMarkers();
package/es/marker.d.ts CHANGED
@@ -3,10 +3,8 @@ import { anchorType } from '@antv/l7-utils';
3
3
  import { EventEmitter } from 'eventemitter3';
4
4
  export default class Marker extends EventEmitter {
5
5
  private markerOption;
6
- private defaultMarker;
7
6
  private popup;
8
7
  private mapsService;
9
- private sceneSerive;
10
8
  private lngLat;
11
9
  private scene;
12
10
  private added;
package/es/marker.js CHANGED
@@ -100,16 +100,11 @@ var Marker = /*#__PURE__*/function (_EventEmitter) {
100
100
  }, {
101
101
  key: "addTo",
102
102
  value: function addTo(scene) {
103
- // this.remove();
104
103
  this.scene = scene;
105
104
  this.mapsService = scene.mapService;
106
- this.sceneSerive = scene.sceneService;
107
105
  var element = this.markerOption.element;
108
- // this.sceneSerive.getSceneContainer().appendChild(element as HTMLElement);
109
106
  this.mapsService.getMarkerContainer().appendChild(element);
110
107
  this.registerMarkerEvent(element);
111
- //天地图仅监听zoomchange 不注册camerachane,对于平移,在mapsService中实现
112
- // this.mapsService.on('zoomchange', this.updatePositionWhenZoom);
113
108
  this.mapsService.on('camerachange', this.update); // 注册高德1.x 的地图事件监听
114
109
  this.update();
115
110
  this.updateDraggable();
@@ -124,7 +119,6 @@ var Marker = /*#__PURE__*/function (_EventEmitter) {
124
119
  this.mapsService.off('click', this.onMapClick);
125
120
  this.mapsService.off('move', this.update);
126
121
  this.mapsService.off('moveend', this.update);
127
- // this.mapsService.off('zoomchange', this.update);
128
122
  this.mapsService.off('camerachange', this.update);
129
123
  }
130
124
  this.unRegisterMarkerEvent();
@@ -418,7 +412,6 @@ var Marker = /*#__PURE__*/function (_EventEmitter) {
418
412
  color = _this$markerOption4.color,
419
413
  anchor = _this$markerOption4.anchor;
420
414
  if (!element) {
421
- this.defaultMarker = true;
422
415
  element = DOM.create('div');
423
416
  this.markerOption.element = element;
424
417
  var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
@@ -61,7 +61,6 @@ var Swipe = exports.default = exports.Swipe = /*#__PURE__*/function (_Control) {
61
61
  });
62
62
  // fallthrough
63
63
  }
64
-
65
64
  case 'mousemove':
66
65
  case 'touchmove':
67
66
  {
@@ -127,12 +126,10 @@ var Swipe = exports.default = exports.Swipe = /*#__PURE__*/function (_Control) {
127
126
  }
128
127
  });
129
128
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getMaskLayer", function () {
129
+ console.log(_this.getMaskGeoData());
130
130
  return new _l7Layers.PolygonLayer({
131
131
  visible: false
132
- }).source({
133
- type: 'FeatureCollection',
134
- features: []
135
- }).shape('fill').color('red').style({
132
+ }).source(_this.getMaskGeoData()).shape('fill').color('red').style({
136
133
  opacity: 0.1
137
134
  });
138
135
  });
@@ -210,17 +207,16 @@ var Swipe = exports.default = exports.Swipe = /*#__PURE__*/function (_Control) {
210
207
  // this.scene.getSceneContainer().appendChild(this.container);
211
208
  this.mapsService.getMarkerContainer().appendChild(this.container);
212
209
  this.maskLayer = this.getMaskLayer();
213
- this.updateMask();
214
210
  this.registerEvent();
215
211
 
216
- // 给图层挂载掩膜
217
- this.addMaskToLayers(layers, false);
218
- this.addMaskToLayers(rightLayers, true);
219
-
220
212
  // 添加掩膜图层到 scene
221
213
  var layerContainer = (0, _l7Core.createLayerContainer)(sceneContainer);
222
214
  this.maskLayer.setContainer(layerContainer);
223
215
  this.scene.addLayer(this.maskLayer);
216
+
217
+ // 给图层挂载掩膜
218
+ this.addMaskToLayers(layers, false);
219
+ this.addMaskToLayers(rightLayers, true);
224
220
  this.emit('add', this);
225
221
  return this;
226
222
  }
@@ -69,7 +69,6 @@ var MarkerLayer = exports.default = /*#__PURE__*/function (_EventEmitter) {
69
69
  this.mapsService.on('camerachange', this.update); // amap1.x 更新事件
70
70
  this.mapsService.on('viewchange', this.update); // amap2.0 更新事件
71
71
  }
72
-
73
72
  this.mapsService.on('camerachange', this.setContainerSize.bind(this)); // amap1.x 更新事件
74
73
  this.mapsService.on('viewchange', this.setContainerSize.bind(this)); // amap2.0 更新事件
75
74
  this.addMarkers();
package/lib/marker.js CHANGED
@@ -106,16 +106,11 @@ var Marker = exports.default = /*#__PURE__*/function (_EventEmitter) {
106
106
  }, {
107
107
  key: "addTo",
108
108
  value: function addTo(scene) {
109
- // this.remove();
110
109
  this.scene = scene;
111
110
  this.mapsService = scene.mapService;
112
- this.sceneSerive = scene.sceneService;
113
111
  var element = this.markerOption.element;
114
- // this.sceneSerive.getSceneContainer().appendChild(element as HTMLElement);
115
112
  this.mapsService.getMarkerContainer().appendChild(element);
116
113
  this.registerMarkerEvent(element);
117
- //天地图仅监听zoomchange 不注册camerachane,对于平移,在mapsService中实现
118
- // this.mapsService.on('zoomchange', this.updatePositionWhenZoom);
119
114
  this.mapsService.on('camerachange', this.update); // 注册高德1.x 的地图事件监听
120
115
  this.update();
121
116
  this.updateDraggable();
@@ -130,7 +125,6 @@ var Marker = exports.default = /*#__PURE__*/function (_EventEmitter) {
130
125
  this.mapsService.off('click', this.onMapClick);
131
126
  this.mapsService.off('move', this.update);
132
127
  this.mapsService.off('moveend', this.update);
133
- // this.mapsService.off('zoomchange', this.update);
134
128
  this.mapsService.off('camerachange', this.update);
135
129
  }
136
130
  this.unRegisterMarkerEvent();
@@ -424,7 +418,6 @@ var Marker = exports.default = /*#__PURE__*/function (_EventEmitter) {
424
418
  color = _this$markerOption4.color,
425
419
  anchor = _this$markerOption4.anchor;
426
420
  if (!element) {
427
- this.defaultMarker = true;
428
421
  element = _l7Utils.DOM.create('div');
429
422
  this.markerOption.element = element;
430
423
  var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/l7-component",
3
- "version": "2.21.0",
3
+ "version": "2.21.1",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "lzxue",
@@ -26,20 +26,20 @@
26
26
  "watch": "BABEL_ENV=cjs babel src --watch --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments"
27
27
  },
28
28
  "dependencies": {
29
- "@antv/l7-core": "2.21.0",
30
- "@antv/l7-utils": "2.21.0",
29
+ "@antv/l7-core": "2.21.1",
30
+ "@antv/l7-utils": "2.21.1",
31
31
  "@babel/runtime": "^7.7.7",
32
32
  "eventemitter3": "^4.0.0",
33
33
  "supercluster": "^7.0.0"
34
34
  },
35
35
  "devDependencies": {
36
- "@antv/l7-layers": "2.21.0",
37
- "@antv/l7-test-utils": "2.21.0",
36
+ "@antv/l7-layers": "2.21.1",
37
+ "@antv/l7-test-utils": "2.21.1",
38
38
  "gcoord": "^0.3.2",
39
39
  "less": "^4.1.3"
40
40
  },
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
- "gitHead": "7fa1b00b5262c98bb4cceef4eaf87a7b10af7e29"
44
+ "gitHead": "1e0d2e5920f479f77095a2c5eddda8a8d7ac9e0f"
45
45
  }