@antv/l7-map 2.21.11-beta.5 → 2.21.11-beta.6

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 (358) hide show
  1. package/README.md +27 -6
  2. package/es/index.d.ts +3 -4
  3. package/es/index.js +2 -4
  4. package/es/map/camera.d.ts +690 -0
  5. package/es/map/camera.js +1138 -0
  6. package/{lib → es/map}/css/l7.css +41 -7
  7. package/es/map/events.d.ts +384 -0
  8. package/es/map/events.js +222 -0
  9. package/es/map/geo/edge_insets.d.ts +97 -0
  10. package/es/{geo → map/geo}/edge_insets.js +55 -33
  11. package/es/map/geo/lng_lat.d.ts +116 -0
  12. package/es/map/geo/lng_lat.js +159 -0
  13. package/es/map/geo/lng_lat_bounds.d.ts +217 -0
  14. package/es/map/geo/lng_lat_bounds.js +334 -0
  15. package/es/map/geo/mercator_coordinate.d.ts +113 -0
  16. package/es/map/geo/mercator_coordinate.js +142 -0
  17. package/es/map/geo/transform.d.ts +262 -0
  18. package/es/map/geo/transform.js +736 -0
  19. package/{lib → es/map}/handler/box_zoom.d.ts +30 -24
  20. package/es/map/handler/box_zoom.js +145 -0
  21. package/es/map/handler/click_zoom.d.ts +24 -0
  22. package/es/map/handler/click_zoom.js +47 -0
  23. package/es/map/handler/cooperative_gestures.d.ts +40 -0
  24. package/es/map/handler/cooperative_gestures.js +94 -0
  25. package/es/map/handler/drag_handler.d.ts +88 -0
  26. package/es/map/handler/drag_handler.js +89 -0
  27. package/es/map/handler/drag_move_state_manager.d.ts +30 -0
  28. package/es/map/handler/drag_move_state_manager.js +94 -0
  29. package/es/map/handler/handler_util.d.ts +3 -0
  30. package/es/{handler → map/handler}/handler_util.js +1 -2
  31. package/es/map/handler/keyboard.d.ts +88 -0
  32. package/es/map/handler/keyboard.js +197 -0
  33. package/es/map/handler/map_event.d.ts +46 -0
  34. package/es/map/handler/map_event.js +131 -0
  35. package/es/map/handler/mouse.d.ts +30 -0
  36. package/es/map/handler/mouse.js +85 -0
  37. package/es/map/handler/one_finger_touch_drag.d.ts +15 -0
  38. package/es/map/handler/one_finger_touch_drag.js +39 -0
  39. package/es/map/handler/scroll_zoom.d.ts +102 -0
  40. package/es/map/handler/scroll_zoom.js +312 -0
  41. package/es/{handler → map/handler}/shim/dblclick_zoom.d.ts +14 -10
  42. package/es/{handler → map/handler}/shim/dblclick_zoom.js +20 -16
  43. package/es/map/handler/shim/drag_pan.d.ts +79 -0
  44. package/es/map/handler/shim/drag_pan.js +77 -0
  45. package/es/{handler → map/handler}/shim/drag_rotate.d.ts +24 -16
  46. package/es/map/handler/shim/drag_rotate.js +66 -0
  47. package/es/map/handler/shim/two_fingers_touch.d.ts +74 -0
  48. package/es/map/handler/shim/two_fingers_touch.js +106 -0
  49. package/es/map/handler/tap_drag_zoom.d.ts +28 -0
  50. package/es/map/handler/tap_drag_zoom.js +92 -0
  51. package/es/map/handler/tap_recognizer.d.ts +35 -0
  52. package/es/map/handler/tap_recognizer.js +107 -0
  53. package/es/map/handler/tap_zoom.d.ts +28 -0
  54. package/es/map/handler/tap_zoom.js +87 -0
  55. package/es/map/handler/touch_pan.d.ts +40 -0
  56. package/es/map/handler/touch_pan.js +85 -0
  57. package/es/map/handler/transform-provider.d.ts +23 -0
  58. package/es/map/handler/transform-provider.js +35 -0
  59. package/es/map/handler/two_fingers_touch.d.ts +107 -0
  60. package/es/map/handler/two_fingers_touch.js +289 -0
  61. package/es/map/handler_inertia.d.ts +20 -0
  62. package/es/{handler → map}/handler_inertia.js +36 -50
  63. package/es/map/handler_manager.d.ts +154 -0
  64. package/es/map/handler_manager.js +466 -0
  65. package/es/map/map.d.ts +625 -0
  66. package/es/map/map.js +972 -0
  67. package/es/map/util/abort_error.d.ts +15 -0
  68. package/es/map/util/abort_error.js +21 -0
  69. package/es/map/util/browser.d.ts +10 -0
  70. package/es/map/util/browser.js +30 -0
  71. package/es/map/util/dom.d.ts +30 -0
  72. package/es/map/util/dom.js +105 -0
  73. package/es/map/util/evented.d.ts +75 -0
  74. package/es/map/util/evented.js +158 -0
  75. package/es/map/util/task_queue.d.ts +18 -0
  76. package/es/map/util/task_queue.js +54 -0
  77. package/es/map/util/util.d.ts +104 -0
  78. package/es/map/util/util.js +155 -0
  79. package/lib/index.d.ts +3 -4
  80. package/lib/index.js +12 -42
  81. package/lib/map/camera.d.ts +690 -0
  82. package/lib/map/camera.js +1145 -0
  83. package/{es → lib/map}/css/l7.css +41 -7
  84. package/lib/map/events.d.ts +384 -0
  85. package/lib/map/events.js +231 -0
  86. package/lib/map/geo/edge_insets.d.ts +97 -0
  87. package/lib/{geo → map/geo}/edge_insets.js +56 -35
  88. package/lib/map/geo/lng_lat.d.ts +116 -0
  89. package/lib/map/geo/lng_lat.js +166 -0
  90. package/lib/map/geo/lng_lat_bounds.d.ts +217 -0
  91. package/lib/map/geo/lng_lat_bounds.js +341 -0
  92. package/lib/map/geo/mercator_coordinate.d.ts +113 -0
  93. package/lib/map/geo/mercator_coordinate.js +157 -0
  94. package/lib/map/geo/transform.d.ts +262 -0
  95. package/lib/map/geo/transform.js +744 -0
  96. package/{es → lib/map}/handler/box_zoom.d.ts +30 -24
  97. package/lib/map/handler/box_zoom.js +153 -0
  98. package/lib/map/handler/click_zoom.d.ts +24 -0
  99. package/lib/map/handler/click_zoom.js +54 -0
  100. package/lib/map/handler/cooperative_gestures.d.ts +40 -0
  101. package/lib/map/handler/cooperative_gestures.js +101 -0
  102. package/lib/map/handler/drag_handler.d.ts +88 -0
  103. package/lib/map/handler/drag_handler.js +97 -0
  104. package/lib/map/handler/drag_move_state_manager.d.ts +30 -0
  105. package/lib/map/handler/drag_move_state_manager.js +103 -0
  106. package/lib/map/handler/handler_util.d.ts +3 -0
  107. package/lib/{handler → map/handler}/handler_util.js +1 -2
  108. package/lib/map/handler/keyboard.d.ts +88 -0
  109. package/lib/map/handler/keyboard.js +205 -0
  110. package/lib/map/handler/map_event.d.ts +46 -0
  111. package/lib/map/handler/map_event.js +140 -0
  112. package/lib/map/handler/mouse.d.ts +30 -0
  113. package/lib/map/handler/mouse.js +93 -0
  114. package/lib/map/handler/one_finger_touch_drag.d.ts +15 -0
  115. package/lib/map/handler/one_finger_touch_drag.js +47 -0
  116. package/lib/map/handler/scroll_zoom.d.ts +102 -0
  117. package/lib/map/handler/scroll_zoom.js +320 -0
  118. package/lib/{handler → map/handler}/shim/dblclick_zoom.d.ts +14 -10
  119. package/lib/{handler → map/handler}/shim/dblclick_zoom.js +21 -17
  120. package/lib/map/handler/shim/drag_pan.d.ts +79 -0
  121. package/lib/map/handler/shim/drag_pan.js +85 -0
  122. package/lib/{handler → map/handler}/shim/drag_rotate.d.ts +24 -16
  123. package/lib/map/handler/shim/drag_rotate.js +74 -0
  124. package/lib/map/handler/shim/two_fingers_touch.d.ts +74 -0
  125. package/lib/map/handler/shim/two_fingers_touch.js +114 -0
  126. package/lib/map/handler/tap_drag_zoom.d.ts +28 -0
  127. package/lib/map/handler/tap_drag_zoom.js +99 -0
  128. package/lib/map/handler/tap_recognizer.d.ts +35 -0
  129. package/lib/map/handler/tap_recognizer.js +116 -0
  130. package/lib/map/handler/tap_zoom.d.ts +28 -0
  131. package/lib/map/handler/tap_zoom.js +94 -0
  132. package/lib/map/handler/touch_pan.d.ts +40 -0
  133. package/lib/map/handler/touch_pan.js +92 -0
  134. package/lib/map/handler/transform-provider.d.ts +23 -0
  135. package/lib/map/handler/transform-provider.js +43 -0
  136. package/lib/map/handler/two_fingers_touch.d.ts +107 -0
  137. package/lib/map/handler/two_fingers_touch.js +296 -0
  138. package/lib/map/handler_inertia.d.ts +20 -0
  139. package/lib/{handler → map}/handler_inertia.js +38 -53
  140. package/lib/map/handler_manager.d.ts +154 -0
  141. package/lib/map/handler_manager.js +474 -0
  142. package/lib/map/map.d.ts +625 -0
  143. package/lib/map/map.js +979 -0
  144. package/lib/map/util/abort_error.d.ts +15 -0
  145. package/lib/map/util/abort_error.js +29 -0
  146. package/lib/map/util/browser.d.ts +10 -0
  147. package/lib/map/util/browser.js +36 -0
  148. package/lib/map/util/dom.d.ts +30 -0
  149. package/lib/map/util/dom.js +113 -0
  150. package/lib/map/util/evented.d.ts +75 -0
  151. package/lib/map/util/evented.js +167 -0
  152. package/lib/map/util/task_queue.d.ts +18 -0
  153. package/lib/map/util/task_queue.js +62 -0
  154. package/lib/map/util/util.d.ts +104 -0
  155. package/lib/map/util/util.js +171 -0
  156. package/package.json +6 -3
  157. package/es/camera.d.ts +0 -86
  158. package/es/camera.js +0 -639
  159. package/es/earthmap.d.ts +0 -69
  160. package/es/earthmap.js +0 -445
  161. package/es/geo/edge_insets.d.ts +0 -54
  162. package/es/geo/lng_lat.d.ts +0 -18
  163. package/es/geo/lng_lat.js +0 -59
  164. package/es/geo/lng_lat_bounds.d.ts +0 -25
  165. package/es/geo/lng_lat_bounds.js +0 -118
  166. package/es/geo/mercator.d.ts +0 -30
  167. package/es/geo/mercator.js +0 -72
  168. package/es/geo/point.d.ts +0 -40
  169. package/es/geo/point.js +0 -153
  170. package/es/geo/simple.d.ts +0 -30
  171. package/es/geo/simple.js +0 -75
  172. package/es/geo/transform.d.ts +0 -198
  173. package/es/geo/transform.js +0 -895
  174. package/es/handler/IHandler.d.ts +0 -34
  175. package/es/handler/IHandler.js +0 -1
  176. package/es/handler/blockable_map_event.d.ts +0 -17
  177. package/es/handler/blockable_map_event.js +0 -58
  178. package/es/handler/box_zoom.js +0 -162
  179. package/es/handler/click_zoom.d.ts +0 -16
  180. package/es/handler/click_zoom.js +0 -40
  181. package/es/handler/events/event.d.ts +0 -4
  182. package/es/handler/events/event.js +0 -12
  183. package/es/handler/events/index.d.ts +0 -4
  184. package/es/handler/events/index.js +0 -4
  185. package/es/handler/events/map_mouse_event.d.ts +0 -34
  186. package/es/handler/events/map_mouse_event.js +0 -45
  187. package/es/handler/events/map_touch_event.d.ts +0 -57
  188. package/es/handler/events/map_touch_event.js +0 -75
  189. package/es/handler/events/map_wheel_event.d.ts +0 -33
  190. package/es/handler/events/map_wheel_event.js +0 -33
  191. package/es/handler/events/render_event.d.ts +0 -6
  192. package/es/handler/events/render_event.js +0 -10
  193. package/es/handler/handler_inertia.d.ts +0 -23
  194. package/es/handler/handler_manager.d.ts +0 -61
  195. package/es/handler/handler_manager.js +0 -487
  196. package/es/handler/handler_util.d.ts +0 -4
  197. package/es/handler/keyboard.d.ts +0 -36
  198. package/es/handler/keyboard.js +0 -131
  199. package/es/handler/map_event.d.ts +0 -29
  200. package/es/handler/map_event.js +0 -89
  201. package/es/handler/mouse/index.d.ts +0 -4
  202. package/es/handler/mouse/index.js +0 -4
  203. package/es/handler/mouse/mouse_handler.d.ts +0 -22
  204. package/es/handler/mouse/mouse_handler.js +0 -99
  205. package/es/handler/mouse/mousepan_handler.d.ts +0 -10
  206. package/es/handler/mouse/mousepan_handler.js +0 -21
  207. package/es/handler/mouse/mousepitch_hander.d.ts +0 -9
  208. package/es/handler/mouse/mousepitch_hander.js +0 -24
  209. package/es/handler/mouse/mouserotate_hander.d.ts +0 -9
  210. package/es/handler/mouse/mouserotate_hander.js +0 -24
  211. package/es/handler/mouse/util.d.ts +0 -6
  212. package/es/handler/mouse/util.js +0 -12
  213. package/es/handler/scroll_zoom.d.ts +0 -93
  214. package/es/handler/scroll_zoom.js +0 -315
  215. package/es/handler/shim/drag_pan.d.ts +0 -61
  216. package/es/handler/shim/drag_pan.js +0 -75
  217. package/es/handler/shim/drag_rotate.js +0 -64
  218. package/es/handler/shim/touch_zoom_rotate.d.ts +0 -70
  219. package/es/handler/shim/touch_zoom_rotate.js +0 -104
  220. package/es/handler/tap/single_tap_recognizer.d.ts +0 -20
  221. package/es/handler/tap/single_tap_recognizer.js +0 -77
  222. package/es/handler/tap/tap_drag_zoom.d.ts +0 -22
  223. package/es/handler/tap/tap_drag_zoom.js +0 -89
  224. package/es/handler/tap/tap_recognizer.d.ts +0 -17
  225. package/es/handler/tap/tap_recognizer.js +0 -46
  226. package/es/handler/tap/tap_zoom.d.ts +0 -22
  227. package/es/handler/tap/tap_zoom.js +0 -81
  228. package/es/handler/touch/index.d.ts +0 -5
  229. package/es/handler/touch/index.js +0 -5
  230. package/es/handler/touch/touch_pan.d.ts +0 -30
  231. package/es/handler/touch/touch_pan.js +0 -91
  232. package/es/handler/touch/touch_pitch.d.ts +0 -13
  233. package/es/handler/touch/touch_pitch.js +0 -75
  234. package/es/handler/touch/touch_rotate.d.ts +0 -12
  235. package/es/handler/touch/touch_rotate.js +0 -57
  236. package/es/handler/touch/touch_zoom.d.ts +0 -12
  237. package/es/handler/touch/touch_zoom.js +0 -37
  238. package/es/handler/touch/two_touch.d.ts +0 -23
  239. package/es/handler/touch/two_touch.js +0 -98
  240. package/es/hash.d.ts +0 -14
  241. package/es/hash.js +0 -121
  242. package/es/interface.d.ts +0 -34
  243. package/es/interface.js +0 -1
  244. package/es/map.d.ts +0 -70
  245. package/es/map.js +0 -472
  246. package/es/util.d.ts +0 -25
  247. package/es/util.js +0 -70
  248. package/es/utils/Aabb.d.ts +0 -12
  249. package/es/utils/Aabb.js +0 -72
  250. package/es/utils/dom.d.ts +0 -4
  251. package/es/utils/dom.js +0 -117
  252. package/es/utils/performance.d.ts +0 -17
  253. package/es/utils/performance.js +0 -58
  254. package/es/utils/primitives.d.ts +0 -6
  255. package/es/utils/primitives.js +0 -37
  256. package/es/utils/task_queue.d.ts +0 -13
  257. package/es/utils/task_queue.js +0 -60
  258. package/lib/camera.d.ts +0 -86
  259. package/lib/camera.js +0 -648
  260. package/lib/earthmap.d.ts +0 -69
  261. package/lib/earthmap.js +0 -451
  262. package/lib/geo/edge_insets.d.ts +0 -54
  263. package/lib/geo/lng_lat.d.ts +0 -18
  264. package/lib/geo/lng_lat.js +0 -67
  265. package/lib/geo/lng_lat_bounds.d.ts +0 -25
  266. package/lib/geo/lng_lat_bounds.js +0 -126
  267. package/lib/geo/mercator.d.ts +0 -30
  268. package/lib/geo/mercator.js +0 -88
  269. package/lib/geo/point.d.ts +0 -40
  270. package/lib/geo/point.js +0 -161
  271. package/lib/geo/simple.d.ts +0 -30
  272. package/lib/geo/simple.js +0 -92
  273. package/lib/geo/transform.d.ts +0 -198
  274. package/lib/geo/transform.js +0 -906
  275. package/lib/handler/IHandler.d.ts +0 -34
  276. package/lib/handler/IHandler.js +0 -5
  277. package/lib/handler/blockable_map_event.d.ts +0 -17
  278. package/lib/handler/blockable_map_event.js +0 -66
  279. package/lib/handler/box_zoom.js +0 -168
  280. package/lib/handler/click_zoom.d.ts +0 -16
  281. package/lib/handler/click_zoom.js +0 -48
  282. package/lib/handler/events/event.d.ts +0 -4
  283. package/lib/handler/events/event.js +0 -20
  284. package/lib/handler/events/index.d.ts +0 -4
  285. package/lib/handler/events/index.js +0 -27
  286. package/lib/handler/events/map_mouse_event.d.ts +0 -34
  287. package/lib/handler/events/map_mouse_event.js +0 -53
  288. package/lib/handler/events/map_touch_event.d.ts +0 -57
  289. package/lib/handler/events/map_touch_event.js +0 -83
  290. package/lib/handler/events/map_wheel_event.d.ts +0 -33
  291. package/lib/handler/events/map_wheel_event.js +0 -41
  292. package/lib/handler/events/render_event.d.ts +0 -6
  293. package/lib/handler/events/render_event.js +0 -18
  294. package/lib/handler/handler_inertia.d.ts +0 -23
  295. package/lib/handler/handler_manager.d.ts +0 -61
  296. package/lib/handler/handler_manager.js +0 -495
  297. package/lib/handler/handler_util.d.ts +0 -4
  298. package/lib/handler/keyboard.d.ts +0 -36
  299. package/lib/handler/keyboard.js +0 -138
  300. package/lib/handler/map_event.d.ts +0 -29
  301. package/lib/handler/map_event.js +0 -97
  302. package/lib/handler/mouse/index.d.ts +0 -4
  303. package/lib/handler/mouse/index.js +0 -27
  304. package/lib/handler/mouse/mouse_handler.d.ts +0 -22
  305. package/lib/handler/mouse/mouse_handler.js +0 -107
  306. package/lib/handler/mouse/mousepan_handler.d.ts +0 -10
  307. package/lib/handler/mouse/mousepan_handler.js +0 -29
  308. package/lib/handler/mouse/mousepitch_hander.d.ts +0 -9
  309. package/lib/handler/mouse/mousepitch_hander.js +0 -32
  310. package/lib/handler/mouse/mouserotate_hander.d.ts +0 -9
  311. package/lib/handler/mouse/mouserotate_hander.js +0 -32
  312. package/lib/handler/mouse/util.d.ts +0 -6
  313. package/lib/handler/mouse/util.js +0 -19
  314. package/lib/handler/scroll_zoom.d.ts +0 -93
  315. package/lib/handler/scroll_zoom.js +0 -322
  316. package/lib/handler/shim/drag_pan.d.ts +0 -61
  317. package/lib/handler/shim/drag_pan.js +0 -83
  318. package/lib/handler/shim/drag_rotate.js +0 -72
  319. package/lib/handler/shim/touch_zoom_rotate.d.ts +0 -70
  320. package/lib/handler/shim/touch_zoom_rotate.js +0 -112
  321. package/lib/handler/tap/single_tap_recognizer.d.ts +0 -20
  322. package/lib/handler/tap/single_tap_recognizer.js +0 -86
  323. package/lib/handler/tap/tap_drag_zoom.d.ts +0 -22
  324. package/lib/handler/tap/tap_drag_zoom.js +0 -97
  325. package/lib/handler/tap/tap_recognizer.d.ts +0 -17
  326. package/lib/handler/tap/tap_recognizer.js +0 -56
  327. package/lib/handler/tap/tap_zoom.d.ts +0 -22
  328. package/lib/handler/tap/tap_zoom.js +0 -89
  329. package/lib/handler/touch/index.d.ts +0 -5
  330. package/lib/handler/touch/index.js +0 -34
  331. package/lib/handler/touch/touch_pan.d.ts +0 -30
  332. package/lib/handler/touch/touch_pan.js +0 -100
  333. package/lib/handler/touch/touch_pitch.d.ts +0 -13
  334. package/lib/handler/touch/touch_pitch.js +0 -83
  335. package/lib/handler/touch/touch_rotate.d.ts +0 -12
  336. package/lib/handler/touch/touch_rotate.js +0 -65
  337. package/lib/handler/touch/touch_zoom.d.ts +0 -12
  338. package/lib/handler/touch/touch_zoom.js +0 -45
  339. package/lib/handler/touch/two_touch.d.ts +0 -23
  340. package/lib/handler/touch/two_touch.js +0 -106
  341. package/lib/hash.d.ts +0 -14
  342. package/lib/hash.js +0 -129
  343. package/lib/interface.d.ts +0 -34
  344. package/lib/interface.js +0 -5
  345. package/lib/map.d.ts +0 -70
  346. package/lib/map.js +0 -478
  347. package/lib/util.d.ts +0 -25
  348. package/lib/util.js +0 -89
  349. package/lib/utils/Aabb.d.ts +0 -12
  350. package/lib/utils/Aabb.js +0 -80
  351. package/lib/utils/dom.d.ts +0 -4
  352. package/lib/utils/dom.js +0 -125
  353. package/lib/utils/performance.d.ts +0 -17
  354. package/lib/utils/performance.js +0 -64
  355. package/lib/utils/primitives.d.ts +0 -6
  356. package/lib/utils/primitives.js +0 -45
  357. package/lib/utils/task_queue.d.ts +0 -13
  358. package/lib/utils/task_queue.js +0 -67
