@antv/l7-map 2.18.0 → 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 +3 -3
  2. package/es/camera.d.ts +0 -85
  3. package/es/camera.js +0 -718
  4. package/es/css/l7.css +0 -98
  5. package/es/earthmap.d.ts +0 -66
  6. package/es/earthmap.js +0 -369
  7. package/es/geo/edge_insets.d.ts +0 -54
  8. package/es/geo/edge_insets.js +0 -108
  9. package/es/geo/lng_lat.d.ts +0 -18
  10. package/es/geo/lng_lat.js +0 -73
  11. package/es/geo/lng_lat_bounds.d.ts +0 -24
  12. package/es/geo/lng_lat_bounds.js +0 -154
  13. package/es/geo/mercator.d.ts +0 -29
  14. package/es/geo/mercator.js +0 -84
  15. package/es/geo/point.d.ts +0 -40
  16. package/es/geo/point.js +0 -224
  17. package/es/geo/simple.d.ts +0 -29
  18. package/es/geo/simple.js +0 -87
  19. package/es/geo/transform.d.ts +0 -198
  20. package/es/geo/transform.js +0 -961
  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 -78
  25. package/es/handler/box_zoom.d.ts +0 -59
  26. package/es/handler/box_zoom.js +0 -180
  27. package/es/handler/click_zoom.d.ts +0 -16
  28. package/es/handler/click_zoom.js +0 -54
  29. package/es/handler/events/event.d.ts +0 -4
  30. package/es/handler/events/event.js +0 -11
  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 -64
  35. package/es/handler/events/map_touch_event.d.ts +0 -57
  36. package/es/handler/events/map_touch_event.js +0 -95
  37. package/es/handler/events/map_wheel_event.d.ts +0 -33
  38. package/es/handler/events/map_wheel_event.js +0 -50
  39. package/es/handler/events/render_event.d.ts +0 -5
  40. package/es/handler/events/render_event.js +0 -26
  41. package/es/handler/handler_inertia.d.ts +0 -23
  42. package/es/handler/handler_inertia.js +0 -157
  43. package/es/handler/handler_manager.d.ts +0 -61
  44. package/es/handler/handler_manager.js +0 -577
  45. package/es/handler/handler_util.d.ts +0 -4
  46. package/es/handler/handler_util.js +0 -9
  47. package/es/handler/keyboard.d.ts +0 -36
  48. package/es/handler/keyboard.js +0 -143
  49. package/es/handler/map_event.d.ts +0 -29
  50. package/es/handler/map_event.js +0 -125
  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 -118
  55. package/es/handler/mouse/mousepan_handler.d.ts +0 -10
  56. package/es/handler/mouse/mousepan_handler.js +0 -44
  57. package/es/handler/mouse/mousepitch_hander.d.ts +0 -9
  58. package/es/handler/mouse/mousepitch_hander.js +0 -46
  59. package/es/handler/mouse/mouserotate_hander.d.ts +0 -9
  60. package/es/handler/mouse/mouserotate_hander.js +0 -46
  61. package/es/handler/mouse/util.d.ts +0 -6
  62. package/es/handler/mouse/util.js +0 -11
  63. package/es/handler/scroll_zoom.d.ts +0 -93
  64. package/es/handler/scroll_zoom.js +0 -325
  65. package/es/handler/shim/dblclick_zoom.d.ts +0 -40
  66. package/es/handler/shim/dblclick_zoom.js +0 -67
  67. package/es/handler/shim/drag_pan.d.ts +0 -61
  68. package/es/handler/shim/drag_pan.js +0 -84
  69. package/es/handler/shim/drag_rotate.d.ts +0 -46
  70. package/es/handler/shim/drag_rotate.js +0 -74
  71. package/es/handler/shim/touch_zoom_rotate.d.ts +0 -70
  72. package/es/handler/shim/touch_zoom_rotate.js +0 -115
  73. package/es/handler/tap/single_tap_recognizer.d.ts +0 -20
  74. package/es/handler/tap/single_tap_recognizer.js +0 -97
  75. package/es/handler/tap/tap_drag_zoom.d.ts +0 -22
  76. package/es/handler/tap/tap_drag_zoom.js +0 -106
  77. package/es/handler/tap/tap_recognizer.d.ts +0 -17
  78. package/es/handler/tap/tap_recognizer.js +0 -54
  79. package/es/handler/tap/tap_zoom.d.ts +0 -22
  80. package/es/handler/tap/tap_zoom.js +0 -109
  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 -110
  85. package/es/handler/touch/touch_pitch.d.ts +0 -13
  86. package/es/handler/touch/touch_pitch.js +0 -93
  87. package/es/handler/touch/touch_rotate.d.ts +0 -12
  88. package/es/handler/touch/touch_rotate.js +0 -77
  89. package/es/handler/touch/touch_zoom.d.ts +0 -12
  90. package/es/handler/touch/touch_zoom.js +0 -54
  91. package/es/handler/touch/two_touch.d.ts +0 -23
  92. package/es/handler/touch/two_touch.js +0 -125
  93. package/es/hash.d.ts +0 -14
  94. package/es/hash.js +0 -134
  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 -387
  101. package/es/util.d.ts +0 -25
  102. package/es/util.js +0 -88
  103. package/es/utils/Aabb.d.ts +0 -12
  104. package/es/utils/Aabb.js +0 -112
  105. package/es/utils/dom.d.ts +0 -4
  106. package/es/utils/dom.js +0 -140
  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 -47
  111. package/es/utils/task_queue.d.ts +0 -13
  112. package/es/utils/task_queue.js +0 -89
  113. package/lib/camera.js +0 -724
  114. package/lib/css/l7.css +0 -98
  115. package/lib/earthmap.js +0 -376
  116. package/lib/geo/edge_insets.js +0 -114
  117. package/lib/geo/lng_lat.js +0 -81
  118. package/lib/geo/lng_lat_bounds.js +0 -161
  119. package/lib/geo/mercator.js +0 -100
  120. package/lib/geo/point.js +0 -231
  121. package/lib/geo/simple.js +0 -104
  122. package/lib/geo/transform.js +0 -971
  123. package/lib/handler/IHandler.js +0 -5
  124. package/lib/handler/blockable_map_event.js +0 -84
  125. package/lib/handler/box_zoom.js +0 -186
  126. package/lib/handler/click_zoom.js +0 -61
  127. package/lib/handler/events/event.js +0 -20
  128. package/lib/handler/events/index.js +0 -27
  129. package/lib/handler/events/map_mouse_event.js +0 -70
  130. package/lib/handler/events/map_touch_event.js +0 -100
  131. package/lib/handler/events/map_wheel_event.js +0 -57
  132. package/lib/handler/events/render_event.js +0 -33
  133. package/lib/handler/handler_inertia.js +0 -162
  134. package/lib/handler/handler_manager.js +0 -584
  135. package/lib/handler/handler_util.js +0 -15
  136. package/lib/handler/keyboard.js +0 -151
  137. package/lib/handler/map_event.js +0 -131
  138. package/lib/handler/mouse/index.js +0 -27
  139. package/lib/handler/mouse/mouse_handler.js +0 -124
  140. package/lib/handler/mouse/mousepan_handler.js +0 -49
  141. package/lib/handler/mouse/mousepitch_hander.js +0 -51
  142. package/lib/handler/mouse/mouserotate_hander.js +0 -51
  143. package/lib/handler/mouse/util.js +0 -22
  144. package/lib/handler/scroll_zoom.js +0 -333
  145. package/lib/handler/shim/dblclick_zoom.js +0 -74
  146. package/lib/handler/shim/drag_pan.js +0 -91
  147. package/lib/handler/shim/drag_rotate.js +0 -81
  148. package/lib/handler/shim/touch_zoom_rotate.js +0 -122
  149. package/lib/handler/tap/single_tap_recognizer.js +0 -106
  150. package/lib/handler/tap/tap_drag_zoom.js +0 -112
  151. package/lib/handler/tap/tap_recognizer.js +0 -63
  152. package/lib/handler/tap/tap_zoom.js +0 -115
  153. package/lib/handler/touch/index.js +0 -34
  154. package/lib/handler/touch/touch_pan.js +0 -117
  155. package/lib/handler/touch/touch_pitch.js +0 -98
  156. package/lib/handler/touch/touch_rotate.js +0 -82
  157. package/lib/handler/touch/touch_zoom.js +0 -59
  158. package/lib/handler/touch/two_touch.js +0 -131
  159. package/lib/hash.js +0 -143
  160. package/lib/index.js +0 -49
  161. package/lib/interface.js +0 -5
  162. package/lib/map.js +0 -394
  163. package/lib/util.js +0 -108
  164. package/lib/utils/Aabb.js +0 -119
  165. package/lib/utils/dom.js +0 -147
  166. package/lib/utils/performance.js +0 -70
  167. package/lib/utils/primitives.js +0 -54
  168. package/lib/utils/task_queue.js +0 -97
