@antv/l7-map 2.17.12 → 2.18.2

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.
Files changed (168) hide show
  1. package/package.json +4 -4
  2. package/es/camera.d.ts +0 -85
  3. package/es/camera.js +0 -775
  4. package/es/css/l7.css +0 -98
  5. package/es/earthmap.d.ts +0 -66
  6. package/es/earthmap.js +0 -422
  7. package/es/geo/edge_insets.d.ts +0 -54
  8. package/es/geo/edge_insets.js +0 -118
  9. package/es/geo/lng_lat.d.ts +0 -18
  10. package/es/geo/lng_lat.js +0 -81
  11. package/es/geo/lng_lat_bounds.d.ts +0 -24
  12. package/es/geo/lng_lat_bounds.js +0 -167
  13. package/es/geo/mercator.d.ts +0 -29
  14. package/es/geo/mercator.js +0 -92
  15. package/es/geo/point.d.ts +0 -40
  16. package/es/geo/point.js +0 -231
  17. package/es/geo/simple.d.ts +0 -29
  18. package/es/geo/simple.js +0 -92
  19. package/es/geo/transform.d.ts +0 -198
  20. package/es/geo/transform.js +0 -971
  21. package/es/handler/IHandler.d.ts +0 -34
  22. package/es/handler/IHandler.js +0 -1
  23. package/es/handler/blockable_map_event.d.ts +0 -17
  24. package/es/handler/blockable_map_event.js +0 -83
  25. package/es/handler/box_zoom.d.ts +0 -59
  26. package/es/handler/box_zoom.js +0 -200
  27. package/es/handler/click_zoom.d.ts +0 -16
  28. package/es/handler/click_zoom.js +0 -59
  29. package/es/handler/events/event.d.ts +0 -4
  30. package/es/handler/events/event.js +0 -12
  31. package/es/handler/events/index.d.ts +0 -4
  32. package/es/handler/events/index.js +0 -4
  33. package/es/handler/events/map_mouse_event.d.ts +0 -34
  34. package/es/handler/events/map_mouse_event.js +0 -75
  35. package/es/handler/events/map_touch_event.d.ts +0 -57
  36. package/es/handler/events/map_touch_event.js +0 -105
  37. package/es/handler/events/map_wheel_event.d.ts +0 -33
  38. package/es/handler/events/map_wheel_event.js +0 -61
  39. package/es/handler/events/render_event.d.ts +0 -5
  40. package/es/handler/events/render_event.js +0 -39
  41. package/es/handler/handler_inertia.d.ts +0 -23
  42. package/es/handler/handler_inertia.js +0 -184
  43. package/es/handler/handler_manager.d.ts +0 -61
  44. package/es/handler/handler_manager.js +0 -684
  45. package/es/handler/handler_util.d.ts +0 -4
  46. package/es/handler/handler_util.js +0 -10
  47. package/es/handler/keyboard.d.ts +0 -36
  48. package/es/handler/keyboard.js +0 -162
  49. package/es/handler/map_event.d.ts +0 -29
  50. package/es/handler/map_event.js +0 -131
  51. package/es/handler/mouse/index.d.ts +0 -4
  52. package/es/handler/mouse/index.js +0 -4
  53. package/es/handler/mouse/mouse_handler.d.ts +0 -22
  54. package/es/handler/mouse/mouse_handler.js +0 -131
  55. package/es/handler/mouse/mousepan_handler.d.ts +0 -10
  56. package/es/handler/mouse/mousepan_handler.js +0 -54
  57. package/es/handler/mouse/mousepitch_hander.d.ts +0 -9
  58. package/es/handler/mouse/mousepitch_hander.js +0 -56
  59. package/es/handler/mouse/mouserotate_hander.d.ts +0 -9
  60. package/es/handler/mouse/mouserotate_hander.js +0 -56
  61. package/es/handler/mouse/util.d.ts +0 -6
  62. package/es/handler/mouse/util.js +0 -12
  63. package/es/handler/scroll_zoom.d.ts +0 -93
  64. package/es/handler/scroll_zoom.js +0 -353
  65. package/es/handler/shim/dblclick_zoom.d.ts +0 -40
  66. package/es/handler/shim/dblclick_zoom.js +0 -72
  67. package/es/handler/shim/drag_pan.d.ts +0 -61
  68. package/es/handler/shim/drag_pan.js +0 -96
  69. package/es/handler/shim/drag_rotate.d.ts +0 -46
  70. package/es/handler/shim/drag_rotate.js +0 -80
  71. package/es/handler/shim/touch_zoom_rotate.d.ts +0 -70
  72. package/es/handler/shim/touch_zoom_rotate.js +0 -130
  73. package/es/handler/tap/single_tap_recognizer.d.ts +0 -20
  74. package/es/handler/tap/single_tap_recognizer.js +0 -120
  75. package/es/handler/tap/tap_drag_zoom.d.ts +0 -22
  76. package/es/handler/tap/tap_drag_zoom.js +0 -114
  77. package/es/handler/tap/tap_recognizer.d.ts +0 -17
  78. package/es/handler/tap/tap_recognizer.js +0 -62
  79. package/es/handler/tap/tap_zoom.d.ts +0 -22
  80. package/es/handler/tap/tap_zoom.js +0 -115
  81. package/es/handler/touch/index.d.ts +0 -5
  82. package/es/handler/touch/index.js +0 -5
  83. package/es/handler/touch/touch_pan.d.ts +0 -30
  84. package/es/handler/touch/touch_pan.js +0 -128
  85. package/es/handler/touch/touch_pitch.d.ts +0 -13
  86. package/es/handler/touch/touch_pitch.js +0 -110
  87. package/es/handler/touch/touch_rotate.d.ts +0 -12
  88. package/es/handler/touch/touch_rotate.js +0 -88
  89. package/es/handler/touch/touch_zoom.d.ts +0 -12
  90. package/es/handler/touch/touch_zoom.js +0 -67
  91. package/es/handler/touch/two_touch.d.ts +0 -23
  92. package/es/handler/touch/two_touch.js +0 -138
  93. package/es/hash.d.ts +0 -14
  94. package/es/hash.js +0 -156
  95. package/es/index.d.ts +0 -4
  96. package/es/index.js +0 -4
  97. package/es/interface.d.ts +0 -34
  98. package/es/interface.js +0 -1
  99. package/es/map.d.ts +0 -70
  100. package/es/map.js +0 -464
  101. package/es/util.d.ts +0 -25
  102. package/es/util.js +0 -101
  103. package/es/utils/Aabb.d.ts +0 -12
  104. package/es/utils/Aabb.js +0 -133
  105. package/es/utils/dom.d.ts +0 -4
  106. package/es/utils/dom.js +0 -218
  107. package/es/utils/performance.d.ts +0 -17
  108. package/es/utils/performance.js +0 -62
  109. package/es/utils/primitives.d.ts +0 -6
  110. package/es/utils/primitives.js +0 -45
  111. package/es/utils/task_queue.d.ts +0 -13
  112. package/es/utils/task_queue.js +0 -106
  113. package/lib/camera.js +0 -801
  114. package/lib/css/l7.css +0 -98
  115. package/lib/earthmap.js +0 -445
  116. package/lib/geo/edge_insets.js +0 -129
  117. package/lib/geo/lng_lat.js +0 -94
  118. package/lib/geo/lng_lat_bounds.js +0 -177
  119. package/lib/geo/mercator.js +0 -121
  120. package/lib/geo/point.js +0 -239
  121. package/lib/geo/simple.js +0 -123
  122. package/lib/geo/transform.js +0 -1013
  123. package/lib/handler/IHandler.js +0 -5
  124. package/lib/handler/blockable_map_event.js +0 -92
  125. package/lib/handler/box_zoom.js +0 -217
  126. package/lib/handler/click_zoom.js +0 -67
  127. package/lib/handler/events/event.js +0 -23
  128. package/lib/handler/events/index.js +0 -31
  129. package/lib/handler/events/map_mouse_event.js +0 -87
  130. package/lib/handler/events/map_touch_event.js +0 -119
  131. package/lib/handler/events/map_wheel_event.js +0 -72
  132. package/lib/handler/events/render_event.js +0 -52
  133. package/lib/handler/handler_inertia.js +0 -193
  134. package/lib/handler/handler_manager.js +0 -714
  135. package/lib/handler/handler_util.js +0 -17
  136. package/lib/handler/keyboard.js +0 -172
  137. package/lib/handler/map_event.js +0 -140
  138. package/lib/handler/mouse/index.js +0 -31
  139. package/lib/handler/mouse/mouse_handler.js +0 -141
  140. package/lib/handler/mouse/mousepan_handler.js +0 -66
  141. package/lib/handler/mouse/mousepitch_hander.js +0 -67
  142. package/lib/handler/mouse/mouserotate_hander.js +0 -67
  143. package/lib/handler/mouse/util.js +0 -26
  144. package/lib/handler/scroll_zoom.js +0 -367
  145. package/lib/handler/shim/dblclick_zoom.js +0 -80
  146. package/lib/handler/shim/drag_pan.js +0 -105
  147. package/lib/handler/shim/drag_rotate.js +0 -88
  148. package/lib/handler/shim/touch_zoom_rotate.js +0 -139
  149. package/lib/handler/tap/single_tap_recognizer.js +0 -131
  150. package/lib/handler/tap/tap_drag_zoom.js +0 -124
  151. package/lib/handler/tap/tap_recognizer.js +0 -78
  152. package/lib/handler/tap/tap_zoom.js +0 -124
  153. package/lib/handler/touch/index.js +0 -39
  154. package/lib/handler/touch/touch_pan.js +0 -138
  155. package/lib/handler/touch/touch_pitch.js +0 -120
  156. package/lib/handler/touch/touch_rotate.js +0 -99
  157. package/lib/handler/touch/touch_zoom.js +0 -78
  158. package/lib/handler/touch/two_touch.js +0 -148
  159. package/lib/hash.js +0 -169
  160. package/lib/index.js +0 -57
  161. package/lib/interface.js +0 -5
  162. package/lib/map.js +0 -489
  163. package/lib/util.js +0 -135
  164. package/lib/utils/Aabb.js +0 -143
  165. package/lib/utils/dom.js +0 -233
  166. package/lib/utils/performance.js +0 -72
  167. package/lib/utils/primitives.js +0 -57
  168. package/lib/utils/task_queue.js +0 -115