@@ -1,34 +0,0 @@
1
- import type { EarthMap } from '../earthmap';
2
- import type Point from '../geo/point';
3
- import type { 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,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
@@ -1,17 +0,0 @@
1
- import type { EarthMap } from '../earthmap';
2
- import type { 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,66 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _events = require("./events");
10
- // @ts-ignore
11
-
12
- class BlockableMapEventHandler {
13
- constructor(map) {
14
- (0, _defineProperty2.default)(this, "map", void 0);
15
- (0, _defineProperty2.default)(this, "delayContextMenu", void 0);
16
- (0, _defineProperty2.default)(this, "contextMenuEvent", void 0);
17
- this.map = map;
18
- }
19
- reset() {
20
- this.delayContextMenu = false;
21
- // @ts-ignore
22
- delete this.contextMenuEvent;
23
- }
24
- mousemove(e) {
25
- // mousemove map events should not be fired when interaction handlers (pan, rotate, etc) are active
26
- this.map.emit(e.type, new _events.MapMouseEvent(e.type, this.map, e));
27
- }
28
- mousedown() {
29
- this.delayContextMenu = true;
30
- }
31
- mouseup() {
32
- this.delayContextMenu = false;
33
- if (this.contextMenuEvent) {
34
- this.map.emit('contextmenu', new _events.MapMouseEvent('contextmenu', this.map, this.contextMenuEvent));
35
- // @ts-ignore
36
- delete this.contextMenuEvent;
37
- }
38
- }
39
- contextmenu(e) {
40
- if (this.delayContextMenu) {
41
- // Mac: contextmenu fired on mousedown; we save it until mouseup for consistency's sake
42
- this.contextMenuEvent = e;
43
- } else {
44
- // Windows: contextmenu fired on mouseup, so fire event now
45
- this.map.emit(e.type, new _events.MapMouseEvent(e.type, this.map, e));
46
- }
47
-
48
- // prevent browser context menu when necessary
49
- if (this.map.listeners('contextmenu')) {
50
- e.preventDefault();
51
- }
52
- }
53
- isEnabled() {
54
- return true;
55
- }
56
- isActive() {
57
- return false;
58
- }
59
- enable() {
60
- return true;
61
- }
62
- disable() {
63
- return false;
64
- }
65
- }
66
- exports.default = BlockableMapEventHandler;
@@ -1,168 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _dom = _interopRequireDefault(require("../utils/dom"));
10
- var _event = require("./events/event");
11
- // @ts-ignore
12
-
13
- /**
14
- * The `BoxZoomHandler` allows the user to zoom the map to fit within a bounding box.
15
- * The bounding box is defined by clicking and holding `shift` while dragging the cursor.
16
- */
17
- class BoxZoomHandler {
18
- /**
19
- * @private
20
- */
21
- constructor(map, options) {
22
- (0, _defineProperty2.default)(this, "map", void 0);
23
- (0, _defineProperty2.default)(this, "el", void 0);
24
- (0, _defineProperty2.default)(this, "container", void 0);
25
- (0, _defineProperty2.default)(this, "enabled", void 0);
26
- (0, _defineProperty2.default)(this, "active", void 0);
27
- (0, _defineProperty2.default)(this, "startPos", void 0);
28
- (0, _defineProperty2.default)(this, "lastPos", void 0);
29
- (0, _defineProperty2.default)(this, "box", void 0);
30
- (0, _defineProperty2.default)(this, "clickTolerance", void 0);
31
- this.map = map;
32
- this.el = map.getCanvasContainer();
33
- this.container = map.getContainer();
34
- this.clickTolerance = options.clickTolerance || 1;
35
- }
36
-
37
- /**
38
- * Returns a Boolean indicating whether the "box zoom" interaction is enabled.
39
- *
40
- * @returns {boolean} `true` if the "box zoom" interaction is enabled.
41
- */
42
- isEnabled() {
43
- return !!this.enabled;
44
- }
45
-
46
- /**
47
- * Returns a Boolean indicating whether the "box zoom" interaction is active, i.e. currently being used.
48
- *
49
- * @returns {boolean} `true` if the "box zoom" interaction is active.
50
- */
51
- isActive() {
52
- return !!this.active;
53
- }
54
-
55
- /**
56
- * Enables the "box zoom" interaction.
57
- *
58
- * @example
59
- * map.boxZoom.enable();
60
- */
61
- enable() {
62
- if (this.isEnabled()) {
63
- return;
64
- }
65
- this.enabled = true;
66
- }
67
-
68
- /**
69
- * Disables the "box zoom" interaction.
70
- *
71
- * @example
72
- * map.boxZoom.disable();
73
- */
74
- disable() {
75
- if (!this.isEnabled()) {
76
- return;
77
- }
78
- this.enabled = false;
79
- }
80
- mousedown(e, point) {
81
- if (!this.isEnabled()) {
82
- return;
83
- }
84
- if (!(e.shiftKey && e.button === 0)) {
85
- return;
86
- }
87
- _dom.default.disableDrag();
88
- this.startPos = this.lastPos = point;
89
- this.active = true;
90
- }
91
- mousemoveWindow(e, point) {
92
- if (!this.active) {
93
- return;
94
- }
95
- const pos = point;
96
- if (this.lastPos.equals(pos) || !this.box && pos.dist(this.startPos) < this.clickTolerance) {
97
- return;
98
- }
99
- const p0 = this.startPos;
100
- this.lastPos = pos;
101
- if (!this.box) {
102
- this.box = _dom.default.create('div', 'l7-boxzoom', this.container);
103
- this.container.classList.add('l7-crosshair');
104
- this.fireEvent('boxzoomstart', e);
105
- }
106
- const minX = Math.min(p0.x, pos.x);
107
- const maxX = Math.max(p0.x, pos.x);
108
- const minY = Math.min(p0.y, pos.y);
109
- const maxY = Math.max(p0.y, pos.y);
110
- _dom.default.setTransform(this.box, `translate(${minX}px,${minY}px)`);
111
- if (this.box) {
112
- this.box.style.width = `${maxX - minX}px`;
113
- this.box.style.height = `${maxY - minY}px`;
114
- }
115
- }
116
- mouseupWindow(e, point) {
117
- if (!this.active) {
118
- return;
119
- }
120
- if (e.button !== 0) {
121
- return;
122
- }
123
- const p0 = this.startPos;
124
- const p1 = point;
125
- this.reset();
126
- _dom.default.suppressClick();
127
- if (p0.x === p1.x && p0.y === p1.y) {
128
- this.fireEvent('boxzoomcancel', e);
129
- } else {
130
- this.map.emit('boxzoomend', new _event.Event('boxzoomend', {
131
- originalEvent: e
132
- }));
133
- return {
134
- cameraAnimation: map => map.fitScreenCoordinates(p0, p1, this.map.getBearing(), {
135
- linear: true
136
- })
137
- };
138
- }
139
- }
140
- keydown(e) {
141
- if (!this.active) {
142
- return;
143
- }
144
- if (e.keyCode === 27) {
145
- this.reset();
146
- this.fireEvent('boxzoomcancel', e);
147
- }
148
- }
149
- reset() {
150
- this.active = false;
151
- this.container.classList.remove('l7-crosshair');
152
- if (this.box) {
153
- _dom.default.remove(this.box);
154
- this.box = null;
155
- }
156
- _dom.default.enableDrag();
157
- // @ts-ignore
158
- delete this.startPos;
159
- // @ts-ignore
160
- delete this.lastPos;
161
- }
162
- fireEvent(type, e) {
163
- return this.map.emit(type, new _event.Event(type, {
164
- originalEvent: e
165
- }));
166
- }
167
- }
168
- var _default = exports.default = BoxZoomHandler;
@@ -1,16 +0,0 @@
1
- import type { EarthMap } from '../earthmap';
2
- import type Point from '../geo/point';
3
- import type { 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,48 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- // @ts-ignore
10
-
11
- class ClickZoomHandler {
12
- constructor() {
13
- (0, _defineProperty2.default)(this, "enabled", void 0);
14
- (0, _defineProperty2.default)(this, "active", void 0);
15
- this.reset();
16
- }
17
- reset() {
18
- this.active = false;
19
- }
20
- dblclick(e, point) {
21
- e.preventDefault();
22
- return {
23
- cameraAnimation: map => {
24
- map.easeTo({
25
- duration: 300,
26
- zoom: map.getZoom() + (e.shiftKey ? -1 : 1),
27
- around: map.unproject(point)
28
- }, {
29
- originalEvent: e
30
- });
31
- }
32
- };
33
- }
34
- enable() {
35
- this.enabled = true;
36
- }
37
- disable() {
38
- this.enabled = false;
39
- this.reset();
40
- }
41
- isEnabled() {
42
- return this.enabled;
43
- }
44
- isActive() {
45
- return this.active;
46
- }
47
- }
48
- exports.default = ClickZoomHandler;
@@ -1,4 +0,0 @@
1
- export declare class Event {
2
- type: string;
3
- constructor(type: string, data?: {});
4
- }
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.Event = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _l7Utils = require("@antv/l7-utils");
10
- const {
11
- merge
12
- } = _l7Utils.lodashUtil;
13
- class Event {
14
- constructor(type, data = {}) {
15
- (0, _defineProperty2.default)(this, "type", void 0);
16
- merge(this, data);
17
- this.type = type;
18
- }
19
- }
20
- exports.Event = Event;
@@ -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,27 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- Object.defineProperty(exports, "MapMouseEvent", {
8
- enumerable: true,
9
- get: function () {
10
- return _map_mouse_event.default;
11
- }
12
- });
13
- Object.defineProperty(exports, "MapTouchEvent", {
14
- enumerable: true,
15
- get: function () {
16
- return _map_touch_event.default;
17
- }
18
- });
19
- Object.defineProperty(exports, "MapWheelEvent", {
20
- enumerable: true,
21
- get: function () {
22
- return _map_wheel_event.default;
23
- }
24
- });
25
- var _map_mouse_event = _interopRequireDefault(require("./map_mouse_event"));
26
- var _map_touch_event = _interopRequireDefault(require("./map_touch_event"));
27
- var _map_wheel_event = _interopRequireDefault(require("./map_wheel_event"));
@@ -1,34 +0,0 @@
1
- import type { EarthMap } from '../../earthmap';
2
- import type LngLat from '../../geo/lng_lat';
3
- import type Point from '../../geo/point';
4
- import type { 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);
33
- preventDefault(): void;
34
- }
@@ -1,53 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _dom = _interopRequireDefault(require("../../utils/dom"));
10
- var _event = require("./event");
11
- // @ts-ignore
12
- // tslint:disable-next-line:no-submodule-imports
13
-
14
- class MapMouseEvent extends _event.Event {
15
- /**
16
- * @private
17
- */
18
- constructor(type, map, originalEvent) {
19
- super(type);
20
- /**
21
- * `true` if `preventDefault` has been called.
22
- * @private
23
- */
24
- /**
25
- * The `Map` object that fired the event.
26
- */
27
- (0, _defineProperty2.default)(this, "target", void 0);
28
- /**
29
- * The DOM event which caused the map event.
30
- */
31
- (0, _defineProperty2.default)(this, "originalEvent", void 0);
32
- /**
33
- * The pixel coordinates of the mouse cursor, relative to the map and measured from the top left corner.
34
- */
35
- (0, _defineProperty2.default)(this, "point", void 0);
36
- /**
37
- * The geographic location on the map of the mouse cursor.
38
- */
39
- (0, _defineProperty2.default)(this, "lngLat", void 0);
40
- (0, _defineProperty2.default)(this, "defaultPrevented", void 0);
41
- const point = _dom.default.mousePos(map.getCanvasContainer(), originalEvent);
42
- const lngLat = map.unproject(point);
43
- this.point = point;
44
- this.lngLat = lngLat;
45
- this.originalEvent = originalEvent;
46
- this.defaultPrevented = false;
47
- this.target = map;
48
- }
49
- preventDefault() {
50
- this.defaultPrevented = true;
51
- }
52
- }
53
- exports.default = MapMouseEvent;
@@ -1,57 +0,0 @@
1
- import type { EarthMap } from '../../earthmap';
2
- import type LngLat from '../../geo/lng_lat';
3
- import Point from '../../geo/point';
4
- import type { 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
- }
@@ -1,83 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _point = _interopRequireDefault(require("../../geo/point"));
10
- var _dom = _interopRequireDefault(require("../../utils/dom"));
11
- var _event = require("./event");
12
- // @ts-ignore
13
-
14
- class MapTouchEvent extends _event.Event {
15
- /**
16
- * @private
17
- */
18
- constructor(type, map, originalEvent) {
19
- super(type);
20
- /**
21
- * The event type.
22
- */
23
- /**
24
- * The `Map` object that fired the event.
25
- */
26
- (0, _defineProperty2.default)(this, "target", void 0);
27
- /**
28
- * The DOM event which caused the map event.
29
- */
30
- (0, _defineProperty2.default)(this, "originalEvent", void 0);
31
- /**
32
- * The geographic location on the map of the center of the touch event points.
33
- */
34
- (0, _defineProperty2.default)(this, "lngLat", void 0);
35
- /**
36
- * The pixel coordinates of the center of the touch event points, relative to the map and measured from the top left
37
- * corner.
38
- */
39
- (0, _defineProperty2.default)(this, "point", void 0);
40
- /**
41
- * The array of pixel coordinates corresponding to a
42
- * [touch event's `touches`](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/touches) property.
43
- */
44
- (0, _defineProperty2.default)(this, "points", void 0);
45
- /**
46
- * The geographical locations on the map corresponding to a
47
- * [touch event's `touches`](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/touches) property.
48
- */
49
- (0, _defineProperty2.default)(this, "lngLats", void 0);
50
- /**
51
- * `true` if `preventDefault` has been called.
52
- * @private
53
- */
54
- (0, _defineProperty2.default)(this, "defaultPrevented", void 0);
55
- const touches = type === 'touchend' ? originalEvent.changedTouches : originalEvent.touches;
56
- const points = _dom.default.touchPos(map.getCanvasContainer(), touches);
57
- const lngLats = points.map(t => map.unproject(t));
58
- const point = points.reduce((prev, curr, i, arr) => {
59
- return prev.add(curr.div(arr.length));
60
- }, new _point.default(0, 0));
61
- const lngLat = map.unproject(point);
62
- this.points = points;
63
- this.point = point;
64
- this.lngLats = lngLats;
65
- this.lngLat = lngLat;
66
- this.originalEvent = originalEvent;
67
- this.defaultPrevented = false;
68
- }
69
-
70
- /**
71
- * Prevents subsequent default processing of the event by the map.
72
- *
73
- * Calling this method will prevent the following default map behaviors:
74
- *
75
- * * On `touchstart` events, the behavior of {@link DragPanHandler}
76
- * * On `touchstart` events, the behavior of {@link TouchZoomRotateHandler}
77
- *
78
- */
79
- preventDefault() {
80
- this.defaultPrevented = true;
81
- }
82
- }
83
- exports.default = MapTouchEvent;
@@ -1,33 +0,0 @@
1
- import type { EarthMap } from '../../earthmap';
2
- import type { Map } from '../../map';
3
- import { Event } from './event';
4
- export interface IMapBoxZoomEvent {
5
- type: 'boxzoomstart' | 'boxzoomend' | 'boxzoomcancel';
6
- target: Map | EarthMap;
7
- originalEvent: MouseEvent;
8
- }
9
- export default class MapWheelEvent extends Event {
10
- /**
11
- * The event type.
12
- */
13
- type: 'wheel';
14
- /**
15
- * The DOM event which caused the map event.
16
- */
17
- originalEvent: WheelEvent;
18
- defaultPrevented: boolean;
19
- /**
20
- * The `Map` object that fired the event.
21
- */
22
- target: Map | EarthMap;
23
- /**
24
- * @private
25
- */
26
- constructor(type: string, map: Map | EarthMap, originalEvent: WheelEvent);
27
- /**
28
- * Prevents subsequent default processing of the event by the map.
29
- *
30
- * Calling this method will prevent the the behavior of {@link ScrollZoomHandler}.
31
- */
32
- private preventDefault;
33
- }