@@ -1,34 +0,0 @@
1
- import { EarthMap } from '../earthmap';
2
- import Point from '../geo/point';
3
- import { Map } from '../map';
4
- export interface IHandlerResult {
5
- panDelta?: Point;
6
- zoomDelta?: number;
7
- bearingDelta?: number;
8
- pitchDelta?: number;
9
- around?: Point | null;
10
- pinchAround?: Point | null;
11
- cameraAnimation?: (map: Map | EarthMap) => any;
12
- originalEvent?: any;
13
- needsRenderFrame?: boolean;
14
- noInertia?: boolean;
15
- }
16
- export interface IHandler {
17
- touchstart?: (e: TouchEvent, points: Point[], mapTouches: Touch[]) => IHandlerResult | void;
18
- touchmove?: (e: TouchEvent, points: Point[], mapTouches: Touch[]) => IHandlerResult | void;
19
- touchend?: (e: TouchEvent, points: Point[], mapTouches: Touch[]) => IHandlerResult | void;
20
- touchcancel?: (e: TouchEvent, points: Point[], mapTouches: Touch[]) => IHandlerResult | void;
21
- mousedown?: (e: MouseEvent, point: Point) => IHandlerResult | void;
22
- mousemove?: (e: MouseEvent, point: Point) => IHandlerResult | void;
23
- mouseup?: (e: MouseEvent, point: Point) => IHandlerResult | void;
24
- dblclick?: (e: MouseEvent, point: Point) => IHandlerResult | void;
25
- wheel?: (e: WheelEvent, point: Point) => IHandlerResult | void;
26
- keydown?: (e: KeyboardEvent) => IHandlerResult | void;
27
- keyup?: (e: KeyboardEvent) => IHandlerResult | void;
28
- renderFrame?: () => IHandlerResult | void;
29
- enable(options?: any): void;
30
- disable(): void;
31
- isEnabled(): boolean;
32
- isActive(): boolean;
33
- reset(): void;
34
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,17 +0,0 @@
1
- import { EarthMap } from '../earthmap';
2
- import { Map } from '../map';
3
- export default class BlockableMapEventHandler {
4
- private map;
5
- private delayContextMenu;
6
- private contextMenuEvent;
7
- constructor(map: Map | EarthMap);
8
- reset(): void;
9
- mousemove(e: MouseEvent): void;
10
- mousedown(): void;
11
- mouseup(): void;
12
- contextmenu(e: MouseEvent): void;
13
- isEnabled(): boolean;
14
- isActive(): boolean;
15
- enable(): boolean;
16
- disable(): boolean;
17
- }
@@ -1,78 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- // @ts-ignore
4
-
5
- import { MapMouseEvent } from "./events";
6
- var BlockableMapEventHandler = /*#__PURE__*/function () {
7
- function BlockableMapEventHandler(map) {
8
- _classCallCheck(this, BlockableMapEventHandler);
9
- this.map = map;
10
- }
11
- _createClass(BlockableMapEventHandler, [{
12
- key: "reset",
13
- value: function reset() {
14
- this.delayContextMenu = false;
15
- // @ts-ignore
16
- delete this.contextMenuEvent;
17
- }
18
- }, {
19
- key: "mousemove",
20
- value: function mousemove(e) {
21
- // mousemove map events should not be fired when interaction handlers (pan, rotate, etc) are active
22
- this.map.emit(e.type, new MapMouseEvent(e.type, this.map, e));
23
- }
24
- }, {
25
- key: "mousedown",
26
- value: function mousedown() {
27
- this.delayContextMenu = true;
28
- }
29
- }, {
30
- key: "mouseup",
31
- value: function mouseup() {
32
- this.delayContextMenu = false;
33
- if (this.contextMenuEvent) {
34
- this.map.emit('contextmenu', new MapMouseEvent('contextmenu', this.map, this.contextMenuEvent));
35
- // @ts-ignore
36
- delete this.contextMenuEvent;
37
- }
38
- }
39
- }, {
40
- key: "contextmenu",
41
- value: function contextmenu(e) {
42
- if (this.delayContextMenu) {
43
- // Mac: contextmenu fired on mousedown; we save it until mouseup for consistency's sake
44
- this.contextMenuEvent = e;
45
- } else {
46
- // Windows: contextmenu fired on mouseup, so fire event now
47
- this.map.emit(e.type, new MapMouseEvent(e.type, this.map, e));
48
- }
49
-
50
- // prevent browser context menu when necessary
51
- if (this.map.listeners('contextmenu')) {
52
- e.preventDefault();
53
- }
54
- }
55
- }, {
56
- key: "isEnabled",
57
- value: function isEnabled() {
58
- return true;
59
- }
60
- }, {
61
- key: "isActive",
62
- value: function isActive() {
63
- return false;
64
- }
65
- }, {
66
- key: "enable",
67
- value: function enable() {
68
- return true;
69
- }
70
- }, {
71
- key: "disable",
72
- value: function disable() {
73
- return false;
74
- }
75
- }]);
76
- return BlockableMapEventHandler;
77
- }();
78
- export { BlockableMapEventHandler as default };
@@ -1,59 +0,0 @@
1
- import { EarthMap } from '../earthmap';
2
- import Point from '../geo/point';
3
- import { Map } from '../map';
4
- /**
5
- * The `BoxZoomHandler` allows the user to zoom the map to fit within a bounding box.
6
- * The bounding box is defined by clicking and holding `shift` while dragging the cursor.
7
- */
8
- declare class BoxZoomHandler {
9
- private map;
10
- private el;
11
- private container;
12
- private enabled;
13
- private active;
14
- private startPos;
15
- private lastPos;
16
- private box;
17
- private clickTolerance;
18
- /**
19
- * @private
20
- */
21
- constructor(map: Map | EarthMap, options: {
22
- clickTolerance: number;
23
- });
24
- /**
25
- * Returns a Boolean indicating whether the "box zoom" interaction is enabled.
26
- *
27
- * @returns {boolean} `true` if the "box zoom" interaction is enabled.
28
- */
29
- isEnabled(): boolean;
30
- /**
31
- * Returns a Boolean indicating whether the "box zoom" interaction is active, i.e. currently being used.
32
- *
33
- * @returns {boolean} `true` if the "box zoom" interaction is active.
34
- */
35
- isActive(): boolean;
36
- /**
37
- * Enables the "box zoom" interaction.
38
- *
39
- * @example
40
- * map.boxZoom.enable();
41
- */
42
- enable(): void;
43
- /**
44
- * Disables the "box zoom" interaction.
45
- *
46
- * @example
47
- * map.boxZoom.disable();
48
- */
49
- disable(): void;
50
- mousedown(e: MouseEvent, point: Point): void;
51
- mousemoveWindow(e: MouseEvent, point: Point): void;
52
- mouseupWindow(e: MouseEvent, point: Point): {
53
- cameraAnimation: (map: Map) => boolean | Map;
54
- } | undefined;
55
- keydown(e: KeyboardEvent): void;
56
- reset(): void;
57
- fireEvent(type: string, e: any): boolean;
58
- }
59
- export default BoxZoomHandler;
@@ -1,180 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- // @ts-ignore
4
-
5
- import DOM from "../utils/dom";
6
- import { Event } from "./events/event";
7
-
8
- /**
9
- * The `BoxZoomHandler` allows the user to zoom the map to fit within a bounding box.
10
- * The bounding box is defined by clicking and holding `shift` while dragging the cursor.
11
- */
12
- var BoxZoomHandler = /*#__PURE__*/function () {
13
- /**
14
- * @private
15
- */
16
- function BoxZoomHandler(map, options) {
17
- _classCallCheck(this, BoxZoomHandler);
18
- this.map = map;
19
- this.el = map.getCanvasContainer();
20
- this.container = map.getContainer();
21
- this.clickTolerance = options.clickTolerance || 1;
22
- }
23
-
24
- /**
25
- * Returns a Boolean indicating whether the "box zoom" interaction is enabled.
26
- *
27
- * @returns {boolean} `true` if the "box zoom" interaction is enabled.
28
- */
29
- _createClass(BoxZoomHandler, [{
30
- key: "isEnabled",
31
- value: function isEnabled() {
32
- return !!this.enabled;
33
- }
34
-
35
- /**
36
- * Returns a Boolean indicating whether the "box zoom" interaction is active, i.e. currently being used.
37
- *
38
- * @returns {boolean} `true` if the "box zoom" interaction is active.
39
- */
40
- }, {
41
- key: "isActive",
42
- value: function isActive() {
43
- return !!this.active;
44
- }
45
-
46
- /**
47
- * Enables the "box zoom" interaction.
48
- *
49
- * @example
50
- * map.boxZoom.enable();
51
- */
52
- }, {
53
- key: "enable",
54
- value: function enable() {
55
- if (this.isEnabled()) {
56
- return;
57
- }
58
- this.enabled = true;
59
- }
60
-
61
- /**
62
- * Disables the "box zoom" interaction.
63
- *
64
- * @example
65
- * map.boxZoom.disable();
66
- */
67
- }, {
68
- key: "disable",
69
- value: function disable() {
70
- if (!this.isEnabled()) {
71
- return;
72
- }
73
- this.enabled = false;
74
- }
75
- }, {
76
- key: "mousedown",
77
- value: function mousedown(e, point) {
78
- if (!this.isEnabled()) {
79
- return;
80
- }
81
- if (!(e.shiftKey && e.button === 0)) {
82
- return;
83
- }
84
- DOM.disableDrag();
85
- this.startPos = this.lastPos = point;
86
- this.active = true;
87
- }
88
- }, {
89
- key: "mousemoveWindow",
90
- value: function mousemoveWindow(e, point) {
91
- if (!this.active) {
92
- return;
93
- }
94
- var pos = point;
95
- if (this.lastPos.equals(pos) || !this.box && pos.dist(this.startPos) < this.clickTolerance) {
96
- return;
97
- }
98
- var p0 = this.startPos;
99
- this.lastPos = pos;
100
- if (!this.box) {
101
- this.box = DOM.create('div', 'l7-boxzoom', this.container);
102
- this.container.classList.add('l7-crosshair');
103
- this.fireEvent('boxzoomstart', e);
104
- }
105
- var minX = Math.min(p0.x, pos.x);
106
- var maxX = Math.max(p0.x, pos.x);
107
- var minY = Math.min(p0.y, pos.y);
108
- var maxY = Math.max(p0.y, pos.y);
109
- DOM.setTransform(this.box, "translate(".concat(minX, "px,").concat(minY, "px)"));
110
- if (this.box) {
111
- this.box.style.width = "".concat(maxX - minX, "px");
112
- this.box.style.height = "".concat(maxY - minY, "px");
113
- }
114
- }
115
- }, {
116
- key: "mouseupWindow",
117
- value: function mouseupWindow(e, point) {
118
- var _this = this;
119
- if (!this.active) {
120
- return;
121
- }
122
- if (e.button !== 0) {
123
- return;
124
- }
125
- var p0 = this.startPos;
126
- var p1 = point;
127
- this.reset();
128
- DOM.suppressClick();
129
- if (p0.x === p1.x && p0.y === p1.y) {
130
- this.fireEvent('boxzoomcancel', e);
131
- } else {
132
- this.map.emit('boxzoomend', new Event('boxzoomend', {
133
- originalEvent: e
134
- }));
135
- return {
136
- cameraAnimation: function cameraAnimation(map) {
137
- return map.fitScreenCoordinates(p0, p1, _this.map.getBearing(), {
138
- linear: true
139
- });
140
- }
141
- };
142
- }
143
- }
144
- }, {
145
- key: "keydown",
146
- value: function keydown(e) {
147
- if (!this.active) {
148
- return;
149
- }
150
- if (e.keyCode === 27) {
151
- this.reset();
152
- this.fireEvent('boxzoomcancel', e);
153
- }
154
- }
155
- }, {
156
- key: "reset",
157
- value: function reset() {
158
- this.active = false;
159
- this.container.classList.remove('l7-crosshair');
160
- if (this.box) {
161
- DOM.remove(this.box);
162
- this.box = null;
163
- }
164
- DOM.enableDrag();
165
- // @ts-ignore
166
- delete this.startPos;
167
- // @ts-ignore
168
- delete this.lastPos;
169
- }
170
- }, {
171
- key: "fireEvent",
172
- value: function fireEvent(type, e) {
173
- return this.map.emit(type, new Event(type, {
174
- originalEvent: e
175
- }));
176
- }
177
- }]);
178
- return BoxZoomHandler;
179
- }();
180
- export default BoxZoomHandler;
@@ -1,16 +0,0 @@
1
- import { EarthMap } from '../earthmap';
2
- import Point from '../geo/point';
3
- import { Map } from '../map';
4
- export default class ClickZoomHandler {
5
- private enabled;
6
- private active;
7
- constructor();
8
- reset(): void;
9
- dblclick(e: MouseEvent, point: Point): {
10
- cameraAnimation: (map: Map | EarthMap) => void;
11
- };
12
- enable(): void;
13
- disable(): void;
14
- isEnabled(): boolean;
15
- isActive(): boolean;
16
- }
@@ -1,54 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- // @ts-ignore
4
- var ClickZoomHandler = /*#__PURE__*/function () {
5
- function ClickZoomHandler() {
6
- _classCallCheck(this, ClickZoomHandler);
7
- this.reset();
8
- }
9
- _createClass(ClickZoomHandler, [{
10
- key: "reset",
11
- value: function reset() {
12
- this.active = false;
13
- }
14
- }, {
15
- key: "dblclick",
16
- value: function dblclick(e, point) {
17
- e.preventDefault();
18
- return {
19
- cameraAnimation: function cameraAnimation(map) {
20
- map.easeTo({
21
- duration: 300,
22
- zoom: map.getZoom() + (e.shiftKey ? -1 : 1),
23
- around: map.unproject(point)
24
- }, {
25
- originalEvent: e
26
- });
27
- }
28
- };
29
- }
30
- }, {
31
- key: "enable",
32
- value: function enable() {
33
- this.enabled = true;
34
- }
35
- }, {
36
- key: "disable",
37
- value: function disable() {
38
- this.enabled = false;
39
- this.reset();
40
- }
41
- }, {
42
- key: "isEnabled",
43
- value: function isEnabled() {
44
- return this.enabled;
45
- }
46
- }, {
47
- key: "isActive",
48
- value: function isActive() {
49
- return this.active;
50
- }
51
- }]);
52
- return ClickZoomHandler;
53
- }();
54
- export { ClickZoomHandler as default };
@@ -1,4 +0,0 @@
1
- export declare class Event {
2
- type: string;
3
- constructor(type: string, data?: any);
4
- }
@@ -1,11 +0,0 @@
1
- import _createClass from "@babel/runtime/helpers/esm/createClass";
2
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
- // tslint:disable-next-line:no-submodule-imports
4
- import { lodashUtil } from '@antv/l7-utils';
5
- var merge = lodashUtil.merge;
6
- export var Event = /*#__PURE__*/_createClass(function Event(type) {
7
- var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
8
- _classCallCheck(this, Event);
9
- merge(this, data);
10
- this.type = type;
11
- });
@@ -1,4 +0,0 @@
1
- import MapMouseEvent from './map_mouse_event';
2
- import MapTouchEvent from './map_touch_event';
3
- import MapWheelEvent from './map_wheel_event';
4
- export { MapMouseEvent, MapTouchEvent, MapWheelEvent };
@@ -1,4 +0,0 @@
1
- import MapMouseEvent from "./map_mouse_event";
2
- import MapTouchEvent from "./map_touch_event";
3
- import MapWheelEvent from "./map_wheel_event";
4
- export { MapMouseEvent, MapTouchEvent, MapWheelEvent };
@@ -1,34 +0,0 @@
1
- import { EarthMap } from '../../earthmap';
2
- import LngLat from '../../geo/lng_lat';
3
- import Point from '../../geo/point';
4
- import { Map } from '../../map';
5
- import { Event } from './event';
6
- export default class MapMouseEvent extends Event {
7
- /**
8
- * `true` if `preventDefault` has been called.
9
- * @private
10
- */
11
- type: 'mousedown' | 'mouseup' | 'click' | 'dblclick' | 'mousemove' | 'mouseover' | 'mouseenter' | 'mouseleave' | 'mouseout' | 'contextmenu';
12
- /**
13
- * The `Map` object that fired the event.
14
- */
15
- target: Map | EarthMap;
16
- /**
17
- * The DOM event which caused the map event.
18
- */
19
- originalEvent: MouseEvent;
20
- /**
21
- * The pixel coordinates of the mouse cursor, relative to the map and measured from the top left corner.
22
- */
23
- point: Point;
24
- /**
25
- * The geographic location on the map of the mouse cursor.
26
- */
27
- lngLat: LngLat;
28
- defaultPrevented: boolean;
29
- /**
30
- * @private
31
- */
32
- constructor(type: string, map: Map | EarthMap, originalEvent: MouseEvent, data?: any);
33
- preventDefault(): void;
34
- }
@@ -1,64 +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
- 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); }; }
7
- 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; } }
8
- // @ts-ignore
9
- // tslint:disable-next-line:no-submodule-imports
10
- import { lodashUtil } from '@antv/l7-utils';
11
- import DOM from "../../utils/dom";
12
- import { Event } from "./event";
13
- var merge = lodashUtil.merge;
14
- var MapMouseEvent = /*#__PURE__*/function (_Event) {
15
- _inherits(MapMouseEvent, _Event);
16
- var _super = _createSuper(MapMouseEvent);
17
- /**
18
- * `true` if `preventDefault` has been called.
19
- * @private
20
- */
21
-
22
- /**
23
- * The `Map` object that fired the event.
24
- */
25
-
26
- /**
27
- * The DOM event which caused the map event.
28
- */
29
-
30
- /**
31
- * The pixel coordinates of the mouse cursor, relative to the map and measured from the top left corner.
32
- */
33
-
34
- /**
35
- * The geographic location on the map of the mouse cursor.
36
- */
37
-
38
- /**
39
- * @private
40
- */
41
- function MapMouseEvent(type, map, originalEvent) {
42
- var _this;
43
- var data = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
44
- _classCallCheck(this, MapMouseEvent);
45
- var point = DOM.mousePos(map.getCanvasContainer(), originalEvent);
46
- var lngLat = map.unproject(point);
47
- _this = _super.call(this, type, merge({
48
- point: point,
49
- lngLat: lngLat,
50
- originalEvent: originalEvent
51
- }, data));
52
- _this.defaultPrevented = false;
53
- _this.target = map;
54
- return _this;
55
- }
56
- _createClass(MapMouseEvent, [{
57
- key: "preventDefault",
58
- value: function preventDefault() {
59
- this.defaultPrevented = true;
60
- }
61
- }]);
62
- return MapMouseEvent;
63
- }(Event);
64
- export { MapMouseEvent as default };
@@ -1,57 +0,0 @@
1
- import { EarthMap } from '../../earthmap';
2
- import LngLat from '../../geo/lng_lat';
3
- import Point from '../../geo/point';
4
- import { Map } from '../../map';
5
- import { Event } from './event';
6
- export default class MapTouchEvent extends Event {
7
- /**
8
- * The event type.
9
- */
10
- type: 'touchstart' | 'touchend' | 'touchcancel';
11
- /**
12
- * The `Map` object that fired the event.
13
- */
14
- target: Map | EarthMap;
15
- /**
16
- * The DOM event which caused the map event.
17
- */
18
- originalEvent: TouchEvent;
19
- /**
20
- * The geographic location on the map of the center of the touch event points.
21
- */
22
- lngLat: LngLat;
23
- /**
24
- * The pixel coordinates of the center of the touch event points, relative to the map and measured from the top left
25
- * corner.
26
- */
27
- point: Point;
28
- /**
29
- * The array of pixel coordinates corresponding to a
30
- * [touch event's `touches`](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/touches) property.
31
- */
32
- points: Point[];
33
- /**
34
- * The geographical locations on the map corresponding to a
35
- * [touch event's `touches`](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/touches) property.
36
- */
37
- lngLats: LngLat[];
38
- /**
39
- * `true` if `preventDefault` has been called.
40
- * @private
41
- */
42
- defaultPrevented: boolean;
43
- /**
44
- * @private
45
- */
46
- constructor(type: string, map: Map | EarthMap, originalEvent: TouchEvent);
47
- /**
48
- * Prevents subsequent default processing of the event by the map.
49
- *
50
- * Calling this method will prevent the following default map behaviors:
51
- *
52
- * * On `touchstart` events, the behavior of {@link DragPanHandler}
53
- * * On `touchstart` events, the behavior of {@link TouchZoomRotateHandler}
54
- *
55
- */
56
- private preventDefault;
57
- }