@@ -1,36 +0,0 @@
1
- import { EarthMap } from '../earthmap';
2
- import { Map } from '../map';
3
- /**
4
- * The `KeyboardHandler` allows the user to zoom, rotate, and pan the map using
5
- * the following keyboard shortcuts:
6
- *
7
- * - `=` / `+`: Increase the zoom level by 1.
8
- * - `Shift-=` / `Shift-+`: Increase the zoom level by 2.
9
- * - `-`: Decrease the zoom level by 1.
10
- * - `Shift--`: Decrease the zoom level by 2.
11
- * - Arrow keys: Pan by 100 pixels.
12
- * - `Shift+⇢`: Increase the rotation by 15 degrees.
13
- * - `Shift+⇠`: Decrease the rotation by 15 degrees.
14
- * - `Shift+⇡`: Increase the pitch by 10 degrees.
15
- * - `Shift+⇣`: Decrease the pitch by 10 degrees.
16
- */
17
- declare class KeyboardHandler {
18
- private enabled;
19
- private active;
20
- private panStep;
21
- private bearingStep;
22
- private pitchStep;
23
- /**
24
- * @private
25
- */
26
- constructor();
27
- reset(): void;
28
- keydown(e: KeyboardEvent): {
29
- cameraAnimation: (map: Map | EarthMap) => void;
30
- } | undefined;
31
- enable(): void;
32
- disable(): void;
33
- isEnabled(): boolean;
34
- isActive(): boolean;
35
- }
36
- export default KeyboardHandler;
@@ -1,162 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- var defaultOptions = {
4
- panStep: 100,
5
- bearingStep: 15,
6
- pitchStep: 10
7
- };
8
- /**
9
- * The `KeyboardHandler` allows the user to zoom, rotate, and pan the map using
10
- * the following keyboard shortcuts:
11
- *
12
- * - `=` / `+`: Increase the zoom level by 1.
13
- * - `Shift-=` / `Shift-+`: Increase the zoom level by 2.
14
- * - `-`: Decrease the zoom level by 1.
15
- * - `Shift--`: Decrease the zoom level by 2.
16
- * - Arrow keys: Pan by 100 pixels.
17
- * - `Shift+⇢`: Increase the rotation by 15 degrees.
18
- * - `Shift+⇠`: Decrease the rotation by 15 degrees.
19
- * - `Shift+⇡`: Increase the pitch by 10 degrees.
20
- * - `Shift+⇣`: Decrease the pitch by 10 degrees.
21
- */
22
-
23
- var KeyboardHandler = /*#__PURE__*/function () {
24
- /**
25
- * @private
26
- */
27
- function KeyboardHandler() {
28
- _classCallCheck(this, KeyboardHandler);
29
-
30
- var stepOptions = defaultOptions;
31
- this.panStep = stepOptions.panStep;
32
- this.bearingStep = stepOptions.bearingStep;
33
- this.pitchStep = stepOptions.pitchStep;
34
- }
35
-
36
- _createClass(KeyboardHandler, [{
37
- key: "reset",
38
- value: function reset() {
39
- this.active = false;
40
- }
41
- }, {
42
- key: "keydown",
43
- value: function keydown(e) {
44
- var _this = this;
45
-
46
- if (e.altKey || e.ctrlKey || e.metaKey) {
47
- return;
48
- }
49
-
50
- var zoomDir = 0;
51
- var bearingDir = 0;
52
- var pitchDir = 0;
53
- var xDir = 0;
54
- var yDir = 0;
55
-
56
- switch (e.keyCode) {
57
- case 61:
58
- case 107:
59
- case 171:
60
- case 187:
61
- zoomDir = 1;
62
- break;
63
-
64
- case 189:
65
- case 109:
66
- case 173:
67
- zoomDir = -1;
68
- break;
69
-
70
- case 37:
71
- if (e.shiftKey) {
72
- bearingDir = -1;
73
- } else {
74
- e.preventDefault();
75
- xDir = -1;
76
- }
77
-
78
- break;
79
-
80
- case 39:
81
- if (e.shiftKey) {
82
- bearingDir = 1;
83
- } else {
84
- e.preventDefault();
85
- xDir = 1;
86
- }
87
-
88
- break;
89
-
90
- case 38:
91
- if (e.shiftKey) {
92
- pitchDir = 1;
93
- } else {
94
- e.preventDefault();
95
- yDir = -1;
96
- }
97
-
98
- break;
99
-
100
- case 40:
101
- if (e.shiftKey) {
102
- pitchDir = -1;
103
- } else {
104
- e.preventDefault();
105
- yDir = 1;
106
- }
107
-
108
- break;
109
-
110
- default:
111
- return;
112
- }
113
-
114
- return {
115
- cameraAnimation: function cameraAnimation(map) {
116
- var zoom = map.getZoom();
117
- map.easeTo({
118
- duration: 300,
119
- easeId: 'keyboardHandler',
120
- easing: easeOut,
121
- zoom: zoomDir ? Math.round(zoom) + zoomDir * (e.shiftKey ? 2 : 1) : zoom,
122
- bearing: map.getBearing() + bearingDir * _this.bearingStep,
123
- pitch: map.getPitch() + pitchDir * _this.pitchStep,
124
- offset: [-xDir * _this.panStep, -yDir * _this.panStep],
125
- center: map.getCenter()
126
- }, {
127
- originalEvent: e
128
- });
129
- }
130
- };
131
- }
132
- }, {
133
- key: "enable",
134
- value: function enable() {
135
- this.enabled = true;
136
- }
137
- }, {
138
- key: "disable",
139
- value: function disable() {
140
- this.enabled = false;
141
- this.reset();
142
- }
143
- }, {
144
- key: "isEnabled",
145
- value: function isEnabled() {
146
- return this.enabled;
147
- }
148
- }, {
149
- key: "isActive",
150
- value: function isActive() {
151
- return this.active;
152
- }
153
- }]);
154
-
155
- return KeyboardHandler;
156
- }();
157
-
158
- function easeOut(t) {
159
- return t * (2 - t);
160
- }
161
-
162
- export default KeyboardHandler;
@@ -1,29 +0,0 @@
1
- import { EarthMap } from '../earthmap';
2
- import Point from '../geo/point';
3
- import { Map } from '../map';
4
- import { MapMouseEvent, MapTouchEvent, MapWheelEvent } from './events';
5
- export default class MapEventHandler {
6
- private mousedownPos;
7
- private clickTolerance;
8
- private map;
9
- constructor(map: Map | EarthMap, options: {
10
- clickTolerance: number;
11
- });
12
- reset(): void;
13
- wheel(e: WheelEvent): {} | undefined;
14
- mousedown(e: MouseEvent, point: Point): {} | undefined;
15
- mouseup(e: MouseEvent): void;
16
- click(e: MouseEvent, point: Point): void;
17
- dblclick(e: MouseEvent): {} | undefined;
18
- mouseover(e: MouseEvent): void;
19
- mouseout(e: MouseEvent): void;
20
- touchstart(e: TouchEvent): {} | undefined;
21
- touchmove(e: TouchEvent): void;
22
- touchend(e: TouchEvent): void;
23
- touchcancel(e: TouchEvent): void;
24
- firePreventable(mapEvent: MapMouseEvent | MapTouchEvent | MapWheelEvent): {} | undefined;
25
- isEnabled(): boolean;
26
- isActive(): boolean;
27
- enable(): boolean;
28
- disable(): boolean;
29
- }
@@ -1,131 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- // @ts-ignore
4
- import { MapMouseEvent, MapTouchEvent, MapWheelEvent } from "./events";
5
-
6
- var MapEventHandler = /*#__PURE__*/function () {
7
- function MapEventHandler(map, options) {
8
- _classCallCheck(this, MapEventHandler);
9
-
10
- this.map = map;
11
- this.clickTolerance = options.clickTolerance;
12
- }
13
-
14
- _createClass(MapEventHandler, [{
15
- key: "reset",
16
- value: function reset() {
17
- // @ts-ignore
18
- delete this.mousedownPos;
19
- }
20
- }, {
21
- key: "wheel",
22
- value: function wheel(e) {
23
- // If mapEvent.preventDefault() is called by the user, prevent handlers such as:
24
- // - ScrollZoom
25
- return this.firePreventable(new MapWheelEvent(e.type, this.map, e));
26
- }
27
- }, {
28
- key: "mousedown",
29
- value: function mousedown(e, point) {
30
- this.mousedownPos = point; // If mapEvent.preventDefault() is called by the user, prevent handlers such as:
31
- // - MousePan
32
- // - MouseRotate
33
- // - MousePitch
34
- // - DblclickHandler
35
-
36
- return this.firePreventable(new MapMouseEvent(e.type, this.map, e));
37
- }
38
- }, {
39
- key: "mouseup",
40
- value: function mouseup(e) {
41
- this.map.emit(e.type, new MapMouseEvent(e.type, this.map, e));
42
- }
43
- }, {
44
- key: "click",
45
- value: function click(e, point) {
46
- if (this.mousedownPos && this.mousedownPos.dist(point) >= this.clickTolerance) {
47
- return;
48
- }
49
-
50
- this.map.emit(e.type, new MapMouseEvent(e.type, this.map, e));
51
- }
52
- }, {
53
- key: "dblclick",
54
- value: function dblclick(e) {
55
- // If mapEvent.preventDefault() is called by the user, prevent handlers such as:
56
- // - DblClickZoom
57
- return this.firePreventable(new MapMouseEvent(e.type, this.map, e));
58
- }
59
- }, {
60
- key: "mouseover",
61
- value: function mouseover(e) {
62
- this.map.emit(e.type, new MapMouseEvent(e.type, this.map, e));
63
- }
64
- }, {
65
- key: "mouseout",
66
- value: function mouseout(e) {
67
- this.map.emit(e.type, new MapMouseEvent(e.type, this.map, e));
68
- }
69
- }, {
70
- key: "touchstart",
71
- value: function touchstart(e) {
72
- // If mapEvent.preventDefault() is called by the user, prevent handlers such as:
73
- // - TouchPan
74
- // - TouchZoom
75
- // - TouchRotate
76
- // - TouchPitch
77
- // - TapZoom
78
- // - SwipeZoom
79
- return this.firePreventable(new MapTouchEvent(e.type, this.map, e));
80
- }
81
- }, {
82
- key: "touchmove",
83
- value: function touchmove(e) {
84
- this.map.emit(e.type, new MapTouchEvent(e.type, this.map, e));
85
- }
86
- }, {
87
- key: "touchend",
88
- value: function touchend(e) {
89
- this.map.emit(e.type, new MapTouchEvent(e.type, this.map, e));
90
- }
91
- }, {
92
- key: "touchcancel",
93
- value: function touchcancel(e) {
94
- this.map.emit(e.type, new MapTouchEvent(e.type, this.map, e));
95
- }
96
- }, {
97
- key: "firePreventable",
98
- value: function firePreventable(mapEvent) {
99
- this.map.emit(mapEvent.type, mapEvent);
100
-
101
- if (mapEvent.defaultPrevented) {
102
- // returning an object marks the handler as active and resets other handlers
103
- return {};
104
- }
105
- }
106
- }, {
107
- key: "isEnabled",
108
- value: function isEnabled() {
109
- return true;
110
- }
111
- }, {
112
- key: "isActive",
113
- value: function isActive() {
114
- return false;
115
- }
116
- }, {
117
- key: "enable",
118
- value: function enable() {
119
- return false;
120
- }
121
- }, {
122
- key: "disable",
123
- value: function disable() {
124
- return false;
125
- }
126
- }]);
127
-
128
- return MapEventHandler;
129
- }();
130
-
131
- export { MapEventHandler as default };
@@ -1,4 +0,0 @@
1
- import MousePanHandler from './mousepan_handler';
2
- import MouseRotateHandler from './mousepitch_hander';
3
- import MousePitchHandler from './mouserotate_hander';
4
- export { MousePanHandler, MouseRotateHandler, MousePitchHandler };
@@ -1,4 +0,0 @@
1
- import MousePanHandler from "./mousepan_handler";
2
- import MouseRotateHandler from "./mousepitch_hander";
3
- import MousePitchHandler from "./mouserotate_hander";
4
- export { MousePanHandler, MouseRotateHandler, MousePitchHandler };
@@ -1,22 +0,0 @@
1
- import Point from '../../geo/point';
2
- export default class MouseHandler {
3
- protected enabled: boolean;
4
- protected active: boolean;
5
- protected lastPoint: Point;
6
- protected eventButton: 1 | 2;
7
- protected moved: boolean;
8
- protected clickTolerance: number;
9
- constructor(options: {
10
- clickTolerance: number;
11
- });
12
- reset(): void;
13
- mousedown(e: MouseEvent, point: Point): void;
14
- mousemoveWindow(e: MouseEvent, point: Point): void;
15
- mouseupWindow(e: MouseEvent): void;
16
- enable(): void;
17
- disable(): void;
18
- isEnabled(): boolean;
19
- isActive(): boolean;
20
- protected correctButton(e: MouseEvent, button: number): boolean;
21
- protected move(lastPoint: Point, point: Point): void;
22
- }
@@ -1,131 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- // @ts-ignore
4
- import DOM from "../../utils/dom";
5
- import { buttonStillPressed } from "./util";
6
-
7
- var MouseHandler = /*#__PURE__*/function () {
8
- function MouseHandler(options) {
9
- _classCallCheck(this, MouseHandler);
10
-
11
- this.reset();
12
- this.clickTolerance = options.clickTolerance || 1;
13
- }
14
-
15
- _createClass(MouseHandler, [{
16
- key: "reset",
17
- value: function reset() {
18
- this.active = false;
19
- this.moved = false; // @ts-ignore
20
-
21
- delete this.lastPoint; // @ts-ignore
22
-
23
- delete this.eventButton;
24
- }
25
- }, {
26
- key: "mousedown",
27
- value: function mousedown(e, point) {
28
- if (this.lastPoint) {
29
- return;
30
- }
31
-
32
- var eventButton = DOM.mouseButton(e);
33
-
34
- if (!this.correctButton(e, eventButton)) {
35
- return;
36
- }
37
-
38
- this.lastPoint = point;
39
- this.eventButton = eventButton;
40
- }
41
- }, {
42
- key: "mousemoveWindow",
43
- value: function mousemoveWindow(e, point) {
44
- var lastPoint = this.lastPoint;
45
-
46
- if (!lastPoint) {
47
- return;
48
- }
49
-
50
- e.preventDefault();
51
-
52
- if (buttonStillPressed(e, this.eventButton)) {
53
- // Some browsers don't fire a `mouseup` when the mouseup occurs outside
54
- // the window or iframe:
55
- // https://github.com/mapbox/mapbox-gl-js/issues/4622
56
- //
57
- // If the button is no longer pressed during this `mousemove` it may have
58
- // been released outside of the window or iframe.
59
- this.reset();
60
- return;
61
- }
62
-
63
- if (!this.moved && point.dist(lastPoint) < this.clickTolerance) {
64
- return;
65
- }
66
-
67
- this.moved = true;
68
- this.lastPoint = point; // implemented by child class
69
-
70
- return this.move(lastPoint, point);
71
- }
72
- }, {
73
- key: "mouseupWindow",
74
- value: function mouseupWindow(e) {
75
- if (!this.lastPoint) {
76
- return;
77
- }
78
-
79
- var eventButton = DOM.mouseButton(e);
80
-
81
- if (eventButton !== this.eventButton) {
82
- return;
83
- }
84
-
85
- if (this.moved) {
86
- DOM.suppressClick();
87
- }
88
-
89
- this.reset();
90
- }
91
- }, {
92
- key: "enable",
93
- value: function enable() {
94
- this.enabled = true;
95
- }
96
- }, {
97
- key: "disable",
98
- value: function disable() {
99
- this.enabled = false;
100
- this.reset();
101
- }
102
- }, {
103
- key: "isEnabled",
104
- value: function isEnabled() {
105
- return this.enabled;
106
- }
107
- }, {
108
- key: "isActive",
109
- value: function isActive() {
110
- return this.active;
111
- } // eslint-disable-next-line @typescript-eslint/no-unused-vars
112
-
113
- }, {
114
- key: "correctButton",
115
- value: function correctButton(e, button) {
116
- // eslint-disable-line
117
- return false; // implemented by child
118
- } // eslint-disable-next-line @typescript-eslint/no-unused-vars
119
-
120
- }, {
121
- key: "move",
122
- value: function move(lastPoint, point) {
123
- // eslint-disable-line
124
- return; // implemented by child
125
- }
126
- }]);
127
-
128
- return MouseHandler;
129
- }();
130
-
131
- export { MouseHandler as default };
@@ -1,10 +0,0 @@
1
- import Point from '../../geo/point';
2
- import MouseHandler from './mouse_handler';
3
- export default class MousePanHandler extends MouseHandler {
4
- mousedown(e: MouseEvent, point: Point): void;
5
- move(lastPoint: Point, point: Point): {
6
- around: Point;
7
- panDelta: Point;
8
- };
9
- protected correctButton(e: MouseEvent, button: number): boolean;
10
- }
@@ -1,54 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- import _get from "@babel/runtime/helpers/esm/get";
4
- import _inherits from "@babel/runtime/helpers/esm/inherits";
5
- import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
6
- import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
7
-
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); }; }
9
-
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
-
12
- // @ts-ignore
13
- import MouseHandler from "./mouse_handler";
14
- import { LEFT_BUTTON } from "./util";
15
-
16
- var MousePanHandler = /*#__PURE__*/function (_MouseHandler) {
17
- _inherits(MousePanHandler, _MouseHandler);
18
-
19
- var _super = _createSuper(MousePanHandler);
20
-
21
- function MousePanHandler() {
22
- _classCallCheck(this, MousePanHandler);
23
-
24
- return _super.apply(this, arguments);
25
- }
26
-
27
- _createClass(MousePanHandler, [{
28
- key: "mousedown",
29
- value: function mousedown(e, point) {
30
- _get(_getPrototypeOf(MousePanHandler.prototype), "mousedown", this).call(this, e, point);
31
-
32
- if (this.lastPoint) {
33
- this.active = true;
34
- }
35
- }
36
- }, {
37
- key: "move",
38
- value: function move(lastPoint, point) {
39
- return {
40
- around: point,
41
- panDelta: point.sub(lastPoint)
42
- };
43
- }
44
- }, {
45
- key: "correctButton",
46
- value: function correctButton(e, button) {
47
- return button === LEFT_BUTTON && !e.ctrlKey;
48
- }
49
- }]);
50
-
51
- return MousePanHandler;
52
- }(MouseHandler);
53
-
54
- export { MousePanHandler as default };
@@ -1,9 +0,0 @@
1
- import Point from '../../geo/point';
2
- import MouseHandler from './mouse_handler';
3
- export default class MousePitchHandler extends MouseHandler {
4
- correctButton(e: MouseEvent, button: number): boolean;
5
- move(lastPoint: Point, point: Point): {
6
- pitchDelta: number;
7
- } | undefined;
8
- contextmenu(e: MouseEvent): void;
9
- }
@@ -1,56 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- import _inherits from "@babel/runtime/helpers/esm/inherits";
4
- import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
5
- import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
6
-
7
- 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); }; }
8
-
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
-
11
- // @ts-ignore
12
- import MouseHandler from "./mouse_handler";
13
- import { LEFT_BUTTON, RIGHT_BUTTON } from "./util";
14
-
15
- var MousePitchHandler = /*#__PURE__*/function (_MouseHandler) {
16
- _inherits(MousePitchHandler, _MouseHandler);
17
-
18
- var _super = _createSuper(MousePitchHandler);
19
-
20
- function MousePitchHandler() {
21
- _classCallCheck(this, MousePitchHandler);
22
-
23
- return _super.apply(this, arguments);
24
- }
25
-
26
- _createClass(MousePitchHandler, [{
27
- key: "correctButton",
28
- value: function correctButton(e, button) {
29
- return button === LEFT_BUTTON && e.ctrlKey || button === RIGHT_BUTTON;
30
- }
31
- }, {
32
- key: "move",
33
- value: function move(lastPoint, point) {
34
- var degreesPerPixelMoved = -0.5;
35
- var pitchDelta = (point.y - lastPoint.y) * degreesPerPixelMoved;
36
-
37
- if (pitchDelta) {
38
- this.active = true;
39
- return {
40
- pitchDelta: pitchDelta
41
- };
42
- }
43
- }
44
- }, {
45
- key: "contextmenu",
46
- value: function contextmenu(e) {
47
- // prevent browser context menu when necessary; we don't allow it with rotation
48
- // because we can't discern rotation gesture start from contextmenu on Mac
49
- e.preventDefault();
50
- }
51
- }]);
52
-
53
- return MousePitchHandler;
54
- }(MouseHandler);
55
-
56
- export { MousePitchHandler as default };
@@ -1,9 +0,0 @@
1
- import Point from '../../geo/point';
2
- import MouseHandler from './mouse_handler';
3
- export default class MouseRotateHandler extends MouseHandler {
4
- contextmenu(e: MouseEvent): void;
5
- protected correctButton(e: MouseEvent, button: number): boolean;
6
- protected move(lastPoint: Point, point: Point): {
7
- bearingDelta: number;
8
- } | undefined;
9
- }