@antv/l7-map 2.25.7 → 2.25.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.d.ts +5 -0
- package/es/index.js +4 -0
- package/es/map/camera.d.ts +690 -0
- package/es/map/camera.js +1138 -0
- package/es/map/css/l7.css +171 -0
- package/es/map/events.d.ts +384 -0
- package/es/map/events.js +231 -0
- package/es/map/geo/edge_insets.d.ts +97 -0
- package/es/map/geo/edge_insets.js +115 -0
- package/es/map/geo/lng_lat.d.ts +116 -0
- package/es/map/geo/lng_lat.js +159 -0
- package/es/map/geo/lng_lat_bounds.d.ts +217 -0
- package/es/map/geo/lng_lat_bounds.js +334 -0
- package/es/map/geo/mercator_coordinate.d.ts +113 -0
- package/es/map/geo/mercator_coordinate.js +142 -0
- package/es/map/geo/transform.d.ts +262 -0
- package/es/map/geo/transform.js +736 -0
- package/es/map/handler/box_zoom.d.ts +65 -0
- package/es/map/handler/box_zoom.js +145 -0
- package/es/map/handler/click_zoom.d.ts +24 -0
- package/es/map/handler/click_zoom.js +47 -0
- package/es/map/handler/cooperative_gestures.d.ts +40 -0
- package/es/map/handler/cooperative_gestures.js +94 -0
- package/es/map/handler/drag_handler.d.ts +88 -0
- package/es/map/handler/drag_handler.js +89 -0
- package/es/map/handler/drag_move_state_manager.d.ts +30 -0
- package/es/map/handler/drag_move_state_manager.js +94 -0
- package/es/map/handler/handler_util.d.ts +3 -0
- package/es/map/handler/handler_util.js +8 -0
- package/es/map/handler/keyboard.d.ts +88 -0
- package/es/map/handler/keyboard.js +197 -0
- package/es/map/handler/map_event.d.ts +46 -0
- package/es/map/handler/map_event.js +131 -0
- package/es/map/handler/mouse.d.ts +30 -0
- package/es/map/handler/mouse.js +85 -0
- package/es/map/handler/one_finger_touch_drag.d.ts +15 -0
- package/es/map/handler/one_finger_touch_drag.js +39 -0
- package/es/map/handler/scroll_zoom.d.ts +102 -0
- package/es/map/handler/scroll_zoom.js +312 -0
- package/es/map/handler/shim/dblclick_zoom.d.ts +44 -0
- package/es/map/handler/shim/dblclick_zoom.js +60 -0
- package/es/map/handler/shim/drag_pan.d.ts +79 -0
- package/es/map/handler/shim/drag_pan.js +77 -0
- package/es/map/handler/shim/drag_rotate.d.ts +54 -0
- package/es/map/handler/shim/drag_rotate.js +66 -0
- package/es/map/handler/shim/two_fingers_touch.d.ts +74 -0
- package/es/map/handler/shim/two_fingers_touch.js +106 -0
- package/es/map/handler/tap_drag_zoom.d.ts +28 -0
- package/es/map/handler/tap_drag_zoom.js +92 -0
- package/es/map/handler/tap_recognizer.d.ts +35 -0
- package/es/map/handler/tap_recognizer.js +107 -0
- package/es/map/handler/tap_zoom.d.ts +28 -0
- package/es/map/handler/tap_zoom.js +87 -0
- package/es/map/handler/touch_pan.d.ts +40 -0
- package/es/map/handler/touch_pan.js +85 -0
- package/es/map/handler/transform-provider.d.ts +23 -0
- package/es/map/handler/transform-provider.js +35 -0
- package/es/map/handler/two_fingers_touch.d.ts +107 -0
- package/es/map/handler/two_fingers_touch.js +289 -0
- package/es/map/handler_inertia.d.ts +20 -0
- package/es/map/handler_inertia.js +128 -0
- package/es/map/handler_manager.d.ts +154 -0
- package/es/map/handler_manager.js +466 -0
- package/es/map/map.d.ts +637 -0
- package/es/map/map.js +984 -0
- package/es/map/util/abort_error.d.ts +15 -0
- package/es/map/util/abort_error.js +21 -0
- package/es/map/util/browser.d.ts +10 -0
- package/es/map/util/browser.js +30 -0
- package/es/map/util/dom.d.ts +30 -0
- package/es/map/util/dom.js +105 -0
- package/es/map/util/evented.d.ts +75 -0
- package/es/map/util/evented.js +158 -0
- package/es/map/util/simpleMapCoord.d.ts +31 -0
- package/es/map/util/simpleMapCoord.js +54 -0
- package/es/map/util/task_queue.d.ts +18 -0
- package/es/map/util/task_queue.js +54 -0
- package/es/map/util/util.d.ts +104 -0
- package/es/map/util/util.js +155 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.js +33 -0
- package/lib/map/camera.d.ts +690 -0
- package/lib/map/camera.js +1145 -0
- package/lib/map/css/l7.css +171 -0
- package/lib/map/events.d.ts +384 -0
- package/lib/map/events.js +240 -0
- package/lib/map/geo/edge_insets.d.ts +97 -0
- package/lib/map/geo/edge_insets.js +122 -0
- package/lib/map/geo/lng_lat.d.ts +116 -0
- package/lib/map/geo/lng_lat.js +166 -0
- package/lib/map/geo/lng_lat_bounds.d.ts +217 -0
- package/lib/map/geo/lng_lat_bounds.js +341 -0
- package/lib/map/geo/mercator_coordinate.d.ts +113 -0
- package/lib/map/geo/mercator_coordinate.js +157 -0
- package/lib/map/geo/transform.d.ts +262 -0
- package/lib/map/geo/transform.js +744 -0
- package/lib/map/handler/box_zoom.d.ts +65 -0
- package/lib/map/handler/box_zoom.js +153 -0
- package/lib/map/handler/click_zoom.d.ts +24 -0
- package/lib/map/handler/click_zoom.js +54 -0
- package/lib/map/handler/cooperative_gestures.d.ts +40 -0
- package/lib/map/handler/cooperative_gestures.js +101 -0
- package/lib/map/handler/drag_handler.d.ts +88 -0
- package/lib/map/handler/drag_handler.js +97 -0
- package/lib/map/handler/drag_move_state_manager.d.ts +30 -0
- package/lib/map/handler/drag_move_state_manager.js +103 -0
- package/lib/map/handler/handler_util.d.ts +3 -0
- package/lib/map/handler/handler_util.js +14 -0
- package/lib/map/handler/keyboard.d.ts +88 -0
- package/lib/map/handler/keyboard.js +205 -0
- package/lib/map/handler/map_event.d.ts +46 -0
- package/lib/map/handler/map_event.js +140 -0
- package/lib/map/handler/mouse.d.ts +30 -0
- package/lib/map/handler/mouse.js +93 -0
- package/lib/map/handler/one_finger_touch_drag.d.ts +15 -0
- package/lib/map/handler/one_finger_touch_drag.js +47 -0
- package/lib/map/handler/scroll_zoom.d.ts +102 -0
- package/lib/map/handler/scroll_zoom.js +320 -0
- package/lib/map/handler/shim/dblclick_zoom.d.ts +44 -0
- package/lib/map/handler/shim/dblclick_zoom.js +68 -0
- package/lib/map/handler/shim/drag_pan.d.ts +79 -0
- package/lib/map/handler/shim/drag_pan.js +85 -0
- package/lib/map/handler/shim/drag_rotate.d.ts +54 -0
- package/lib/map/handler/shim/drag_rotate.js +74 -0
- package/lib/map/handler/shim/two_fingers_touch.d.ts +74 -0
- package/lib/map/handler/shim/two_fingers_touch.js +114 -0
- package/lib/map/handler/tap_drag_zoom.d.ts +28 -0
- package/lib/map/handler/tap_drag_zoom.js +99 -0
- package/lib/map/handler/tap_recognizer.d.ts +35 -0
- package/lib/map/handler/tap_recognizer.js +116 -0
- package/lib/map/handler/tap_zoom.d.ts +28 -0
- package/lib/map/handler/tap_zoom.js +94 -0
- package/lib/map/handler/touch_pan.d.ts +40 -0
- package/lib/map/handler/touch_pan.js +92 -0
- package/lib/map/handler/transform-provider.d.ts +23 -0
- package/lib/map/handler/transform-provider.js +43 -0
- package/lib/map/handler/two_fingers_touch.d.ts +107 -0
- package/lib/map/handler/two_fingers_touch.js +296 -0
- package/lib/map/handler_inertia.d.ts +20 -0
- package/lib/map/handler_inertia.js +136 -0
- package/lib/map/handler_manager.d.ts +154 -0
- package/lib/map/handler_manager.js +474 -0
- package/lib/map/map.d.ts +637 -0
- package/lib/map/map.js +991 -0
- package/lib/map/util/abort_error.d.ts +15 -0
- package/lib/map/util/abort_error.js +29 -0
- package/lib/map/util/browser.d.ts +10 -0
- package/lib/map/util/browser.js +36 -0
- package/lib/map/util/dom.d.ts +30 -0
- package/lib/map/util/dom.js +113 -0
- package/lib/map/util/evented.d.ts +75 -0
- package/lib/map/util/evented.js +167 -0
- package/lib/map/util/simpleMapCoord.d.ts +31 -0
- package/lib/map/util/simpleMapCoord.js +62 -0
- package/lib/map/util/task_queue.d.ts +18 -0
- package/lib/map/util/task_queue.js +62 -0
- package/lib/map/util/util.d.ts +104 -0
- package/lib/map/util/util.js +171 -0
- package/package.json +2 -2
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
/// <reference types="mapbox__point-geometry" />
|
|
2
|
+
import Point from '@mapbox/point-geometry';
|
|
3
|
+
import { mat2, mat4 } from 'gl-matrix';
|
|
4
|
+
import { EdgeInsets } from './edge_insets';
|
|
5
|
+
import { LngLat } from './lng_lat';
|
|
6
|
+
import { LngLatBounds } from './lng_lat_bounds';
|
|
7
|
+
import { MercatorCoordinate } from './mercator_coordinate';
|
|
8
|
+
import type { PaddingOptions } from './edge_insets';
|
|
9
|
+
export declare const MAX_VALID_LATITUDE = 85.051129;
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
* A single transform, generally used for a single tile to be
|
|
13
|
+
* scaled, rotated, and zoomed.
|
|
14
|
+
*/
|
|
15
|
+
export declare class Transform {
|
|
16
|
+
tileSize: number;
|
|
17
|
+
tileZoom: number;
|
|
18
|
+
lngRange: [number, number];
|
|
19
|
+
latRange: [number, number];
|
|
20
|
+
scale: number;
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
angle: number;
|
|
24
|
+
rotationMatrix: mat2;
|
|
25
|
+
pixelsToGLUnits: [number, number];
|
|
26
|
+
cameraToCenterDistance: number;
|
|
27
|
+
mercatorMatrix: mat4;
|
|
28
|
+
projMatrix: mat4;
|
|
29
|
+
invProjMatrix: mat4;
|
|
30
|
+
alignedProjMatrix: mat4;
|
|
31
|
+
pixelMatrix: mat4;
|
|
32
|
+
pixelMatrix3D: mat4;
|
|
33
|
+
pixelMatrixInverse: mat4;
|
|
34
|
+
glCoordMatrix: mat4;
|
|
35
|
+
labelPlaneMatrix: mat4;
|
|
36
|
+
minElevationForCurrentTile: number;
|
|
37
|
+
_fov: number;
|
|
38
|
+
_pitch: number;
|
|
39
|
+
_zoom: number;
|
|
40
|
+
_unmodified: boolean;
|
|
41
|
+
_renderWorldCopies: boolean;
|
|
42
|
+
_minZoom: number;
|
|
43
|
+
_maxZoom: number;
|
|
44
|
+
_minPitch: number;
|
|
45
|
+
_maxPitch: number;
|
|
46
|
+
_center: LngLat;
|
|
47
|
+
_elevation: number;
|
|
48
|
+
_pixelPerMeter: number;
|
|
49
|
+
_edgeInsets: EdgeInsets;
|
|
50
|
+
_constraining: boolean;
|
|
51
|
+
_posMatrixCache: {
|
|
52
|
+
[_: string]: mat4;
|
|
53
|
+
};
|
|
54
|
+
_alignedPosMatrixCache: {
|
|
55
|
+
[_: string]: mat4;
|
|
56
|
+
};
|
|
57
|
+
constructor(minZoom?: number, maxZoom?: number, minPitch?: number, maxPitch?: number, renderWorldCopies?: boolean);
|
|
58
|
+
clone(): Transform;
|
|
59
|
+
apply(that: Transform): void;
|
|
60
|
+
get minZoom(): number;
|
|
61
|
+
set minZoom(zoom: number);
|
|
62
|
+
get maxZoom(): number;
|
|
63
|
+
set maxZoom(zoom: number);
|
|
64
|
+
get minPitch(): number;
|
|
65
|
+
set minPitch(pitch: number);
|
|
66
|
+
get maxPitch(): number;
|
|
67
|
+
set maxPitch(pitch: number);
|
|
68
|
+
get renderWorldCopies(): boolean;
|
|
69
|
+
set renderWorldCopies(renderWorldCopies: boolean | null | undefined);
|
|
70
|
+
get worldSize(): number;
|
|
71
|
+
get centerOffset(): Point;
|
|
72
|
+
get size(): Point;
|
|
73
|
+
get bearing(): number;
|
|
74
|
+
set bearing(bearing: number);
|
|
75
|
+
get pitch(): number;
|
|
76
|
+
set pitch(pitch: number);
|
|
77
|
+
get fov(): number;
|
|
78
|
+
set fov(fov: number);
|
|
79
|
+
get zoom(): number;
|
|
80
|
+
set zoom(zoom: number);
|
|
81
|
+
get center(): LngLat;
|
|
82
|
+
set center(center: LngLat);
|
|
83
|
+
/**
|
|
84
|
+
* Elevation at current center point, meters above sea level
|
|
85
|
+
*/
|
|
86
|
+
get elevation(): number;
|
|
87
|
+
set elevation(elevation: number);
|
|
88
|
+
get padding(): PaddingOptions;
|
|
89
|
+
set padding(padding: PaddingOptions);
|
|
90
|
+
/**
|
|
91
|
+
* The center of the screen in pixels with the top-left corner being (0,0)
|
|
92
|
+
* and +y axis pointing downwards. This accounts for padding.
|
|
93
|
+
*/
|
|
94
|
+
get centerPoint(): Point;
|
|
95
|
+
/**
|
|
96
|
+
* Returns if the padding params match
|
|
97
|
+
*
|
|
98
|
+
* @param padding - the padding to check against
|
|
99
|
+
* @returns true if they are equal, false otherwise
|
|
100
|
+
*/
|
|
101
|
+
isPaddingEqual(padding: PaddingOptions): boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Helper method to update edge-insets in place
|
|
104
|
+
*
|
|
105
|
+
* @param start - the starting padding
|
|
106
|
+
* @param target - the target padding
|
|
107
|
+
* @param t - the step/weight
|
|
108
|
+
*/
|
|
109
|
+
interpolatePadding(start: PaddingOptions, target: PaddingOptions, t: number): void;
|
|
110
|
+
/**
|
|
111
|
+
* Return a zoom level that will cover all tiles the transform
|
|
112
|
+
* @param options - the options
|
|
113
|
+
* @returns zoom level An integer zoom level at which all tiles will be visible.
|
|
114
|
+
*/
|
|
115
|
+
coveringZoomLevel(options: {
|
|
116
|
+
/**
|
|
117
|
+
* Target zoom level. If true, the value will be rounded to the closest integer. Otherwise the value will be floored.
|
|
118
|
+
*/
|
|
119
|
+
roundZoom?: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Tile size, expressed in screen pixels.
|
|
122
|
+
*/
|
|
123
|
+
tileSize: number;
|
|
124
|
+
}): number;
|
|
125
|
+
resize(width: number, height: number): void;
|
|
126
|
+
get unmodified(): boolean;
|
|
127
|
+
zoomScale(zoom: number): number;
|
|
128
|
+
scaleZoom(scale: number): number;
|
|
129
|
+
/**
|
|
130
|
+
* Convert from LngLat to world coordinates (Mercator coordinates scaled by 512)
|
|
131
|
+
* @param lnglat - the lngLat
|
|
132
|
+
* @returns Point
|
|
133
|
+
*/
|
|
134
|
+
project(lnglat: LngLat): Point;
|
|
135
|
+
/**
|
|
136
|
+
* Convert from world coordinates ([0, 512],[0, 512]) to LngLat ([-180, 180], [-90, 90])
|
|
137
|
+
* @param point - world coordinate
|
|
138
|
+
* @returns LngLat
|
|
139
|
+
*/
|
|
140
|
+
unproject(point: Point): LngLat;
|
|
141
|
+
get point(): Point;
|
|
142
|
+
/**
|
|
143
|
+
* get the camera position in LngLat and altitudes in meter
|
|
144
|
+
* @returns An object with lngLat & altitude.
|
|
145
|
+
*/
|
|
146
|
+
getCameraPosition(): {
|
|
147
|
+
lngLat: LngLat;
|
|
148
|
+
altitude: number;
|
|
149
|
+
};
|
|
150
|
+
setLocationAtPoint(lnglat: LngLat, point: Point): void;
|
|
151
|
+
/**
|
|
152
|
+
* Given a LngLat location, return the screen point that corresponds to it
|
|
153
|
+
* @param lnglat - location
|
|
154
|
+
* @param terrain - optional terrain
|
|
155
|
+
* @returns screen point
|
|
156
|
+
*/
|
|
157
|
+
locationPoint(lnglat: LngLat): Point;
|
|
158
|
+
/**
|
|
159
|
+
* Given a point on screen, return its lnglat
|
|
160
|
+
* @param p - screen point
|
|
161
|
+
* @param terrain - optional terrain
|
|
162
|
+
* @returns lnglat location
|
|
163
|
+
*/
|
|
164
|
+
pointLocation(p: Point): LngLat;
|
|
165
|
+
/**
|
|
166
|
+
* Given a geographical lnglat, return an unrounded
|
|
167
|
+
* coordinate that represents it at low zoom level.
|
|
168
|
+
* @param lnglat - the location
|
|
169
|
+
* @returns The mercator coordinate
|
|
170
|
+
*/
|
|
171
|
+
locationCoordinate(lnglat: LngLat): MercatorCoordinate;
|
|
172
|
+
/**
|
|
173
|
+
* Given a Coordinate, return its geographical position.
|
|
174
|
+
* @param coord - mercator coordinates
|
|
175
|
+
* @returns lng and lat
|
|
176
|
+
*/
|
|
177
|
+
coordinateLocation(coord: MercatorCoordinate): LngLat;
|
|
178
|
+
/**
|
|
179
|
+
* Given a Point, return its mercator coordinate.
|
|
180
|
+
* @param p - the point
|
|
181
|
+
* @param terrain - optional terrain
|
|
182
|
+
* @returns lnglat
|
|
183
|
+
*/
|
|
184
|
+
pointCoordinate(p: Point): MercatorCoordinate;
|
|
185
|
+
/**
|
|
186
|
+
* Given a coordinate, return the screen point that corresponds to it
|
|
187
|
+
* @param coord - the coordinates
|
|
188
|
+
* @param elevation - the elevation
|
|
189
|
+
* @param pixelMatrix - the pixel matrix
|
|
190
|
+
* @returns screen point
|
|
191
|
+
*/
|
|
192
|
+
coordinatePoint(coord: MercatorCoordinate, elevation?: number, pixelMatrix?: mat4): Point;
|
|
193
|
+
/**
|
|
194
|
+
* Returns the map's geographical bounds. When the bearing or pitch is non-zero, the visible region is not
|
|
195
|
+
* an axis-aligned rectangle, and the result is the smallest bounds that encompasses the visible region.
|
|
196
|
+
* @returns Returns a {@link LngLatBounds} object describing the map's geographical bounds.
|
|
197
|
+
*/
|
|
198
|
+
getBounds(): LngLatBounds;
|
|
199
|
+
/**
|
|
200
|
+
* Returns the maximum geographical bounds the map is constrained to, or `null` if none set.
|
|
201
|
+
* @returns max bounds
|
|
202
|
+
*/
|
|
203
|
+
getMaxBounds(): LngLatBounds | null;
|
|
204
|
+
/**
|
|
205
|
+
* Calculate pixel height of the visible horizon in relation to map-center (e.g. height/2),
|
|
206
|
+
* multiplied by a static factor to simulate the earth-radius.
|
|
207
|
+
* The calculated value is the horizontal line from the camera-height to sea-level.
|
|
208
|
+
* @returns Horizon above center in pixels.
|
|
209
|
+
*/
|
|
210
|
+
getHorizon(): number;
|
|
211
|
+
/**
|
|
212
|
+
* Sets or clears the map's geographical constraints.
|
|
213
|
+
* @param bounds - A {@link LngLatBounds} object describing the new geographic boundaries of the map.
|
|
214
|
+
*/
|
|
215
|
+
setMaxBounds(bounds?: LngLatBounds | null): void;
|
|
216
|
+
customLayerMatrix(): mat4;
|
|
217
|
+
/**
|
|
218
|
+
* Get center lngLat and zoom to ensure that
|
|
219
|
+
* 1) everything beyond the bounds is excluded
|
|
220
|
+
* 2) a given lngLat is as near the center as possible
|
|
221
|
+
* Bounds are those set by maxBounds or North & South "Poles" and, if only 1 globe is displayed, antimeridian.
|
|
222
|
+
*/
|
|
223
|
+
getConstrained(lngLat: LngLat, zoom: number): {
|
|
224
|
+
center: LngLat;
|
|
225
|
+
zoom: number;
|
|
226
|
+
};
|
|
227
|
+
_constrain(): void;
|
|
228
|
+
_calcMatrices(): void;
|
|
229
|
+
maxPitchScaleFactor(): number;
|
|
230
|
+
/**
|
|
231
|
+
* The camera looks at the map from a 3D (lng, lat, altitude) location. Let's use `cameraLocation`
|
|
232
|
+
* as the name for the location under the camera and on the surface of the earth (lng, lat, 0).
|
|
233
|
+
* `cameraPoint` is the projected position of the `cameraLocation`.
|
|
234
|
+
*
|
|
235
|
+
* This point is useful to us because only fill-extrusions that are between `cameraPoint` and
|
|
236
|
+
* the query point on the surface of the earth can extend and intersect the query.
|
|
237
|
+
*
|
|
238
|
+
* When the map is not pitched the `cameraPoint` is equivalent to the center of the map because
|
|
239
|
+
* the camera is right above the center of the map.
|
|
240
|
+
*/
|
|
241
|
+
getCameraPoint(): Point;
|
|
242
|
+
/**
|
|
243
|
+
* When the map is pitched, some of the 3D features that intersect a query will not intersect
|
|
244
|
+
* the query at the surface of the earth. Instead the feature may be closer and only intersect
|
|
245
|
+
* the query because it extrudes into the air.
|
|
246
|
+
* @param queryGeometry - For point queries, the line from the query point to the "camera point",
|
|
247
|
+
* for other geometries, the envelope of the query geometry and the "camera point"
|
|
248
|
+
* @returns a geometry that includes all of the original query as well as all possible ares of the
|
|
249
|
+
* screen where the *base* of a visible extrusion could be.
|
|
250
|
+
*
|
|
251
|
+
*/
|
|
252
|
+
getCameraQueryGeometry(queryGeometry: Array<Point>): Array<Point>;
|
|
253
|
+
/**
|
|
254
|
+
* Return the distance to the camera in clip space from a LngLat.
|
|
255
|
+
* This can be compared to the value from the depth buffer (terrain.depthAtPoint)
|
|
256
|
+
* to determine whether a point is occluded.
|
|
257
|
+
* @param lngLat - the point
|
|
258
|
+
* @param elevation - the point's elevation
|
|
259
|
+
* @returns depth value in clip space (between 0 and 1)
|
|
260
|
+
*/
|
|
261
|
+
lngLatToCameraDepth(lngLat: LngLat, elevation: number): number;
|
|
262
|
+
}
|