@antv/l7-map 2.9.33 → 2.9.35
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/lib/camera.js +766 -508
- package/lib/earthmap.js +389 -223
- package/lib/geo/edge_insets.js +117 -64
- package/lib/geo/lng_lat.js +86 -65
- package/lib/geo/lng_lat_bounds.js +162 -123
- package/lib/geo/mercator.js +91 -62
- package/lib/geo/point.js +234 -171
- package/lib/geo/simple.js +93 -61
- package/lib/geo/transform.js +982 -472
- package/lib/handler/IHandler.js +4 -16
- package/lib/handler/blockable_map_event.js +84 -63
- package/lib/handler/box_zoom.js +201 -123
- package/lib/handler/click_zoom.js +63 -55
- package/lib/handler/events/event.js +20 -35
- package/lib/handler/events/index.js +28 -35
- package/lib/handler/events/map_mouse_event.js +85 -42
- package/lib/handler/events/map_touch_event.js +116 -45
- package/lib/handler/events/map_wheel_event.js +70 -34
- package/lib/handler/events/render_event.js +50 -31
- package/lib/handler/handler_inertia.js +158 -114
- package/lib/handler/handler_manager.js +640 -381
- package/lib/handler/handler_util.js +11 -29
- package/lib/handler/keyboard.js +155 -114
- package/lib/handler/map_event.js +133 -84
- package/lib/handler/mouse/index.js +28 -35
- package/lib/handler/mouse/mouse_handler.js +126 -90
- package/lib/handler/mouse/mousepan_handler.js +64 -46
- package/lib/handler/mouse/mousepitch_hander.js +64 -44
- package/lib/handler/mouse/mouserotate_hander.js +64 -44
- package/lib/handler/mouse/util.js +22 -40
- package/lib/handler/scroll_zoom.js +318 -176
- package/lib/handler/shim/dblclick_zoom.js +76 -42
- package/lib/handler/shim/drag_pan.js +98 -48
- package/lib/handler/shim/drag_rotate.js +82 -43
- package/lib/handler/shim/touch_zoom_rotate.js +127 -59
- package/lib/handler/tap/single_tap_recognizer.js +113 -84
- package/lib/handler/tap/tap_drag_zoom.js +111 -93
- package/lib/handler/tap/tap_recognizer.js +72 -60
- package/lib/handler/tap/tap_zoom.js +113 -88
- package/lib/handler/touch/index.js +36 -38
- package/lib/handler/touch/touch_pan.js +126 -98
- package/lib/handler/touch/touch_pitch.js +108 -74
- package/lib/handler/touch/touch_rotate.js +93 -59
- package/lib/handler/touch/touch_zoom.js +71 -49
- package/lib/handler/touch/two_touch.js +129 -90
- package/lib/hash.js +149 -100
- package/lib/index.js +43 -20
- package/lib/interface.js +4 -16
- package/lib/map.js +420 -240
- package/lib/util.js +88 -69
- package/lib/utils/Aabb.js +134 -81
- package/lib/utils/dom.js +162 -88
- package/lib/utils/performance.js +46 -54
- package/lib/utils/primitives.js +53 -59
- package/lib/utils/task_queue.js +104 -61
- package/package.json +3 -3
package/lib/handler/IHandler.js
CHANGED
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
-
for (let key of __getOwnPropNames(from))
|
|
8
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
-
}
|
|
11
|
-
return to;
|
|
12
|
-
};
|
|
13
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";
|
|
14
2
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
@@ -1,71 +1,92 @@
|
|
|
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(blockable_map_event_exports, {
|
|
22
|
-
default: () => BlockableMapEventHandler
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
23
7
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
var
|
|
27
|
-
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
+
|
|
14
|
+
var _events = require("./events");
|
|
15
|
+
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
var BlockableMapEventHandler = /*#__PURE__*/function () {
|
|
18
|
+
function BlockableMapEventHandler(map) {
|
|
19
|
+
(0, _classCallCheck2.default)(this, BlockableMapEventHandler);
|
|
28
20
|
this.map = map;
|
|
29
21
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
mousedown() {
|
|
38
|
-
this.delayContextMenu = true;
|
|
39
|
-
}
|
|
40
|
-
mouseup() {
|
|
41
|
-
this.delayContextMenu = false;
|
|
42
|
-
if (this.contextMenuEvent) {
|
|
43
|
-
this.map.emit("contextmenu", new import_events.MapMouseEvent("contextmenu", this.map, this.contextMenuEvent));
|
|
22
|
+
|
|
23
|
+
(0, _createClass2.default)(BlockableMapEventHandler, [{
|
|
24
|
+
key: "reset",
|
|
25
|
+
value: function reset() {
|
|
26
|
+
this.delayContextMenu = false; // @ts-ignore
|
|
27
|
+
|
|
44
28
|
delete this.contextMenuEvent;
|
|
45
29
|
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
this.map.emit(e.type, new import_events.MapMouseEvent(e.type, this.map, e));
|
|
30
|
+
}, {
|
|
31
|
+
key: "mousemove",
|
|
32
|
+
value: function mousemove(e) {
|
|
33
|
+
// mousemove map events should not be fired when interaction handlers (pan, rotate, etc) are active
|
|
34
|
+
this.map.emit(e.type, new _events.MapMouseEvent(e.type, this.map, e));
|
|
52
35
|
}
|
|
53
|
-
|
|
54
|
-
|
|
36
|
+
}, {
|
|
37
|
+
key: "mousedown",
|
|
38
|
+
value: function mousedown() {
|
|
39
|
+
this.delayContextMenu = true;
|
|
55
40
|
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
41
|
+
}, {
|
|
42
|
+
key: "mouseup",
|
|
43
|
+
value: function mouseup() {
|
|
44
|
+
this.delayContextMenu = false;
|
|
45
|
+
|
|
46
|
+
if (this.contextMenuEvent) {
|
|
47
|
+
this.map.emit('contextmenu', new _events.MapMouseEvent('contextmenu', this.map, this.contextMenuEvent)); // @ts-ignore
|
|
48
|
+
|
|
49
|
+
delete this.contextMenuEvent;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}, {
|
|
53
|
+
key: "contextmenu",
|
|
54
|
+
value: function contextmenu(e) {
|
|
55
|
+
if (this.delayContextMenu) {
|
|
56
|
+
// Mac: contextmenu fired on mousedown; we save it until mouseup for consistency's sake
|
|
57
|
+
this.contextMenuEvent = e;
|
|
58
|
+
} else {
|
|
59
|
+
// Windows: contextmenu fired on mouseup, so fire event now
|
|
60
|
+
this.map.emit(e.type, new _events.MapMouseEvent(e.type, this.map, e));
|
|
61
|
+
} // prevent browser context menu when necessary
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
if (this.map.listeners('contextmenu')) {
|
|
65
|
+
e.preventDefault();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}, {
|
|
69
|
+
key: "isEnabled",
|
|
70
|
+
value: function isEnabled() {
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
}, {
|
|
74
|
+
key: "isActive",
|
|
75
|
+
value: function isActive() {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
}, {
|
|
79
|
+
key: "enable",
|
|
80
|
+
value: function enable() {
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
}, {
|
|
84
|
+
key: "disable",
|
|
85
|
+
value: function disable() {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
}]);
|
|
89
|
+
return BlockableMapEventHandler;
|
|
90
|
+
}();
|
|
91
|
+
|
|
92
|
+
exports.default = BlockableMapEventHandler;
|
package/lib/handler/box_zoom.js
CHANGED
|
@@ -1,139 +1,217 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
-
|
|
22
|
-
// src/handler/box_zoom.ts
|
|
23
|
-
var box_zoom_exports = {};
|
|
24
|
-
__export(box_zoom_exports, {
|
|
25
|
-
default: () => box_zoom_default
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
26
7
|
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
+
|
|
14
|
+
var _dom = _interopRequireDefault(require("../utils/dom"));
|
|
15
|
+
|
|
16
|
+
var _event = require("./events/event");
|
|
17
|
+
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The `BoxZoomHandler` allows the user to zoom the map to fit within a bounding box.
|
|
22
|
+
* The bounding box is defined by clicking and holding `shift` while dragging the cursor.
|
|
23
|
+
*/
|
|
24
|
+
var BoxZoomHandler = /*#__PURE__*/function () {
|
|
25
|
+
/**
|
|
26
|
+
* @private
|
|
27
|
+
*/
|
|
28
|
+
function BoxZoomHandler(map, options) {
|
|
29
|
+
(0, _classCallCheck2.default)(this, BoxZoomHandler);
|
|
32
30
|
this.map = map;
|
|
33
31
|
this.el = map.getCanvasContainer();
|
|
34
32
|
this.container = map.getContainer();
|
|
35
33
|
this.clickTolerance = options.clickTolerance || 1;
|
|
36
34
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
disable() {
|
|
50
|
-
if (!this.isEnabled()) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
this.enabled = false;
|
|
54
|
-
}
|
|
55
|
-
mousedown(e, point) {
|
|
56
|
-
if (!this.isEnabled()) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
if (!(e.shiftKey && e.button === 0)) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
import_dom.default.disableDrag();
|
|
63
|
-
this.startPos = this.lastPos = point;
|
|
64
|
-
this.active = true;
|
|
65
|
-
}
|
|
66
|
-
mousemoveWindow(e, point) {
|
|
67
|
-
if (!this.active) {
|
|
68
|
-
return;
|
|
35
|
+
/**
|
|
36
|
+
* Returns a Boolean indicating whether the "box zoom" interaction is enabled.
|
|
37
|
+
*
|
|
38
|
+
* @returns {boolean} `true` if the "box zoom" interaction is enabled.
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
(0, _createClass2.default)(BoxZoomHandler, [{
|
|
43
|
+
key: "isEnabled",
|
|
44
|
+
value: function isEnabled() {
|
|
45
|
+
return !!this.enabled;
|
|
69
46
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Returns a Boolean indicating whether the "box zoom" interaction is active, i.e. currently being used.
|
|
49
|
+
*
|
|
50
|
+
* @returns {boolean} `true` if the "box zoom" interaction is active.
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
}, {
|
|
54
|
+
key: "isActive",
|
|
55
|
+
value: function isActive() {
|
|
56
|
+
return !!this.active;
|
|
73
57
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
58
|
+
/**
|
|
59
|
+
* Enables the "box zoom" interaction.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* map.boxZoom.enable();
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
}, {
|
|
66
|
+
key: "enable",
|
|
67
|
+
value: function enable() {
|
|
68
|
+
if (this.isEnabled()) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
this.enabled = true;
|
|
80
73
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
74
|
+
/**
|
|
75
|
+
* Disables the "box zoom" interaction.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* map.boxZoom.disable();
|
|
79
|
+
*/
|
|
80
|
+
|
|
81
|
+
}, {
|
|
82
|
+
key: "disable",
|
|
83
|
+
value: function disable() {
|
|
84
|
+
if (!this.isEnabled()) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
this.enabled = false;
|
|
89
89
|
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
}, {
|
|
91
|
+
key: "mousedown",
|
|
92
|
+
value: function mousedown(e, point) {
|
|
93
|
+
if (!this.isEnabled()) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (!(e.shiftKey && e.button === 0)) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
_dom.default.disableDrag();
|
|
102
|
+
|
|
103
|
+
this.startPos = this.lastPos = point;
|
|
104
|
+
this.active = true;
|
|
94
105
|
}
|
|
95
|
-
|
|
96
|
-
|
|
106
|
+
}, {
|
|
107
|
+
key: "mousemoveWindow",
|
|
108
|
+
value: function mousemoveWindow(e, point) {
|
|
109
|
+
if (!this.active) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
var pos = point;
|
|
114
|
+
|
|
115
|
+
if (this.lastPos.equals(pos) || !this.box && pos.dist(this.startPos) < this.clickTolerance) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
var p0 = this.startPos;
|
|
120
|
+
this.lastPos = pos;
|
|
121
|
+
|
|
122
|
+
if (!this.box) {
|
|
123
|
+
this.box = _dom.default.create('div', 'l7-boxzoom', this.container);
|
|
124
|
+
this.container.classList.add('l7-crosshair');
|
|
125
|
+
this.fireEvent('boxzoomstart', e);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
var minX = Math.min(p0.x, pos.x);
|
|
129
|
+
var maxX = Math.max(p0.x, pos.x);
|
|
130
|
+
var minY = Math.min(p0.y, pos.y);
|
|
131
|
+
var maxY = Math.max(p0.y, pos.y);
|
|
132
|
+
|
|
133
|
+
_dom.default.setTransform(this.box, "translate(".concat(minX, "px,").concat(minY, "px)"));
|
|
134
|
+
|
|
135
|
+
if (this.box) {
|
|
136
|
+
this.box.style.width = "".concat(maxX - minX, "px");
|
|
137
|
+
this.box.style.height = "".concat(maxY - minY, "px");
|
|
138
|
+
}
|
|
97
139
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
this.
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
140
|
+
}, {
|
|
141
|
+
key: "mouseupWindow",
|
|
142
|
+
value: function mouseupWindow(e, point) {
|
|
143
|
+
var _this = this;
|
|
144
|
+
|
|
145
|
+
if (!this.active) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (e.button !== 0) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
var p0 = this.startPos;
|
|
154
|
+
var p1 = point;
|
|
155
|
+
this.reset();
|
|
156
|
+
|
|
157
|
+
_dom.default.suppressClick();
|
|
158
|
+
|
|
159
|
+
if (p0.x === p1.x && p0.y === p1.y) {
|
|
160
|
+
this.fireEvent('boxzoomcancel', e);
|
|
161
|
+
} else {
|
|
162
|
+
this.map.emit('boxzoomend', new _event.Event('boxzoomend', {
|
|
163
|
+
originalEvent: e
|
|
164
|
+
}));
|
|
165
|
+
return {
|
|
166
|
+
cameraAnimation: function cameraAnimation(map) {
|
|
167
|
+
return map.fitScreenCoordinates(p0, p1, _this.map.getBearing(), {
|
|
168
|
+
linear: true
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
}
|
|
111
173
|
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
174
|
+
}, {
|
|
175
|
+
key: "keydown",
|
|
176
|
+
value: function keydown(e) {
|
|
177
|
+
if (!this.active) {
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
if (e.keyCode === 27) {
|
|
182
|
+
this.reset();
|
|
183
|
+
this.fireEvent('boxzoomcancel', e);
|
|
184
|
+
}
|
|
116
185
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
186
|
+
}, {
|
|
187
|
+
key: "reset",
|
|
188
|
+
value: function reset() {
|
|
189
|
+
this.active = false;
|
|
190
|
+
this.container.classList.remove('l7-crosshair');
|
|
191
|
+
|
|
192
|
+
if (this.box) {
|
|
193
|
+
_dom.default.remove(this.box);
|
|
194
|
+
|
|
195
|
+
this.box = null;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
_dom.default.enableDrag(); // @ts-ignore
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
delete this.startPos; // @ts-ignore
|
|
202
|
+
|
|
203
|
+
delete this.lastPos;
|
|
120
204
|
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
this.box = null;
|
|
205
|
+
}, {
|
|
206
|
+
key: "fireEvent",
|
|
207
|
+
value: function fireEvent(type, e) {
|
|
208
|
+
return this.map.emit(type, new _event.Event(type, {
|
|
209
|
+
originalEvent: e
|
|
210
|
+
}));
|
|
128
211
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
var box_zoom_default = BoxZoomHandler;
|
|
138
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
139
|
-
0 && (module.exports = {});
|
|
212
|
+
}]);
|
|
213
|
+
return BoxZoomHandler;
|
|
214
|
+
}();
|
|
215
|
+
|
|
216
|
+
var _default = BoxZoomHandler;
|
|
217
|
+
exports.default = _default;
|
|
@@ -1,59 +1,67 @@
|
|
|
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(click_zoom_exports, {
|
|
22
|
-
default: () => ClickZoomHandler
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
23
7
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return {
|
|
35
|
-
cameraAnimation: (map) => {
|
|
36
|
-
map.easeTo({
|
|
37
|
-
duration: 300,
|
|
38
|
-
zoom: map.getZoom() + (e.shiftKey ? -1 : 1),
|
|
39
|
-
around: map.unproject(point)
|
|
40
|
-
}, { originalEvent: e });
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
enable() {
|
|
45
|
-
this.enabled = true;
|
|
46
|
-
}
|
|
47
|
-
disable() {
|
|
48
|
-
this.enabled = false;
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
+
|
|
14
|
+
// @ts-ignore
|
|
15
|
+
var ClickZoomHandler = /*#__PURE__*/function () {
|
|
16
|
+
function ClickZoomHandler() {
|
|
17
|
+
(0, _classCallCheck2.default)(this, ClickZoomHandler);
|
|
49
18
|
this.reset();
|
|
50
19
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
20
|
+
|
|
21
|
+
(0, _createClass2.default)(ClickZoomHandler, [{
|
|
22
|
+
key: "reset",
|
|
23
|
+
value: function reset() {
|
|
24
|
+
this.active = false;
|
|
25
|
+
}
|
|
26
|
+
}, {
|
|
27
|
+
key: "dblclick",
|
|
28
|
+
value: function dblclick(e, point) {
|
|
29
|
+
e.preventDefault();
|
|
30
|
+
return {
|
|
31
|
+
cameraAnimation: function cameraAnimation(map) {
|
|
32
|
+
map.easeTo({
|
|
33
|
+
duration: 300,
|
|
34
|
+
zoom: map.getZoom() + (e.shiftKey ? -1 : 1),
|
|
35
|
+
around: map.unproject(point)
|
|
36
|
+
}, {
|
|
37
|
+
originalEvent: e
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}, {
|
|
43
|
+
key: "enable",
|
|
44
|
+
value: function enable() {
|
|
45
|
+
this.enabled = true;
|
|
46
|
+
}
|
|
47
|
+
}, {
|
|
48
|
+
key: "disable",
|
|
49
|
+
value: function disable() {
|
|
50
|
+
this.enabled = false;
|
|
51
|
+
this.reset();
|
|
52
|
+
}
|
|
53
|
+
}, {
|
|
54
|
+
key: "isEnabled",
|
|
55
|
+
value: function isEnabled() {
|
|
56
|
+
return this.enabled;
|
|
57
|
+
}
|
|
58
|
+
}, {
|
|
59
|
+
key: "isActive",
|
|
60
|
+
value: function isActive() {
|
|
61
|
+
return this.active;
|
|
62
|
+
}
|
|
63
|
+
}]);
|
|
64
|
+
return ClickZoomHandler;
|
|
65
|
+
}();
|
|
66
|
+
|
|
67
|
+
exports.default = ClickZoomHandler;
|