@antv/l7-map 2.21.0 → 2.21.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 (158) hide show
  1. package/es/camera.js +595 -674
  2. package/es/earthmap.js +313 -276
  3. package/es/geo/edge_insets.js +57 -72
  4. package/es/geo/lng_lat.js +50 -64
  5. package/es/geo/lng_lat_bounds.js +101 -137
  6. package/es/geo/mercator.js +23 -35
  7. package/es/geo/point.js +150 -221
  8. package/es/geo/simple.js +22 -34
  9. package/es/geo/transform.js +839 -905
  10. package/es/handler/blockable_map_event.js +46 -66
  11. package/es/handler/box_zoom.js +125 -143
  12. package/es/handler/click_zoom.js +37 -51
  13. package/es/handler/events/event.js +11 -9
  14. package/es/handler/events/map_mouse_event.js +39 -54
  15. package/es/handler/events/map_touch_event.js +54 -73
  16. package/es/handler/events/map_wheel_event.js +22 -38
  17. package/es/handler/events/render_event.js +6 -23
  18. package/es/handler/handler_inertia.js +98 -113
  19. package/es/handler/handler_manager.js +349 -437
  20. package/es/handler/handler_util.js +2 -2
  21. package/es/handler/keyboard.js +98 -110
  22. package/es/handler/map_event.js +81 -117
  23. package/es/handler/mouse/mouse_handler.js +81 -100
  24. package/es/handler/mouse/mousepan_handler.js +16 -39
  25. package/es/handler/mouse/mousepitch_hander.js +18 -40
  26. package/es/handler/mouse/mouserotate_hander.js +18 -40
  27. package/es/handler/mouse/util.js +7 -6
  28. package/es/handler/scroll_zoom.js +221 -231
  29. package/es/handler/shim/dblclick_zoom.js +36 -47
  30. package/es/handler/shim/drag_pan.js +41 -50
  31. package/es/handler/shim/drag_rotate.js +38 -48
  32. package/es/handler/shim/touch_zoom_rotate.js +68 -79
  33. package/es/handler/tap/single_tap_recognizer.js +60 -80
  34. package/es/handler/tap/tap_drag_zoom.js +72 -89
  35. package/es/handler/tap/tap_recognizer.js +37 -45
  36. package/es/handler/tap/tap_zoom.js +67 -95
  37. package/es/handler/touch/touch_pan.js +77 -96
  38. package/es/handler/touch/touch_pitch.js +61 -79
  39. package/es/handler/touch/touch_rotate.js +47 -67
  40. package/es/handler/touch/touch_zoom.js +29 -46
  41. package/es/handler/touch/two_touch.js +79 -104
  42. package/es/hash.js +75 -88
  43. package/es/map.js +318 -284
  44. package/es/util.js +18 -37
  45. package/es/utils/Aabb.js +60 -100
  46. package/es/utils/dom.js +32 -55
  47. package/es/utils/performance.js +25 -29
  48. package/es/utils/primitives.js +33 -43
  49. package/es/utils/task_queue.js +47 -76
  50. package/lib/camera.d.ts +86 -0
  51. package/lib/camera.js +597 -672
  52. package/lib/earthmap.d.ts +69 -0
  53. package/lib/earthmap.js +314 -276
  54. package/lib/geo/edge_insets.d.ts +54 -0
  55. package/lib/geo/edge_insets.js +58 -70
  56. package/lib/geo/lng_lat.d.ts +18 -0
  57. package/lib/geo/lng_lat.js +50 -62
  58. package/lib/geo/lng_lat_bounds.d.ts +25 -0
  59. package/lib/geo/lng_lat_bounds.js +102 -136
  60. package/lib/geo/mercator.d.ts +30 -0
  61. package/lib/geo/mercator.js +26 -37
  62. package/lib/geo/point.d.ts +40 -0
  63. package/lib/geo/point.js +151 -220
  64. package/lib/geo/simple.d.ts +30 -0
  65. package/lib/geo/simple.js +25 -36
  66. package/lib/geo/transform.d.ts +198 -0
  67. package/lib/geo/transform.js +844 -907
  68. package/lib/handler/IHandler.d.ts +34 -0
  69. package/lib/handler/blockable_map_event.d.ts +17 -0
  70. package/lib/handler/blockable_map_event.js +48 -65
  71. package/lib/handler/box_zoom.d.ts +59 -0
  72. package/lib/handler/box_zoom.js +126 -143
  73. package/lib/handler/click_zoom.d.ts +16 -0
  74. package/lib/handler/click_zoom.js +38 -50
  75. package/lib/handler/events/event.d.ts +4 -0
  76. package/lib/handler/events/event.js +12 -9
  77. package/lib/handler/events/index.d.ts +4 -0
  78. package/lib/handler/events/index.js +3 -3
  79. package/lib/handler/events/map_mouse_event.d.ts +34 -0
  80. package/lib/handler/events/map_mouse_event.js +41 -52
  81. package/lib/handler/events/map_touch_event.d.ts +57 -0
  82. package/lib/handler/events/map_touch_event.js +56 -71
  83. package/lib/handler/events/map_wheel_event.d.ts +33 -0
  84. package/lib/handler/events/map_wheel_event.js +23 -37
  85. package/lib/handler/events/render_event.d.ts +5 -0
  86. package/lib/handler/events/render_event.js +7 -22
  87. package/lib/handler/handler_inertia.d.ts +23 -0
  88. package/lib/handler/handler_inertia.js +102 -112
  89. package/lib/handler/handler_manager.d.ts +61 -0
  90. package/lib/handler/handler_manager.js +351 -437
  91. package/lib/handler/handler_util.d.ts +4 -0
  92. package/lib/handler/handler_util.js +2 -2
  93. package/lib/handler/keyboard.d.ts +36 -0
  94. package/lib/handler/keyboard.js +98 -110
  95. package/lib/handler/map_event.d.ts +29 -0
  96. package/lib/handler/map_event.js +83 -116
  97. package/lib/handler/mouse/index.d.ts +4 -0
  98. package/lib/handler/mouse/index.js +3 -3
  99. package/lib/handler/mouse/mouse_handler.d.ts +22 -0
  100. package/lib/handler/mouse/mouse_handler.js +83 -99
  101. package/lib/handler/mouse/mousepan_handler.d.ts +10 -0
  102. package/lib/handler/mouse/mousepan_handler.js +19 -38
  103. package/lib/handler/mouse/mousepitch_hander.d.ts +9 -0
  104. package/lib/handler/mouse/mousepitch_hander.js +21 -39
  105. package/lib/handler/mouse/mouserotate_hander.d.ts +9 -0
  106. package/lib/handler/mouse/mouserotate_hander.js +21 -39
  107. package/lib/handler/mouse/util.d.ts +6 -0
  108. package/lib/handler/mouse/util.js +7 -7
  109. package/lib/handler/scroll_zoom.d.ts +93 -0
  110. package/lib/handler/scroll_zoom.js +221 -231
  111. package/lib/handler/shim/dblclick_zoom.d.ts +40 -0
  112. package/lib/handler/shim/dblclick_zoom.js +37 -46
  113. package/lib/handler/shim/drag_pan.d.ts +61 -0
  114. package/lib/handler/shim/drag_pan.js +42 -49
  115. package/lib/handler/shim/drag_rotate.d.ts +46 -0
  116. package/lib/handler/shim/drag_rotate.js +39 -47
  117. package/lib/handler/shim/touch_zoom_rotate.d.ts +70 -0
  118. package/lib/handler/shim/touch_zoom_rotate.js +69 -78
  119. package/lib/handler/tap/single_tap_recognizer.d.ts +20 -0
  120. package/lib/handler/tap/single_tap_recognizer.js +63 -79
  121. package/lib/handler/tap/tap_drag_zoom.d.ts +22 -0
  122. package/lib/handler/tap/tap_drag_zoom.js +74 -88
  123. package/lib/handler/tap/tap_recognizer.d.ts +17 -0
  124. package/lib/handler/tap/tap_recognizer.js +41 -47
  125. package/lib/handler/tap/tap_zoom.d.ts +22 -0
  126. package/lib/handler/tap/tap_zoom.js +69 -94
  127. package/lib/handler/touch/index.d.ts +5 -0
  128. package/lib/handler/touch/index.js +4 -4
  129. package/lib/handler/touch/touch_pan.d.ts +30 -0
  130. package/lib/handler/touch/touch_pan.js +79 -95
  131. package/lib/handler/touch/touch_pitch.d.ts +13 -0
  132. package/lib/handler/touch/touch_pitch.js +64 -78
  133. package/lib/handler/touch/touch_rotate.d.ts +12 -0
  134. package/lib/handler/touch/touch_rotate.js +50 -66
  135. package/lib/handler/touch/touch_zoom.d.ts +12 -0
  136. package/lib/handler/touch/touch_zoom.js +32 -45
  137. package/lib/handler/touch/two_touch.d.ts +23 -0
  138. package/lib/handler/touch/two_touch.js +81 -103
  139. package/lib/hash.d.ts +14 -0
  140. package/lib/hash.js +75 -88
  141. package/lib/index.d.ts +4 -0
  142. package/lib/index.js +4 -4
  143. package/lib/interface.d.ts +34 -0
  144. package/lib/map.d.ts +70 -0
  145. package/lib/map.js +319 -284
  146. package/lib/util.d.ts +25 -0
  147. package/lib/util.js +20 -36
  148. package/lib/utils/Aabb.d.ts +12 -0
  149. package/lib/utils/Aabb.js +61 -99
  150. package/lib/utils/dom.d.ts +4 -0
  151. package/lib/utils/dom.js +34 -55
  152. package/lib/utils/performance.d.ts +17 -0
  153. package/lib/utils/performance.js +25 -29
  154. package/lib/utils/primitives.d.ts +6 -0
  155. package/lib/utils/primitives.js +34 -42
  156. package/lib/utils/task_queue.d.ts +13 -0
  157. package/lib/utils/task_queue.js +47 -76
  158. package/package.json +25 -32
