@antv/l7-component 2.9.21 → 2.9.22-alpha.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.js +5 -26
- package/es/control/layer.js +13 -28
- package/es/control/logo.js +3 -4
- package/es/control/scale.js +6 -11
- package/es/control/zoom.js +3 -12
- package/es/css/l7.css +502 -0
- package/es/images/layers.png +0 -0
- package/es/images/layers.svg +1 -0
- package/es/images/logo.png +0 -0
- package/es/index.js +10 -10
- package/es/interface.js +1 -2
- package/es/marker-layer.js +27 -27
- package/es/marker.js +21 -27
- package/es/popup.js +16 -34
- package/es/utils/anchor.js +1 -2
- package/lib/control/BaseControl.js +100 -163
- package/lib/control/layer.js +248 -347
- package/lib/control/logo.js +52 -77
- package/lib/control/scale.js +112 -165
- package/lib/control/zoom.js +95 -143
- package/lib/css/l7.css +502 -0
- package/lib/images/layers.png +0 -0
- package/lib/images/layers.svg +1 -0
- package/lib/images/logo.png +0 -0
- package/lib/index.js +53 -135
- package/lib/interface.js +17 -2
- package/lib/marker-layer.js +224 -330
- package/lib/marker.js +271 -404
- package/lib/popup.js +201 -309
- package/lib/utils/anchor.js +54 -37
- package/package.json +9 -9
- package/es/control/BaseControl.js.map +0 -1
- package/es/control/layer.js.map +0 -1
- package/es/control/logo.js.map +0 -1
- package/es/control/scale.js.map +0 -1
- package/es/control/zoom.js.map +0 -1
- package/es/index.js.map +0 -1
- package/es/interface.js.map +0 -1
- package/es/marker-layer.js.map +0 -1
- package/es/marker.js.map +0 -1
- package/es/popup.js.map +0 -1
- package/es/utils/anchor.js.map +0 -1
- package/lib/control/BaseControl.js.map +0 -1
- package/lib/control/layer.js.map +0 -1
- package/lib/control/logo.js.map +0 -1
- package/lib/control/scale.js.map +0 -1
- package/lib/control/zoom.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/interface.js.map +0 -1
- package/lib/marker-layer.js.map +0 -1
- package/lib/marker.js.map +0 -1
- package/lib/popup.js.map +0 -1
- package/lib/utils/anchor.js.map +0 -1
|
@@ -1,14 +1,9 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
1
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
4
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
|
|
9
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10
|
-
|
|
11
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12
7
|
|
|
13
8
|
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); }; }
|
|
14
9
|
|
|
@@ -20,7 +15,7 @@ import { EventEmitter } from 'eventemitter3';
|
|
|
20
15
|
export { PositionType } from '@antv/l7-core';
|
|
21
16
|
var controlId = 0;
|
|
22
17
|
|
|
23
|
-
var Control = function (_EventEmitter) {
|
|
18
|
+
var Control = /*#__PURE__*/function (_EventEmitter) {
|
|
24
19
|
_inherits(Control, _EventEmitter);
|
|
25
20
|
|
|
26
21
|
var _super = _createSuper(Control);
|
|
@@ -31,23 +26,6 @@ var Control = function (_EventEmitter) {
|
|
|
31
26
|
_classCallCheck(this, Control);
|
|
32
27
|
|
|
33
28
|
_this = _super.call(this);
|
|
34
|
-
|
|
35
|
-
_defineProperty(_assertThisInitialized(_this), "controlOption", void 0);
|
|
36
|
-
|
|
37
|
-
_defineProperty(_assertThisInitialized(_this), "container", void 0);
|
|
38
|
-
|
|
39
|
-
_defineProperty(_assertThisInitialized(_this), "sceneContainer", void 0);
|
|
40
|
-
|
|
41
|
-
_defineProperty(_assertThisInitialized(_this), "mapsService", void 0);
|
|
42
|
-
|
|
43
|
-
_defineProperty(_assertThisInitialized(_this), "renderService", void 0);
|
|
44
|
-
|
|
45
|
-
_defineProperty(_assertThisInitialized(_this), "layerService", void 0);
|
|
46
|
-
|
|
47
|
-
_defineProperty(_assertThisInitialized(_this), "controlService", void 0);
|
|
48
|
-
|
|
49
|
-
_defineProperty(_assertThisInitialized(_this), "isShow", void 0);
|
|
50
|
-
|
|
51
29
|
_this.controlOption = _objectSpread(_objectSpread({}, _this.getDefault()), cfg || {});
|
|
52
30
|
return _this;
|
|
53
31
|
}
|
|
@@ -64,6 +42,7 @@ var Control = function (_EventEmitter) {
|
|
|
64
42
|
key: "setPosition",
|
|
65
43
|
value: function setPosition() {
|
|
66
44
|
var position = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : PositionType.BOTTOMRIGHT;
|
|
45
|
+
// 考虑组件的自动布局,需要销毁重建
|
|
67
46
|
var controlService = this.controlService;
|
|
68
47
|
|
|
69
48
|
if (controlService) {
|
|
@@ -138,6 +117,7 @@ var Control = function (_EventEmitter) {
|
|
|
138
117
|
}, {
|
|
139
118
|
key: "_refocusOnMap",
|
|
140
119
|
value: function _refocusOnMap(e) {
|
|
120
|
+
// if map exists and event is not a keyboard event
|
|
141
121
|
if (this.mapsService && e && e.screenX > 0 && e.screenY > 0) {
|
|
142
122
|
var container = this.mapsService.getContainer();
|
|
143
123
|
|
|
@@ -151,5 +131,4 @@ var Control = function (_EventEmitter) {
|
|
|
151
131
|
return Control;
|
|
152
132
|
}(EventEmitter);
|
|
153
133
|
|
|
154
|
-
export { Control as default };
|
|
155
|
-
//# sourceMappingURL=BaseControl.js.map
|
|
134
|
+
export { Control as default };
|
package/es/control/layer.js
CHANGED
|
@@ -4,7 +4,6 @@ import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized
|
|
|
4
4
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
7
|
|
|
9
8
|
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
9
|
|
|
@@ -12,9 +11,9 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
12
11
|
|
|
13
12
|
import { PositionType } from '@antv/l7-core';
|
|
14
13
|
import { bindAll, DOM } from '@antv/l7-utils';
|
|
15
|
-
import Control from
|
|
14
|
+
import Control from "./BaseControl";
|
|
16
15
|
|
|
17
|
-
var Layers = function (_Control) {
|
|
16
|
+
var Layers = /*#__PURE__*/function (_Control) {
|
|
18
17
|
_inherits(Layers, _Control);
|
|
19
18
|
|
|
20
19
|
var _super = _createSuper(Layers);
|
|
@@ -25,25 +24,6 @@ var Layers = function (_Control) {
|
|
|
25
24
|
_classCallCheck(this, Layers);
|
|
26
25
|
|
|
27
26
|
_this = _super.call(this, cfg);
|
|
28
|
-
|
|
29
|
-
_defineProperty(_assertThisInitialized(_this), "layerControlInputs", void 0);
|
|
30
|
-
|
|
31
|
-
_defineProperty(_assertThisInitialized(_this), "layers", void 0);
|
|
32
|
-
|
|
33
|
-
_defineProperty(_assertThisInitialized(_this), "lastZIndex", void 0);
|
|
34
|
-
|
|
35
|
-
_defineProperty(_assertThisInitialized(_this), "handlingClick", void 0);
|
|
36
|
-
|
|
37
|
-
_defineProperty(_assertThisInitialized(_this), "layersLink", void 0);
|
|
38
|
-
|
|
39
|
-
_defineProperty(_assertThisInitialized(_this), "baseLayersList", void 0);
|
|
40
|
-
|
|
41
|
-
_defineProperty(_assertThisInitialized(_this), "separator", void 0);
|
|
42
|
-
|
|
43
|
-
_defineProperty(_assertThisInitialized(_this), "overlaysList", void 0);
|
|
44
|
-
|
|
45
|
-
_defineProperty(_assertThisInitialized(_this), "form", void 0);
|
|
46
|
-
|
|
47
27
|
_this.layerControlInputs = [];
|
|
48
28
|
_this.layers = [];
|
|
49
29
|
_this.lastZIndex = 0;
|
|
@@ -133,7 +113,8 @@ var Layers = function (_Control) {
|
|
|
133
113
|
value: function initLayout() {
|
|
134
114
|
var className = 'l7-control-layers';
|
|
135
115
|
var container = this.container = DOM.create('div', className);
|
|
136
|
-
var collapsed = this.controlOption.collapsed;
|
|
116
|
+
var collapsed = this.controlOption.collapsed; // makes this work on IE touch devices by stopping it from firing a mouseout event when the touch is released
|
|
117
|
+
|
|
137
118
|
container.setAttribute('aria-haspopup', 'true');
|
|
138
119
|
var form = this.form = DOM.create('form', className + '-list');
|
|
139
120
|
|
|
@@ -144,7 +125,8 @@ var Layers = function (_Control) {
|
|
|
144
125
|
}
|
|
145
126
|
|
|
146
127
|
this.layersLink = DOM.create('a', className + '-toggle', container);
|
|
147
|
-
var link = this.layersLink;
|
|
128
|
+
var link = this.layersLink; // link.href = '#';
|
|
129
|
+
|
|
148
130
|
link.title = 'Layers';
|
|
149
131
|
|
|
150
132
|
if (!collapsed) {
|
|
@@ -167,9 +149,11 @@ var Layers = function (_Control) {
|
|
|
167
149
|
_this$controlOption$o = _this$controlOption.overlayers,
|
|
168
150
|
overlayers = _this$controlOption$o === void 0 ? {} : _this$controlOption$o;
|
|
169
151
|
Object.keys(baseLayers).forEach(function (name, index) {
|
|
152
|
+
// baseLayers[name].once('inited', this.update);
|
|
170
153
|
_this4.addLayer(baseLayers[name], name, false);
|
|
171
154
|
});
|
|
172
155
|
Object.keys(overlayers).forEach(function (name, index) {
|
|
156
|
+
// overlayers[name].once('inited', this.update);
|
|
173
157
|
_this4.addLayer(overlayers[name], name, true);
|
|
174
158
|
});
|
|
175
159
|
}
|
|
@@ -195,7 +179,8 @@ var Layers = function (_Control) {
|
|
|
195
179
|
overlaysPresent = overlaysPresent || obj.overlay;
|
|
196
180
|
baseLayersPresent = baseLayersPresent || !obj.overlay;
|
|
197
181
|
baseLayersCount += !obj.overlay ? 1 : 0;
|
|
198
|
-
}
|
|
182
|
+
} // Hide base layers section if there's only one layer.
|
|
183
|
+
|
|
199
184
|
|
|
200
185
|
if (this.controlOption.hideSingleBase) {
|
|
201
186
|
baseLayersPresent = baseLayersPresent && baseLayersCount > 1;
|
|
@@ -271,7 +256,8 @@ var Layers = function (_Control) {
|
|
|
271
256
|
this.update();
|
|
272
257
|
}
|
|
273
258
|
|
|
274
|
-
var obj = this.layerService.getLayer(e.target.layerId);
|
|
259
|
+
var obj = this.layerService.getLayer(e.target.layerId); // @ts-ignore
|
|
260
|
+
|
|
275
261
|
var type = obj !== null && obj !== void 0 && obj.overlay ? e.type === 'add' ? 'overlayadd' : 'overlayremove' : e.type === 'add' ? 'baselayerchange' : null;
|
|
276
262
|
|
|
277
263
|
if (type) {
|
|
@@ -351,5 +337,4 @@ var Layers = function (_Control) {
|
|
|
351
337
|
return Layers;
|
|
352
338
|
}(Control);
|
|
353
339
|
|
|
354
|
-
export { Layers as default };
|
|
355
|
-
//# sourceMappingURL=layer.js.map
|
|
340
|
+
export { Layers as default };
|
package/es/control/logo.js
CHANGED
|
@@ -9,9 +9,9 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
9
9
|
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; } }
|
|
10
10
|
|
|
11
11
|
import { DOM } from '@antv/l7-utils';
|
|
12
|
-
import Control, { PositionType } from
|
|
12
|
+
import Control, { PositionType } from "./BaseControl";
|
|
13
13
|
|
|
14
|
-
var Logo = function (_Control) {
|
|
14
|
+
var Logo = /*#__PURE__*/function (_Control) {
|
|
15
15
|
_inherits(Logo, _Control);
|
|
16
16
|
|
|
17
17
|
var _super = _createSuper(Logo);
|
|
@@ -54,5 +54,4 @@ var Logo = function (_Control) {
|
|
|
54
54
|
return Logo;
|
|
55
55
|
}(Control);
|
|
56
56
|
|
|
57
|
-
export { Logo as default };
|
|
58
|
-
//# sourceMappingURL=logo.js.map
|
|
57
|
+
export { Logo as default };
|
package/es/control/scale.js
CHANGED
|
@@ -4,16 +4,15 @@ import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized
|
|
|
4
4
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
7
|
|
|
9
8
|
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
9
|
|
|
11
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; } }
|
|
12
11
|
|
|
13
12
|
import { bindAll, DOM, lnglatDistance } from '@antv/l7-utils';
|
|
14
|
-
import Control, { PositionType } from
|
|
13
|
+
import Control, { PositionType } from "./BaseControl";
|
|
15
14
|
|
|
16
|
-
var Scale = function (_Control) {
|
|
15
|
+
var Scale = /*#__PURE__*/function (_Control) {
|
|
17
16
|
_inherits(Scale, _Control);
|
|
18
17
|
|
|
19
18
|
var _super = _createSuper(Scale);
|
|
@@ -24,11 +23,6 @@ var Scale = function (_Control) {
|
|
|
24
23
|
_classCallCheck(this, Scale);
|
|
25
24
|
|
|
26
25
|
_this = _super.call(this, cfg);
|
|
27
|
-
|
|
28
|
-
_defineProperty(_assertThisInitialized(_this), "mScale", void 0);
|
|
29
|
-
|
|
30
|
-
_defineProperty(_assertThisInitialized(_this), "iScale", void 0);
|
|
31
|
-
|
|
32
26
|
bindAll(['update'], _assertThisInitialized(_this));
|
|
33
27
|
return _this;
|
|
34
28
|
}
|
|
@@ -51,7 +45,9 @@ var Scale = function (_Control) {
|
|
|
51
45
|
var className = 'l7-control-scale';
|
|
52
46
|
var container = DOM.create('div', className);
|
|
53
47
|
this.addScales(className + '-line', container);
|
|
54
|
-
var updateWhenIdle = this.controlOption.updateWhenIdle;
|
|
48
|
+
var updateWhenIdle = this.controlOption.updateWhenIdle; // TODO: 高德地图和MapBox地图事件不一致问题
|
|
49
|
+
// 高德zoomchange
|
|
50
|
+
|
|
55
51
|
this.mapsService.on(updateWhenIdle ? 'moveend' : 'mapmove', this.update);
|
|
56
52
|
this.mapsService.on(updateWhenIdle ? 'zoomend' : 'zoomchange', this.update);
|
|
57
53
|
this.update();
|
|
@@ -149,5 +145,4 @@ var Scale = function (_Control) {
|
|
|
149
145
|
return Scale;
|
|
150
146
|
}(Control);
|
|
151
147
|
|
|
152
|
-
export { Scale as default };
|
|
153
|
-
//# sourceMappingURL=scale.js.map
|
|
148
|
+
export { Scale as default };
|
package/es/control/zoom.js
CHANGED
|
@@ -4,16 +4,15 @@ import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized
|
|
|
4
4
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
7
|
|
|
9
8
|
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
9
|
|
|
11
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; } }
|
|
12
11
|
|
|
13
12
|
import { bindAll, DOM } from '@antv/l7-utils';
|
|
14
|
-
import Control, { PositionType } from
|
|
13
|
+
import Control, { PositionType } from "./BaseControl";
|
|
15
14
|
|
|
16
|
-
var Zoom = function (_Control) {
|
|
15
|
+
var Zoom = /*#__PURE__*/function (_Control) {
|
|
17
16
|
_inherits(Zoom, _Control);
|
|
18
17
|
|
|
19
18
|
var _super = _createSuper(Zoom);
|
|
@@ -24,13 +23,6 @@ var Zoom = function (_Control) {
|
|
|
24
23
|
_classCallCheck(this, Zoom);
|
|
25
24
|
|
|
26
25
|
_this = _super.call(this, cfg);
|
|
27
|
-
|
|
28
|
-
_defineProperty(_assertThisInitialized(_this), "disabled", void 0);
|
|
29
|
-
|
|
30
|
-
_defineProperty(_assertThisInitialized(_this), "zoomInButton", void 0);
|
|
31
|
-
|
|
32
|
-
_defineProperty(_assertThisInitialized(_this), "zoomOutButton", void 0);
|
|
33
|
-
|
|
34
26
|
bindAll(['updateDisabled', 'zoomIn', 'zoomOut'], _assertThisInitialized(_this));
|
|
35
27
|
return _this;
|
|
36
28
|
}
|
|
@@ -124,5 +116,4 @@ var Zoom = function (_Control) {
|
|
|
124
116
|
return Zoom;
|
|
125
117
|
}(Control);
|
|
126
118
|
|
|
127
|
-
export { Zoom as default };
|
|
128
|
-
//# sourceMappingURL=zoom.js.map
|
|
119
|
+
export { Zoom as default };
|