@antv/l7-component 2.20.20 → 2.21.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.
- package/es/control/baseControl/control.d.ts +3 -4
- package/es/control/baseControl/control.js +7 -7
- package/es/control/swipe.d.ts +2 -3
- package/es/control/swipe.js +8 -8
- package/es/marker-layer.d.ts +2 -3
- package/es/marker-layer.js +1 -2
- package/es/marker.d.ts +2 -3
- package/es/marker.js +5 -6
- package/es/popup/layerPopup.d.ts +2 -3
- package/es/popup/popup.d.ts +3 -4
- package/es/popup/popup.js +7 -14
- package/es/utils/popper.js +0 -1
- package/lib/control/baseControl/control.js +6 -6
- package/lib/control/swipe.js +7 -7
- package/lib/marker-layer.js +1 -2
- package/lib/marker.js +3 -5
- package/lib/popup/popup.js +6 -13
- package/lib/utils/popper.js +0 -1
- package/package.json +15 -17
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { IControl, IControlService, IGlobalConfigService, ILayerService, IMapService, IRendererService, ISceneService, PositionName } from '@antv/l7-core';
|
|
1
|
+
import type { IControl, IControlService, IGlobalConfigService, ILayerService, IMapService, IRendererService, ISceneService, L7Container, PositionName } from '@antv/l7-core';
|
|
2
2
|
import { PositionType } from '@antv/l7-core';
|
|
3
3
|
import EventEmitter from 'eventemitter3';
|
|
4
|
-
import type { Container } from 'inversify';
|
|
5
4
|
import type { ControlEvent } from '../../interface';
|
|
6
5
|
export { PositionType } from '@antv/l7-core';
|
|
7
6
|
export { Control };
|
|
@@ -31,7 +30,7 @@ export default class Control<O extends IControlOption = IControlOption> extends
|
|
|
31
30
|
* @protected
|
|
32
31
|
*/
|
|
33
32
|
protected isShow: boolean;
|
|
34
|
-
protected sceneContainer:
|
|
33
|
+
protected sceneContainer: L7Container;
|
|
35
34
|
protected scene: ISceneService;
|
|
36
35
|
protected mapsService: IMapService;
|
|
37
36
|
protected renderService: IRendererService;
|
|
@@ -49,7 +48,7 @@ export default class Control<O extends IControlOption = IControlOption> extends
|
|
|
49
48
|
* 当 Control 被添加至 Scene 中,被 controlService 调用的方法
|
|
50
49
|
* @param sceneContainer
|
|
51
50
|
*/
|
|
52
|
-
addTo(sceneContainer:
|
|
51
|
+
addTo(sceneContainer: L7Container): this;
|
|
53
52
|
/**
|
|
54
53
|
* 将控件移除时触发
|
|
55
54
|
*/
|
|
@@ -8,7 +8,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
9
9
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
10
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
11
|
-
import { PositionType
|
|
11
|
+
import { PositionType } from '@antv/l7-core';
|
|
12
12
|
import { DOM } from '@antv/l7-utils';
|
|
13
13
|
import EventEmitter from 'eventemitter3';
|
|
14
14
|
export { PositionType } from '@antv/l7-core';
|
|
@@ -80,12 +80,12 @@ var Control = /*#__PURE__*/function (_ref) {
|
|
|
80
80
|
key: "addTo",
|
|
81
81
|
value: function addTo(sceneContainer) {
|
|
82
82
|
// 初始化各个 Service 实例
|
|
83
|
-
this.mapsService = sceneContainer.
|
|
84
|
-
this.renderService = sceneContainer.
|
|
85
|
-
this.layerService = sceneContainer.
|
|
86
|
-
this.controlService = sceneContainer.
|
|
87
|
-
this.configService = sceneContainer.
|
|
88
|
-
this.scene = sceneContainer.
|
|
83
|
+
this.mapsService = sceneContainer.mapService;
|
|
84
|
+
this.renderService = sceneContainer.rendererService;
|
|
85
|
+
this.layerService = sceneContainer.layerService;
|
|
86
|
+
this.controlService = sceneContainer.controlService;
|
|
87
|
+
this.configService = sceneContainer.globalConfigService;
|
|
88
|
+
this.scene = sceneContainer.sceneService;
|
|
89
89
|
this.sceneContainer = sceneContainer;
|
|
90
90
|
this.isShow = true;
|
|
91
91
|
|
package/es/control/swipe.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { ILayer } from '@antv/l7-core';
|
|
2
|
-
import type { Container } from 'inversify';
|
|
1
|
+
import type { ILayer, L7Container } from '@antv/l7-core';
|
|
3
2
|
import type { IControlOption } from './baseControl';
|
|
4
3
|
import { Control } from './baseControl';
|
|
5
4
|
export interface ISwipeControlOption extends IControlOption {
|
|
@@ -32,7 +31,7 @@ export default class Swipe extends Control<ISwipeControlOption> {
|
|
|
32
31
|
private maskLayer;
|
|
33
32
|
getDefault(): ISwipeControlOption;
|
|
34
33
|
onAdd(): HTMLElement;
|
|
35
|
-
addTo(sceneContainer:
|
|
34
|
+
addTo(sceneContainer: L7Container): this;
|
|
36
35
|
onRemove(): void;
|
|
37
36
|
show(): void;
|
|
38
37
|
hide(): void;
|
package/es/control/swipe.js
CHANGED
|
@@ -11,7 +11,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
|
11
11
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
12
12
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
13
13
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
14
|
-
import {
|
|
14
|
+
import { createLayerContainer } from '@antv/l7-core';
|
|
15
15
|
import { PolygonLayer } from '@antv/l7-layers';
|
|
16
16
|
import { DOM } from '@antv/l7-utils';
|
|
17
17
|
import { Control } from "./baseControl";
|
|
@@ -177,12 +177,12 @@ var Swipe = /*#__PURE__*/function (_Control) {
|
|
|
177
177
|
key: "addTo",
|
|
178
178
|
value: function addTo(sceneContainer) {
|
|
179
179
|
// 初始化各个 Service 实例
|
|
180
|
-
this.mapsService = sceneContainer.
|
|
181
|
-
this.renderService = sceneContainer.
|
|
182
|
-
this.layerService = sceneContainer.
|
|
183
|
-
this.controlService = sceneContainer.
|
|
184
|
-
this.configService = sceneContainer.
|
|
185
|
-
this.scene = sceneContainer.
|
|
180
|
+
this.mapsService = sceneContainer.mapService;
|
|
181
|
+
this.renderService = sceneContainer.rendererService;
|
|
182
|
+
this.layerService = sceneContainer.layerService;
|
|
183
|
+
this.controlService = sceneContainer.controlService;
|
|
184
|
+
this.configService = sceneContainer.globalConfigService;
|
|
185
|
+
this.scene = sceneContainer.sceneService;
|
|
186
186
|
this.sceneContainer = sceneContainer;
|
|
187
187
|
this.isShow = true;
|
|
188
188
|
|
|
@@ -213,7 +213,7 @@ var Swipe = /*#__PURE__*/function (_Control) {
|
|
|
213
213
|
|
|
214
214
|
// 添加掩膜图层到 scene
|
|
215
215
|
var layerContainer = createLayerContainer(sceneContainer);
|
|
216
|
-
this.maskLayer.setContainer(layerContainer
|
|
216
|
+
this.maskLayer.setContainer(layerContainer);
|
|
217
217
|
this.scene.addLayer(this.maskLayer);
|
|
218
218
|
this.emit('add', this);
|
|
219
219
|
return this;
|
package/es/marker-layer.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { IMarker } from '@antv/l7-core';
|
|
1
|
+
import type { IMarker, L7Container } from '@antv/l7-core';
|
|
2
2
|
import { EventEmitter } from 'eventemitter3';
|
|
3
|
-
import type { Container } from 'inversify';
|
|
4
3
|
import type { IMarkerLayerOption } from './interface';
|
|
5
4
|
export default class MarkerLayer extends EventEmitter {
|
|
6
5
|
private markers;
|
|
@@ -26,7 +25,7 @@ export default class MarkerLayer extends EventEmitter {
|
|
|
26
25
|
className: string;
|
|
27
26
|
};
|
|
28
27
|
};
|
|
29
|
-
addTo(scene:
|
|
28
|
+
addTo(scene: L7Container): this;
|
|
30
29
|
private setContainerSize;
|
|
31
30
|
private getContainerSize;
|
|
32
31
|
addMarker(marker: IMarker): void;
|
package/es/marker-layer.js
CHANGED
|
@@ -8,7 +8,6 @@ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
9
9
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
10
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
11
|
-
import { TYPES } from '@antv/l7-core';
|
|
12
11
|
import { DOM, Satistics, bindAll, boundsContains, lodashUtil, padBounds } from '@antv/l7-utils';
|
|
13
12
|
import { EventEmitter } from 'eventemitter3';
|
|
14
13
|
// @ts-ignore
|
|
@@ -56,7 +55,7 @@ var MarkerLayer = /*#__PURE__*/function (_EventEmitter) {
|
|
|
56
55
|
value: function addTo(scene) {
|
|
57
56
|
// this.remove();
|
|
58
57
|
this.scene = scene;
|
|
59
|
-
this.mapsService = scene.
|
|
58
|
+
this.mapsService = scene.mapService;
|
|
60
59
|
if (this.markerLayerOption.cluster) {
|
|
61
60
|
this.initCluster();
|
|
62
61
|
this.update();
|
package/es/marker.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { ILngLat, IMarkerContainerAndBounds, IMarkerOption, IPoint, IPopup } from '@antv/l7-core';
|
|
1
|
+
import type { ILngLat, IMarkerContainerAndBounds, IMarkerOption, IPoint, IPopup, L7Container } from '@antv/l7-core';
|
|
2
2
|
import { anchorType } from '@antv/l7-utils';
|
|
3
3
|
import { EventEmitter } from 'eventemitter3';
|
|
4
|
-
import type { Container } from 'inversify';
|
|
5
4
|
export default class Marker extends EventEmitter {
|
|
6
5
|
private markerOption;
|
|
7
6
|
private defaultMarker;
|
|
@@ -21,7 +20,7 @@ export default class Marker extends EventEmitter {
|
|
|
21
20
|
color: string;
|
|
22
21
|
draggable: boolean;
|
|
23
22
|
};
|
|
24
|
-
addTo(scene:
|
|
23
|
+
addTo(scene: L7Container): this;
|
|
25
24
|
remove(): this;
|
|
26
25
|
setLnglat(lngLat: ILngLat | IPoint): this;
|
|
27
26
|
getLnglat(): ILngLat;
|
package/es/marker.js
CHANGED
|
@@ -8,9 +8,9 @@ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
9
9
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
10
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
11
|
-
import {
|
|
12
|
-
import { DOM, anchorType, applyAnchorClass, bindAll, isPC, anchorTranslate } from '@antv/l7-utils';
|
|
11
|
+
import { DOM, anchorTranslate, anchorType, applyAnchorClass, bindAll, isPC } from '@antv/l7-utils';
|
|
13
12
|
import { EventEmitter } from 'eventemitter3';
|
|
13
|
+
|
|
14
14
|
// marker 支持 dragger 未完成
|
|
15
15
|
var Marker = /*#__PURE__*/function (_EventEmitter) {
|
|
16
16
|
_inherits(Marker, _EventEmitter);
|
|
@@ -58,7 +58,7 @@ var Marker = /*#__PURE__*/function (_EventEmitter) {
|
|
|
58
58
|
_this.preLngLat = e.lnglat;
|
|
59
59
|
_this.emit('dragging', newLngLat);
|
|
60
60
|
});
|
|
61
|
-
_defineProperty(_assertThisInitialized(_this), "onMarkerDragEnd", function (
|
|
61
|
+
_defineProperty(_assertThisInitialized(_this), "onMarkerDragEnd", function () {
|
|
62
62
|
_this.mapsService.setMapStatus({
|
|
63
63
|
dragEnable: true,
|
|
64
64
|
zoomEnable: true
|
|
@@ -102,8 +102,8 @@ var Marker = /*#__PURE__*/function (_EventEmitter) {
|
|
|
102
102
|
value: function addTo(scene) {
|
|
103
103
|
// this.remove();
|
|
104
104
|
this.scene = scene;
|
|
105
|
-
this.mapsService = scene.
|
|
106
|
-
this.sceneSerive = scene.
|
|
105
|
+
this.mapsService = scene.mapService;
|
|
106
|
+
this.sceneSerive = scene.sceneService;
|
|
107
107
|
var element = this.markerOption.element;
|
|
108
108
|
// this.sceneSerive.getSceneContainer().appendChild(element as HTMLElement);
|
|
109
109
|
this.mapsService.getMarkerContainer().appendChild(element);
|
|
@@ -407,7 +407,6 @@ var Marker = /*#__PURE__*/function (_EventEmitter) {
|
|
|
407
407
|
}
|
|
408
408
|
element.style.left = pos.x + offsets[0] + 'px';
|
|
409
409
|
element.style.top = pos.y - offsets[1] + 'px';
|
|
410
|
-
console.log(element.style.left);
|
|
411
410
|
}
|
|
412
411
|
}
|
|
413
412
|
}, {
|
package/es/popup/layerPopup.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { ILayer, IPopupOption } from '@antv/l7-core';
|
|
1
|
+
import type { ILayer, IPopupOption, L7Container } from '@antv/l7-core';
|
|
2
2
|
import { DOM } from '@antv/l7-utils';
|
|
3
|
-
import type { Container } from 'inversify';
|
|
4
3
|
import Popup from './popup';
|
|
5
4
|
type ElementType = DOM.ElementType;
|
|
6
5
|
export type LayerField = {
|
|
@@ -46,7 +45,7 @@ export default class LayerPopup extends Popup<ILayerPopupOption> {
|
|
|
46
45
|
featureId: number;
|
|
47
46
|
};
|
|
48
47
|
protected get layerConfigItems(): LayerPopupConfigItem[];
|
|
49
|
-
addTo(scene:
|
|
48
|
+
addTo(scene: L7Container): this;
|
|
50
49
|
remove(): this;
|
|
51
50
|
setOptions(option: Partial<ILayerPopupOption>): this;
|
|
52
51
|
protected getDefault(option: Partial<ILayerPopupOption>): ILayerPopupOption;
|
package/es/popup/popup.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { ILayerService, ILngLat, IMapService, IPopup, IPopupOption, ISceneService } from '@antv/l7-core';
|
|
1
|
+
import type { ILayerService, ILngLat, IMapService, IPopup, IPopupOption, ISceneService, L7Container } from '@antv/l7-core';
|
|
2
2
|
import { DOM } from '@antv/l7-utils';
|
|
3
3
|
import { EventEmitter } from 'eventemitter3';
|
|
4
|
-
import type { Container } from 'inversify';
|
|
5
4
|
type ElementType = DOM.ElementType;
|
|
6
5
|
export { Popup };
|
|
7
6
|
export default class Popup<O extends IPopupOption = IPopupOption> extends EventEmitter implements IPopup {
|
|
@@ -13,7 +12,7 @@ export default class Popup<O extends IPopupOption = IPopupOption> extends EventE
|
|
|
13
12
|
protected mapsService: IMapService;
|
|
14
13
|
protected sceneService: ISceneService;
|
|
15
14
|
protected layerService: ILayerService;
|
|
16
|
-
protected scene:
|
|
15
|
+
protected scene: L7Container;
|
|
17
16
|
/**
|
|
18
17
|
* 关闭按钮对应的 DOM
|
|
19
18
|
* @protected
|
|
@@ -53,7 +52,7 @@ export default class Popup<O extends IPopupOption = IPopupOption> extends EventE
|
|
|
53
52
|
protected set lngLat(newLngLat: ILngLat);
|
|
54
53
|
constructor(cfg?: Partial<O>);
|
|
55
54
|
getIsShow(): boolean;
|
|
56
|
-
addTo(scene:
|
|
55
|
+
addTo(scene: L7Container): this;
|
|
57
56
|
remove(): this | undefined;
|
|
58
57
|
/**
|
|
59
58
|
* 获取 option 配置
|
package/es/popup/popup.js
CHANGED
|
@@ -8,8 +8,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
9
9
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
10
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
11
|
-
import {
|
|
12
|
-
import { anchorTranslate, anchorType, applyAnchorClass, DOM } from '@antv/l7-utils';
|
|
11
|
+
import { DOM, anchorTranslate, anchorType, applyAnchorClass } from '@antv/l7-utils';
|
|
13
12
|
import { EventEmitter } from 'eventemitter3';
|
|
14
13
|
import { createL7Icon } from "../utils/icon";
|
|
15
14
|
export { Popup };
|
|
@@ -84,12 +83,6 @@ var Popup = /*#__PURE__*/function (_EventEmitter) {
|
|
|
84
83
|
if (!_this.mapsService || _this.popupOption.followCursor) {
|
|
85
84
|
return;
|
|
86
85
|
}
|
|
87
|
-
var _this$lngLat2 = _this.lngLat,
|
|
88
|
-
lng = _this$lngLat2.lng,
|
|
89
|
-
lat = _this$lngLat2.lat;
|
|
90
|
-
var _this$mapsService$lng2 = _this.mapsService.lngLatToContainer([lng, lat]),
|
|
91
|
-
x = _this$mapsService$lng2.x,
|
|
92
|
-
y = _this$mapsService$lng2.y;
|
|
93
86
|
var map = ev.map;
|
|
94
87
|
var viewHalf = map.getSize();
|
|
95
88
|
viewHalf.x = viewHalf.x / 2;
|
|
@@ -195,9 +188,9 @@ var Popup = /*#__PURE__*/function (_EventEmitter) {
|
|
|
195
188
|
}, {
|
|
196
189
|
key: "addTo",
|
|
197
190
|
value: function addTo(scene) {
|
|
198
|
-
this.mapsService = scene.
|
|
199
|
-
this.sceneService = scene.
|
|
200
|
-
this.layerService = scene.
|
|
191
|
+
this.mapsService = scene.mapService;
|
|
192
|
+
this.sceneService = scene.sceneService;
|
|
193
|
+
this.layerService = scene.layerService;
|
|
201
194
|
//天地图仅监听zoomchange 不注册camerachane,对于平移,在mapsService中实现
|
|
202
195
|
// this.mapsService.on('zoomchange', this.updateWhenZoom);
|
|
203
196
|
this.mapsService.on('camerachange', this.update);
|
|
@@ -390,9 +383,9 @@ var Popup = /*#__PURE__*/function (_EventEmitter) {
|
|
|
390
383
|
}, {
|
|
391
384
|
key: "panToPopup",
|
|
392
385
|
value: function panToPopup() {
|
|
393
|
-
var _this$
|
|
394
|
-
lng = _this$
|
|
395
|
-
lat = _this$
|
|
386
|
+
var _this$lngLat2 = this.lngLat,
|
|
387
|
+
lng = _this$lngLat2.lng,
|
|
388
|
+
lat = _this$lngLat2.lat;
|
|
396
389
|
if (this.popupOption.autoPan) {
|
|
397
390
|
this.mapsService.panTo([lng, lat]);
|
|
398
391
|
}
|
package/es/utils/popper.js
CHANGED
|
@@ -48,7 +48,6 @@ export var Popper = /*#__PURE__*/function (_EventEmitter) {
|
|
|
48
48
|
DOM.removeClass(_this.popperDOM, 'l7-popper-hide');
|
|
49
49
|
_this.isShow = true;
|
|
50
50
|
if (_this.option.unique) {
|
|
51
|
-
// console.log(Popper.conflictPopperList.length);
|
|
52
51
|
Popper.conflictPopperList.forEach(function (popper) {
|
|
53
52
|
if (popper !== _assertThisInitialized(_this) && popper.isShow) {
|
|
54
53
|
popper.hide();
|
|
@@ -92,12 +92,12 @@ var Control = exports.default = exports.Control = /*#__PURE__*/function (_ref) {
|
|
|
92
92
|
key: "addTo",
|
|
93
93
|
value: function addTo(sceneContainer) {
|
|
94
94
|
// 初始化各个 Service 实例
|
|
95
|
-
this.mapsService = sceneContainer.
|
|
96
|
-
this.renderService = sceneContainer.
|
|
97
|
-
this.layerService = sceneContainer.
|
|
98
|
-
this.controlService = sceneContainer.
|
|
99
|
-
this.configService = sceneContainer.
|
|
100
|
-
this.scene = sceneContainer.
|
|
95
|
+
this.mapsService = sceneContainer.mapService;
|
|
96
|
+
this.renderService = sceneContainer.rendererService;
|
|
97
|
+
this.layerService = sceneContainer.layerService;
|
|
98
|
+
this.controlService = sceneContainer.controlService;
|
|
99
|
+
this.configService = sceneContainer.globalConfigService;
|
|
100
|
+
this.scene = sceneContainer.sceneService;
|
|
101
101
|
this.sceneContainer = sceneContainer;
|
|
102
102
|
this.isShow = true;
|
|
103
103
|
|
package/lib/control/swipe.js
CHANGED
|
@@ -183,12 +183,12 @@ var Swipe = exports.default = exports.Swipe = /*#__PURE__*/function (_Control) {
|
|
|
183
183
|
key: "addTo",
|
|
184
184
|
value: function addTo(sceneContainer) {
|
|
185
185
|
// 初始化各个 Service 实例
|
|
186
|
-
this.mapsService = sceneContainer.
|
|
187
|
-
this.renderService = sceneContainer.
|
|
188
|
-
this.layerService = sceneContainer.
|
|
189
|
-
this.controlService = sceneContainer.
|
|
190
|
-
this.configService = sceneContainer.
|
|
191
|
-
this.scene = sceneContainer.
|
|
186
|
+
this.mapsService = sceneContainer.mapService;
|
|
187
|
+
this.renderService = sceneContainer.rendererService;
|
|
188
|
+
this.layerService = sceneContainer.layerService;
|
|
189
|
+
this.controlService = sceneContainer.controlService;
|
|
190
|
+
this.configService = sceneContainer.globalConfigService;
|
|
191
|
+
this.scene = sceneContainer.sceneService;
|
|
192
192
|
this.sceneContainer = sceneContainer;
|
|
193
193
|
this.isShow = true;
|
|
194
194
|
|
|
@@ -219,7 +219,7 @@ var Swipe = exports.default = exports.Swipe = /*#__PURE__*/function (_Control) {
|
|
|
219
219
|
|
|
220
220
|
// 添加掩膜图层到 scene
|
|
221
221
|
var layerContainer = (0, _l7Core.createLayerContainer)(sceneContainer);
|
|
222
|
-
this.maskLayer.setContainer(layerContainer
|
|
222
|
+
this.maskLayer.setContainer(layerContainer);
|
|
223
223
|
this.scene.addLayer(this.maskLayer);
|
|
224
224
|
this.emit('add', this);
|
|
225
225
|
return this;
|
package/lib/marker-layer.js
CHANGED
|
@@ -13,7 +13,6 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
13
13
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
14
14
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
-
var _l7Core = require("@antv/l7-core");
|
|
17
16
|
var _l7Utils = require("@antv/l7-utils");
|
|
18
17
|
var _eventemitter = require("eventemitter3");
|
|
19
18
|
var _supercluster = _interopRequireDefault(require("supercluster/dist/supercluster"));
|
|
@@ -62,7 +61,7 @@ var MarkerLayer = exports.default = /*#__PURE__*/function (_EventEmitter) {
|
|
|
62
61
|
value: function addTo(scene) {
|
|
63
62
|
// this.remove();
|
|
64
63
|
this.scene = scene;
|
|
65
|
-
this.mapsService = scene.
|
|
64
|
+
this.mapsService = scene.mapService;
|
|
66
65
|
if (this.markerLayerOption.cluster) {
|
|
67
66
|
this.initCluster();
|
|
68
67
|
this.update();
|
package/lib/marker.js
CHANGED
|
@@ -13,7 +13,6 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
13
13
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
14
14
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
-
var _l7Core = require("@antv/l7-core");
|
|
17
16
|
var _l7Utils = require("@antv/l7-utils");
|
|
18
17
|
var _eventemitter = require("eventemitter3");
|
|
19
18
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
@@ -65,7 +64,7 @@ var Marker = exports.default = /*#__PURE__*/function (_EventEmitter) {
|
|
|
65
64
|
_this.preLngLat = e.lnglat;
|
|
66
65
|
_this.emit('dragging', newLngLat);
|
|
67
66
|
});
|
|
68
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onMarkerDragEnd", function (
|
|
67
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onMarkerDragEnd", function () {
|
|
69
68
|
_this.mapsService.setMapStatus({
|
|
70
69
|
dragEnable: true,
|
|
71
70
|
zoomEnable: true
|
|
@@ -109,8 +108,8 @@ var Marker = exports.default = /*#__PURE__*/function (_EventEmitter) {
|
|
|
109
108
|
value: function addTo(scene) {
|
|
110
109
|
// this.remove();
|
|
111
110
|
this.scene = scene;
|
|
112
|
-
this.mapsService = scene.
|
|
113
|
-
this.sceneSerive = scene.
|
|
111
|
+
this.mapsService = scene.mapService;
|
|
112
|
+
this.sceneSerive = scene.sceneService;
|
|
114
113
|
var element = this.markerOption.element;
|
|
115
114
|
// this.sceneSerive.getSceneContainer().appendChild(element as HTMLElement);
|
|
116
115
|
this.mapsService.getMarkerContainer().appendChild(element);
|
|
@@ -414,7 +413,6 @@ var Marker = exports.default = /*#__PURE__*/function (_EventEmitter) {
|
|
|
414
413
|
}
|
|
415
414
|
element.style.left = pos.x + offsets[0] + 'px';
|
|
416
415
|
element.style.top = pos.y - offsets[1] + 'px';
|
|
417
|
-
console.log(element.style.left);
|
|
418
416
|
}
|
|
419
417
|
}
|
|
420
418
|
}, {
|
package/lib/popup/popup.js
CHANGED
|
@@ -13,7 +13,6 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
13
13
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
14
14
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
-
var _l7Core = require("@antv/l7-core");
|
|
17
16
|
var _l7Utils = require("@antv/l7-utils");
|
|
18
17
|
var _eventemitter = require("eventemitter3");
|
|
19
18
|
var _icon = require("../utils/icon");
|
|
@@ -90,12 +89,6 @@ var Popup = exports.default = exports.Popup = /*#__PURE__*/function (_EventEmitt
|
|
|
90
89
|
if (!_this.mapsService || _this.popupOption.followCursor) {
|
|
91
90
|
return;
|
|
92
91
|
}
|
|
93
|
-
var _this$lngLat2 = _this.lngLat,
|
|
94
|
-
lng = _this$lngLat2.lng,
|
|
95
|
-
lat = _this$lngLat2.lat;
|
|
96
|
-
var _this$mapsService$lng2 = _this.mapsService.lngLatToContainer([lng, lat]),
|
|
97
|
-
x = _this$mapsService$lng2.x,
|
|
98
|
-
y = _this$mapsService$lng2.y;
|
|
99
92
|
var map = ev.map;
|
|
100
93
|
var viewHalf = map.getSize();
|
|
101
94
|
viewHalf.x = viewHalf.x / 2;
|
|
@@ -201,9 +194,9 @@ var Popup = exports.default = exports.Popup = /*#__PURE__*/function (_EventEmitt
|
|
|
201
194
|
}, {
|
|
202
195
|
key: "addTo",
|
|
203
196
|
value: function addTo(scene) {
|
|
204
|
-
this.mapsService = scene.
|
|
205
|
-
this.sceneService = scene.
|
|
206
|
-
this.layerService = scene.
|
|
197
|
+
this.mapsService = scene.mapService;
|
|
198
|
+
this.sceneService = scene.sceneService;
|
|
199
|
+
this.layerService = scene.layerService;
|
|
207
200
|
//天地图仅监听zoomchange 不注册camerachane,对于平移,在mapsService中实现
|
|
208
201
|
// this.mapsService.on('zoomchange', this.updateWhenZoom);
|
|
209
202
|
this.mapsService.on('camerachange', this.update);
|
|
@@ -396,9 +389,9 @@ var Popup = exports.default = exports.Popup = /*#__PURE__*/function (_EventEmitt
|
|
|
396
389
|
}, {
|
|
397
390
|
key: "panToPopup",
|
|
398
391
|
value: function panToPopup() {
|
|
399
|
-
var _this$
|
|
400
|
-
lng = _this$
|
|
401
|
-
lat = _this$
|
|
392
|
+
var _this$lngLat2 = this.lngLat,
|
|
393
|
+
lng = _this$lngLat2.lng,
|
|
394
|
+
lat = _this$lngLat2.lat;
|
|
402
395
|
if (this.popupOption.autoPan) {
|
|
403
396
|
this.mapsService.panTo([lng, lat]);
|
|
404
397
|
}
|
package/lib/utils/popper.js
CHANGED
|
@@ -51,7 +51,6 @@ var Popper = exports.Popper = /*#__PURE__*/function (_EventEmitter) {
|
|
|
51
51
|
_l7Utils.DOM.removeClass(_this.popperDOM, 'l7-popper-hide');
|
|
52
52
|
_this.isShow = true;
|
|
53
53
|
if (_this.option.unique) {
|
|
54
|
-
// console.log(Popper.conflictPopperList.length);
|
|
55
54
|
Popper.conflictPopperList.forEach(function (popper) {
|
|
56
55
|
if (popper !== (0, _assertThisInitialized2.default)(_this) && popper.isShow) {
|
|
57
56
|
popper.hide();
|
package/package.json
CHANGED
|
@@ -1,47 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/l7-component",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.21.0",
|
|
4
4
|
"description": "",
|
|
5
|
+
"license": "ISC",
|
|
6
|
+
"author": "lzxue",
|
|
7
|
+
"sideEffects": true,
|
|
5
8
|
"main": "lib/index.js",
|
|
6
9
|
"module": "es/index.js",
|
|
7
10
|
"types": "es/index.d.ts",
|
|
8
|
-
"sideEffects": true,
|
|
9
11
|
"files": [
|
|
10
12
|
"lib",
|
|
11
13
|
"es",
|
|
12
14
|
"README.md"
|
|
13
15
|
],
|
|
14
16
|
"scripts": {
|
|
15
|
-
"tsc": "tsc --project tsconfig.build.json",
|
|
16
|
-
"less": "lessc src/css/index.less src/css/index.css",
|
|
17
|
-
"clean": "rimraf dist; rimraf es; rimraf lib;",
|
|
18
17
|
"build": "father build",
|
|
19
18
|
"build:cjs": "BABEL_ENV=cjs babel src --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments",
|
|
20
19
|
"build:esm": "BABEL_ENV=esm babel src --root-mode upward --out-dir es --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments",
|
|
21
|
-
"
|
|
20
|
+
"clean": "rimraf dist; rimraf es; rimraf lib;",
|
|
21
|
+
"less": "lessc src/css/index.less src/css/index.css",
|
|
22
22
|
"lint:ts": "run-p -c lint:ts-*",
|
|
23
|
+
"sync": "tnpm sync",
|
|
23
24
|
"test": "umi-test --passWithNoTests",
|
|
24
|
-
"
|
|
25
|
+
"tsc": "tsc --project tsconfig.build.json",
|
|
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"
|
|
25
27
|
},
|
|
26
|
-
"author": "lzxue",
|
|
27
|
-
"license": "ISC",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@antv/l7-core": "2.
|
|
30
|
-
"@antv/l7-utils": "2.
|
|
29
|
+
"@antv/l7-core": "2.21.0",
|
|
30
|
+
"@antv/l7-utils": "2.21.0",
|
|
31
31
|
"@babel/runtime": "^7.7.7",
|
|
32
32
|
"eventemitter3": "^4.0.0",
|
|
33
|
-
"inversify": "^5.0.1",
|
|
34
|
-
"reflect-metadata": "^0.2.1",
|
|
35
33
|
"supercluster": "^7.0.0"
|
|
36
34
|
},
|
|
37
35
|
"devDependencies": {
|
|
38
|
-
"@antv/l7-layers": "2.
|
|
39
|
-
"@antv/l7-test-utils": "2.
|
|
36
|
+
"@antv/l7-layers": "2.21.0",
|
|
37
|
+
"@antv/l7-test-utils": "2.21.0",
|
|
40
38
|
"gcoord": "^0.3.2",
|
|
41
39
|
"less": "^4.1.3"
|
|
42
40
|
},
|
|
43
|
-
"gitHead": "1966dbadf9efee8d69d22beb4d89947c158da634",
|
|
44
41
|
"publishConfig": {
|
|
45
42
|
"access": "public"
|
|
46
|
-
}
|
|
43
|
+
},
|
|
44
|
+
"gitHead": "7fa1b00b5262c98bb4cceef4eaf87a7b10af7e29"
|
|
47
45
|
}
|