@@ -0,0 +1,198 @@
1
+ import { mat2, mat4 } from 'gl-matrix';
2
+ import Point from '../geo/point';
3
+ import type { IPaddingOptions } from './edge_insets';
4
+ import LngLat from './lng_lat';
5
+ import LngLatBounds from './lng_lat_bounds';
6
+ import MercatorCoordinate from './mercator';
7
+ export declare const EXTENT = 8192;
8
+ export default class Transform {
9
+ get minZoom(): number;
10
+ set minZoom(zoom: number);
11
+ get maxZoom(): number;
12
+ set maxZoom(zoom: number);
13
+ get minPitch(): number;
14
+ set minPitch(pitch: number);
15
+ get maxPitch(): number;
16
+ set maxPitch(pitch: number);
17
+ get renderWorldCopies(): boolean;
18
+ set renderWorldCopies(renderWorldCopies: boolean);
19
+ get worldSize(): number;
20
+ get centerOffset(): Point;
21
+ get size(): Point;
22
+ get bearing(): number;
23
+ set bearing(bearing: number);
24
+ get pitch(): number;
25
+ set pitch(pitch: number);
26
+ get fov(): number;
27
+ set fov(fov: number);
28
+ get zoom(): number;
29
+ set zoom(zoom: number);
30
+ get center(): LngLat;
31
+ set center(center: LngLat);
32
+ get padding(): IPaddingOptions;
33
+ set padding(padding: IPaddingOptions);
34
+ /**
35
+ * The center of the screen in pixels with the top-left corner being (0,0)
36
+ * and +y axis pointing downwards. This accounts for padding.
37
+ *
38
+ * @readonly
39
+ * @type {Point}
40
+ * @memberof Transform
41
+ */
42
+ get centerPoint(): Point;
43
+ get point(): Point;
44
+ tileSize: number;
45
+ tileZoom: number;
46
+ lngRange?: [number, number];
47
+ latRange?: [number, number];
48
+ maxValidLatitude: number;
49
+ scale: number;
50
+ width: number;
51
+ height: number;
52
+ angle: number;
53
+ rotationMatrix: mat2;
54
+ pixelsToGLUnits: [number, number];
55
+ cameraToCenterDistance: number;
56
+ mercatorMatrix: mat4;
57
+ projMatrix: mat4;
58
+ invProjMatrix: mat4;
59
+ alignedProjMatrix: mat4;
60
+ pixelMatrix: mat4;
61
+ pixelMatrixInverse: mat4;
62
+ glCoordMatrix: mat4;
63
+ labelPlaneMatrix: mat4;
64
+ private _fov;
65
+ private _pitch;
66
+ private _zoom;
67
+ private _renderWorldCopies;
68
+ private _minZoom;
69
+ private _maxZoom;
70
+ private _minPitch;
71
+ private _maxPitch;
72
+ private _center;
73
+ private zoomFraction;
74
+ private unmodified;
75
+ private edgeInsets;
76
+ private constraining;
77
+ private posMatrixCache;
78
+ private alignedPosMatrixCache;
79
+ constructor(minZoom: number, maxZoom: number, minPitch: number, maxPitch: number, renderWorldCopies: boolean | void);
80
+ clone(): Transform;
81
+ /**
82
+ * Returns if the padding params match
83
+ *
84
+ * @param {IPaddingOptions} padding
85
+ * @returns {boolean}
86
+ * @memberof Transform
87
+ */
88
+ isPaddingEqual(padding: IPaddingOptions): boolean;
89
+ /**
90
+ * Helper method to upadte edge-insets inplace
91
+ *
92
+ * @param {IPaddingOptions} target
93
+ * @param {number} t
94
+ * @memberof Transform
95
+ */
96
+ interpolatePadding(start: IPaddingOptions, target: IPaddingOptions, t: number): void;
97
+ /**
98
+ * Return a zoom level that will cover all tiles the transform
99
+ * @param {Object} options options
100
+ * @param {number} options.tileSize Tile size, expressed in screen pixels.
101
+ * @param {boolean} options.roundZoom Target zoom level. If true, the value will be rounded to the closest integer. Otherwise the value will be floored.
102
+ * @returns {number} zoom level An integer zoom level at which all tiles will be visible.
103
+ */
104
+ coveringZoomLevel(options: {
105
+ roundZoom?: boolean;
106
+ tileSize: number;
107
+ }): number;
108
+ /**
109
+ * Return any "wrapped" copies of a given tile coordinate that are visible
110
+ * in the current view.
111
+ *
112
+ * @private
113
+ */
114
+ /**
115
+ * Return all coordinates that could cover this transform for a covering
116
+ * zoom level.
117
+ * @param {Object} options
118
+ * @param {number} options.tileSize
119
+ * @param {number} options.minzoom
120
+ * @param {number} options.maxzoom
121
+ * @param {boolean} options.roundZoom
122
+ * @param {boolean} options.reparseOverscaled
123
+ * @param {boolean} options.renderWorldCopies
124
+ * @returns {Array<OverscaledTileID>} OverscaledTileIDs
125
+ * @private
126
+ */
127
+ resize(width: number, height: number): void;
128
+ zoomScale(zoom: number): number;
129
+ scaleZoom(scale: number): number;
130
+ project(lnglat: LngLat): Point;
131
+ unproject(point: Point): LngLat;
132
+ setLocationAtPoint(lnglat: LngLat, point: Point): void;
133
+ pointCoordinate(p: Point): MercatorCoordinate;
134
+ /**
135
+ * Returns the map's geographical bounds. When the bearing or pitch is non-zero, the visible region is not
136
+ * an axis-aligned rectangle, and the result is the smallest bounds that encompasses the visible region.
137
+ * @returns {LngLatBounds} Returns a {@link LngLatBounds} object describing the map's geographical bounds.
138
+ */
139
+ getBounds(): LngLatBounds;
140
+ /**
141
+ * Returns the maximum geographical bounds the map is constrained to, or `null` if none set.
142
+ * @returns {LngLatBounds} {@link LngLatBounds}
143
+ */
144
+ getMaxBounds(): LngLatBounds | null;
145
+ /**
146
+ * Sets or clears the map's geographical constraints.
147
+ * @param {LngLatBounds} bounds A {@link LngLatBounds} object describing the new geographic boundaries of the map.
148
+ */
149
+ setMaxBounds(bounds?: LngLatBounds): void;
150
+ customLayerMatrix(): number[];
151
+ maxPitchScaleFactor(): number;
152
+ getCameraPoint(): Point;
153
+ getCameraQueryGeometry(queryGeometry: Point[]): Point[];
154
+ /**
155
+ * Given a coordinate, return the screen point that corresponds to it
156
+ * @param {Coordinate} coord
157
+ * @returns {Point} screen point
158
+ * @private
159
+ */
160
+ coordinatePoint(coord: MercatorCoordinate): Point;
161
+ /**
162
+ * Given a location, return the screen point that corresponds to it
163
+ * @param {LngLat} lnglat location
164
+ * @returns {Point} screen point
165
+ * @private
166
+ */
167
+ locationPoint(lnglat: LngLat): Point;
168
+ /**
169
+ * Given a point on screen, return its lnglat
170
+ * @param {Point} p screen point
171
+ * @returns {LngLat} lnglat location
172
+ * @private
173
+ */
174
+ pointLocation(p: Point): LngLat;
175
+ /**
176
+ * Given a geographical lnglat, return an unrounded
177
+ * coordinate that represents it at this transform's zoom level.
178
+ * @param {LngLat} lnglat
179
+ * @returns {Coordinate}
180
+ * @private
181
+ */
182
+ locationCoordinate(lnglat: LngLat): MercatorCoordinate;
183
+ /**
184
+ * Given a Coordinate, return its geographical position.
185
+ * @param {Coordinate} coord
186
+ * @returns {LngLat} lnglat
187
+ * @private
188
+ */
189
+ coordinateLocation(coord: MercatorCoordinate): LngLat;
190
+ getProjectionMatrix(): mat4;
191
+ /**
192
+ * Calculate the posMatrix that, given a tile coordinate, would be used to display the tile on a map.
193
+ * @param {UnwrappedTileID} unwrappedTileID;
194
+ * @private
195
+ */
196
+ private constrain;
197
+ private calcMatrices;
198
+ }