@antv/l7-component 2.9.32-alpha.4 → 2.9.32-alpha.5
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/buttonControl.d.ts +1 -1
- package/es/control/baseControl/control.d.ts +4 -5
- package/es/control/baseControl/control.js +18 -5
- package/es/control/baseControl/popperControl.d.ts +1 -1
- package/es/control/baseControl/selectControl.d.ts +2 -2
- package/es/control/baseControl/selectControl.js +5 -0
- package/es/control/zoom.d.ts +3 -2
- package/lib/assets/iconfont/iconfont.js +46 -30
- package/lib/constants/index.js +34 -56
- package/lib/control/baseControl/buttonControl.js +194 -105
- package/lib/control/baseControl/control.js +317 -156
- package/lib/control/baseControl/index.js +57 -22
- package/lib/control/baseControl/popperControl.js +136 -102
- package/lib/control/baseControl/selectControl.js +230 -130
- package/lib/control/exportImage.js +175 -81
- package/lib/control/fullscreen.js +157 -102
- package/lib/control/geoLocate.js +143 -67
- package/lib/control/layerControl.js +162 -116
- package/lib/control/logo.js +101 -70
- package/lib/control/mapTheme.js +144 -85
- package/lib/control/mouseLocation.js +112 -71
- package/lib/control/scale.js +180 -127
- package/lib/control/zoom.js +154 -111
- package/lib/index.js +251 -48
- package/lib/interface.js +4 -16
- package/lib/marker-layer.js +367 -249
- package/lib/marker.js +419 -277
- package/lib/popup/layerPopup.js +305 -188
- package/lib/popup/popup.js +602 -339
- package/lib/utils/anchor.js +37 -55
- package/lib/utils/icon.js +13 -32
- package/lib/utils/popper.js +268 -180
- package/lib/utils/screenfull.js +110 -103
- package/package.json +5 -5
package/lib/utils/screenfull.js
CHANGED
|
@@ -1,138 +1,133 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
18
4
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
__export(screenfull_exports, {
|
|
22
|
-
default: () => screenfull_default
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
23
7
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
],
|
|
42
|
-
[
|
|
43
|
-
"webkitRequestFullScreen",
|
|
44
|
-
"webkitCancelFullScreen",
|
|
45
|
-
"webkitCurrentFullScreenElement",
|
|
46
|
-
"webkitCancelFullScreen",
|
|
47
|
-
"webkitfullscreenchange",
|
|
48
|
-
"webkitfullscreenerror"
|
|
49
|
-
],
|
|
50
|
-
[
|
|
51
|
-
"mozRequestFullScreen",
|
|
52
|
-
"mozCancelFullScreen",
|
|
53
|
-
"mozFullScreenElement",
|
|
54
|
-
"mozFullScreenEnabled",
|
|
55
|
-
"mozfullscreenchange",
|
|
56
|
-
"mozfullscreenerror"
|
|
57
|
-
],
|
|
58
|
-
[
|
|
59
|
-
"msRequestFullscreen",
|
|
60
|
-
"msExitFullscreen",
|
|
61
|
-
"msFullscreenElement",
|
|
62
|
-
"msFullscreenEnabled",
|
|
63
|
-
"MSFullscreenChange",
|
|
64
|
-
"MSFullscreenError"
|
|
65
|
-
]
|
|
66
|
-
];
|
|
67
|
-
var nativeAPI = (() => {
|
|
68
|
-
if (typeof document === "undefined") {
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
+
|
|
12
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
13
|
+
|
|
14
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
15
|
+
|
|
16
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
17
|
+
|
|
18
|
+
// @ts-nocheck
|
|
19
|
+
var methodMap = [['requestFullscreen', 'exitFullscreen', 'fullscreenElement', 'fullscreenEnabled', 'fullscreenchange', 'fullscreenerror'], // New WebKit
|
|
20
|
+
['webkitRequestFullscreen', 'webkitExitFullscreen', 'webkitFullscreenElement', 'webkitFullscreenEnabled', 'webkitfullscreenchange', 'webkitfullscreenerror'], // Old WebKit
|
|
21
|
+
['webkitRequestFullScreen', 'webkitCancelFullScreen', 'webkitCurrentFullScreenElement', 'webkitCancelFullScreen', 'webkitfullscreenchange', 'webkitfullscreenerror'], ['mozRequestFullScreen', 'mozCancelFullScreen', 'mozFullScreenElement', 'mozFullScreenEnabled', 'mozfullscreenchange', 'mozfullscreenerror'], ['msRequestFullscreen', 'msExitFullscreen', 'msFullscreenElement', 'msFullscreenEnabled', 'MSFullscreenChange', 'MSFullscreenError']];
|
|
22
|
+
|
|
23
|
+
var nativeAPI = function () {
|
|
24
|
+
if (typeof document === 'undefined') {
|
|
69
25
|
return false;
|
|
70
26
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
27
|
+
|
|
28
|
+
var unprefixedMethods = methodMap[0];
|
|
29
|
+
var returnValue = {};
|
|
30
|
+
|
|
31
|
+
var _iterator = _createForOfIteratorHelper(methodMap),
|
|
32
|
+
_step;
|
|
33
|
+
|
|
34
|
+
try {
|
|
35
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
36
|
+
var methodList = _step.value;
|
|
37
|
+
var exitFullscreenMethod = methodList === null || methodList === void 0 ? void 0 : methodList[1];
|
|
38
|
+
|
|
39
|
+
if (exitFullscreenMethod in document) {
|
|
40
|
+
var _iterator2 = _createForOfIteratorHelper(methodList.entries()),
|
|
41
|
+
_step2;
|
|
42
|
+
|
|
43
|
+
try {
|
|
44
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
45
|
+
var _step2$value = (0, _slicedToArray2.default)(_step2.value, 2),
|
|
46
|
+
index = _step2$value[0],
|
|
47
|
+
method = _step2$value[1];
|
|
48
|
+
|
|
49
|
+
returnValue[unprefixedMethods[index]] = method;
|
|
50
|
+
}
|
|
51
|
+
} catch (err) {
|
|
52
|
+
_iterator2.e(err);
|
|
53
|
+
} finally {
|
|
54
|
+
_iterator2.f();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return returnValue;
|
|
78
58
|
}
|
|
79
|
-
return returnValue;
|
|
80
59
|
}
|
|
60
|
+
} catch (err) {
|
|
61
|
+
_iterator.e(err);
|
|
62
|
+
} finally {
|
|
63
|
+
_iterator.f();
|
|
81
64
|
}
|
|
65
|
+
|
|
82
66
|
return false;
|
|
83
|
-
}
|
|
67
|
+
}();
|
|
68
|
+
|
|
84
69
|
var eventNameMap = {
|
|
85
70
|
change: nativeAPI.fullscreenchange,
|
|
86
71
|
error: nativeAPI.fullscreenerror
|
|
87
72
|
};
|
|
88
73
|
var screenfull = {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
74
|
+
// eslint-disable-next-line default-param-last
|
|
75
|
+
request: function request() {
|
|
76
|
+
var element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.documentElement;
|
|
77
|
+
var options = arguments.length > 1 ? arguments[1] : undefined;
|
|
78
|
+
return new Promise(function (resolve, reject) {
|
|
79
|
+
var onFullScreenEntered = function onFullScreenEntered() {
|
|
80
|
+
screenfull.off('change', onFullScreenEntered);
|
|
93
81
|
resolve();
|
|
94
82
|
};
|
|
95
|
-
|
|
96
|
-
|
|
83
|
+
|
|
84
|
+
screenfull.on('change', onFullScreenEntered);
|
|
85
|
+
var returnPromise = element[nativeAPI.requestFullscreen](options);
|
|
86
|
+
|
|
97
87
|
if (returnPromise instanceof Promise) {
|
|
98
88
|
returnPromise.then(onFullScreenEntered).catch(reject);
|
|
99
89
|
}
|
|
100
90
|
});
|
|
101
91
|
},
|
|
102
|
-
exit() {
|
|
103
|
-
return new Promise((resolve, reject)
|
|
92
|
+
exit: function exit() {
|
|
93
|
+
return new Promise(function (resolve, reject) {
|
|
104
94
|
if (!screenfull.isFullscreen) {
|
|
105
95
|
resolve();
|
|
106
96
|
return;
|
|
107
97
|
}
|
|
108
|
-
|
|
109
|
-
|
|
98
|
+
|
|
99
|
+
var onFullScreenExit = function onFullScreenExit() {
|
|
100
|
+
screenfull.off('change', onFullScreenExit);
|
|
110
101
|
resolve();
|
|
111
102
|
};
|
|
112
|
-
|
|
113
|
-
|
|
103
|
+
|
|
104
|
+
screenfull.on('change', onFullScreenExit);
|
|
105
|
+
var returnPromise = document[nativeAPI.exitFullscreen]();
|
|
106
|
+
|
|
114
107
|
if (returnPromise instanceof Promise) {
|
|
115
108
|
returnPromise.then(onFullScreenExit).catch(reject);
|
|
116
109
|
}
|
|
117
110
|
});
|
|
118
111
|
},
|
|
119
|
-
toggle(element, options) {
|
|
112
|
+
toggle: function toggle(element, options) {
|
|
120
113
|
return screenfull.isFullscreen ? screenfull.exit() : screenfull.request(element, options);
|
|
121
114
|
},
|
|
122
|
-
onchange(callback) {
|
|
123
|
-
screenfull.on(
|
|
115
|
+
onchange: function onchange(callback) {
|
|
116
|
+
screenfull.on('change', callback);
|
|
124
117
|
},
|
|
125
|
-
onerror(callback) {
|
|
126
|
-
screenfull.on(
|
|
118
|
+
onerror: function onerror(callback) {
|
|
119
|
+
screenfull.on('error', callback);
|
|
127
120
|
},
|
|
128
|
-
on(event, callback) {
|
|
129
|
-
|
|
121
|
+
on: function on(event, callback) {
|
|
122
|
+
var eventName = eventNameMap[event];
|
|
123
|
+
|
|
130
124
|
if (eventName) {
|
|
131
125
|
document.addEventListener(eventName, callback, false);
|
|
132
126
|
}
|
|
133
127
|
},
|
|
134
|
-
off(event, callback) {
|
|
135
|
-
|
|
128
|
+
off: function off(event, callback) {
|
|
129
|
+
var eventName = eventNameMap[event];
|
|
130
|
+
|
|
136
131
|
if (eventName) {
|
|
137
132
|
document.removeEventListener(eventName, callback, false);
|
|
138
133
|
}
|
|
@@ -141,20 +136,32 @@ var screenfull = {
|
|
|
141
136
|
};
|
|
142
137
|
Object.defineProperties(screenfull, {
|
|
143
138
|
isFullscreen: {
|
|
144
|
-
get: ()
|
|
139
|
+
get: function get() {
|
|
140
|
+
return Boolean(document[nativeAPI.fullscreenElement]);
|
|
141
|
+
}
|
|
145
142
|
},
|
|
146
143
|
element: {
|
|
147
144
|
enumerable: true,
|
|
148
|
-
get: ()
|
|
145
|
+
get: function get() {
|
|
146
|
+
var _document$nativeAPI$f;
|
|
147
|
+
|
|
148
|
+
return (_document$nativeAPI$f = document[nativeAPI.fullscreenElement]) !== null && _document$nativeAPI$f !== void 0 ? _document$nativeAPI$f : undefined;
|
|
149
|
+
}
|
|
149
150
|
},
|
|
150
151
|
isEnabled: {
|
|
151
152
|
enumerable: true,
|
|
152
|
-
|
|
153
|
+
// Coerce to boolean in case of old WebKit.
|
|
154
|
+
get: function get() {
|
|
155
|
+
return Boolean(document[nativeAPI.fullscreenEnabled]);
|
|
156
|
+
}
|
|
153
157
|
}
|
|
154
158
|
});
|
|
159
|
+
|
|
155
160
|
if (!nativeAPI) {
|
|
156
|
-
screenfull = {
|
|
161
|
+
screenfull = {
|
|
162
|
+
isEnabled: false
|
|
163
|
+
};
|
|
157
164
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
165
|
+
|
|
166
|
+
var _default = screenfull;
|
|
167
|
+
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/l7-component",
|
|
3
|
-
"version": "2.9.32-alpha.
|
|
3
|
+
"version": "2.9.32-alpha.5",
|
|
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.32-alpha.
|
|
30
|
-
"@antv/l7-utils": "2.9.32-alpha.
|
|
29
|
+
"@antv/l7-core": "2.9.32-alpha.5",
|
|
30
|
+
"@antv/l7-utils": "2.9.32-alpha.5",
|
|
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.32-alpha.
|
|
39
|
+
"@antv/l7-test-utils": "2.9.32-alpha.5",
|
|
40
40
|
"gcoord": "^0.3.2",
|
|
41
41
|
"less": "^4.1.3"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "433887ba63e676783a08ef96ce612a52a466c131",
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"access": "public"
|
|
46
46
|
}
|