@antv/l7-map 2.25.5 → 2.25.7

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 (159) hide show
  1. package/package.json +2 -2
  2. package/es/index.d.ts +0 -5
  3. package/es/index.js +0 -4
  4. package/es/map/camera.d.ts +0 -690
  5. package/es/map/camera.js +0 -1138
  6. package/es/map/css/l7.css +0 -171
  7. package/es/map/events.d.ts +0 -384
  8. package/es/map/events.js +0 -231
  9. package/es/map/geo/edge_insets.d.ts +0 -97
  10. package/es/map/geo/edge_insets.js +0 -115
  11. package/es/map/geo/lng_lat.d.ts +0 -116
  12. package/es/map/geo/lng_lat.js +0 -159
  13. package/es/map/geo/lng_lat_bounds.d.ts +0 -217
  14. package/es/map/geo/lng_lat_bounds.js +0 -334
  15. package/es/map/geo/mercator_coordinate.d.ts +0 -113
  16. package/es/map/geo/mercator_coordinate.js +0 -142
  17. package/es/map/geo/transform.d.ts +0 -262
  18. package/es/map/geo/transform.js +0 -736
  19. package/es/map/handler/box_zoom.d.ts +0 -65
  20. package/es/map/handler/box_zoom.js +0 -145
  21. package/es/map/handler/click_zoom.d.ts +0 -24
  22. package/es/map/handler/click_zoom.js +0 -47
  23. package/es/map/handler/cooperative_gestures.d.ts +0 -40
  24. package/es/map/handler/cooperative_gestures.js +0 -94
  25. package/es/map/handler/drag_handler.d.ts +0 -88
  26. package/es/map/handler/drag_handler.js +0 -89
  27. package/es/map/handler/drag_move_state_manager.d.ts +0 -30
  28. package/es/map/handler/drag_move_state_manager.js +0 -94
  29. package/es/map/handler/handler_util.d.ts +0 -3
  30. package/es/map/handler/handler_util.js +0 -8
  31. package/es/map/handler/keyboard.d.ts +0 -88
  32. package/es/map/handler/keyboard.js +0 -197
  33. package/es/map/handler/map_event.d.ts +0 -46
  34. package/es/map/handler/map_event.js +0 -131
  35. package/es/map/handler/mouse.d.ts +0 -30
  36. package/es/map/handler/mouse.js +0 -85
  37. package/es/map/handler/one_finger_touch_drag.d.ts +0 -15
  38. package/es/map/handler/one_finger_touch_drag.js +0 -39
  39. package/es/map/handler/scroll_zoom.d.ts +0 -102
  40. package/es/map/handler/scroll_zoom.js +0 -312
  41. package/es/map/handler/shim/dblclick_zoom.d.ts +0 -44
  42. package/es/map/handler/shim/dblclick_zoom.js +0 -60
  43. package/es/map/handler/shim/drag_pan.d.ts +0 -79
  44. package/es/map/handler/shim/drag_pan.js +0 -77
  45. package/es/map/handler/shim/drag_rotate.d.ts +0 -54
  46. package/es/map/handler/shim/drag_rotate.js +0 -66
  47. package/es/map/handler/shim/two_fingers_touch.d.ts +0 -74
  48. package/es/map/handler/shim/two_fingers_touch.js +0 -106
  49. package/es/map/handler/tap_drag_zoom.d.ts +0 -28
  50. package/es/map/handler/tap_drag_zoom.js +0 -92
  51. package/es/map/handler/tap_recognizer.d.ts +0 -35
  52. package/es/map/handler/tap_recognizer.js +0 -107
  53. package/es/map/handler/tap_zoom.d.ts +0 -28
  54. package/es/map/handler/tap_zoom.js +0 -87
  55. package/es/map/handler/touch_pan.d.ts +0 -40
  56. package/es/map/handler/touch_pan.js +0 -85
  57. package/es/map/handler/transform-provider.d.ts +0 -23
  58. package/es/map/handler/transform-provider.js +0 -35
  59. package/es/map/handler/two_fingers_touch.d.ts +0 -107
  60. package/es/map/handler/two_fingers_touch.js +0 -289
  61. package/es/map/handler_inertia.d.ts +0 -20
  62. package/es/map/handler_inertia.js +0 -128
  63. package/es/map/handler_manager.d.ts +0 -154
  64. package/es/map/handler_manager.js +0 -466
  65. package/es/map/map.d.ts +0 -637
  66. package/es/map/map.js +0 -984
  67. package/es/map/util/abort_error.d.ts +0 -15
  68. package/es/map/util/abort_error.js +0 -21
  69. package/es/map/util/browser.d.ts +0 -10
  70. package/es/map/util/browser.js +0 -30
  71. package/es/map/util/dom.d.ts +0 -30
  72. package/es/map/util/dom.js +0 -105
  73. package/es/map/util/evented.d.ts +0 -75
  74. package/es/map/util/evented.js +0 -158
  75. package/es/map/util/simpleMapCoord.d.ts +0 -31
  76. package/es/map/util/simpleMapCoord.js +0 -54
  77. package/es/map/util/task_queue.d.ts +0 -18
  78. package/es/map/util/task_queue.js +0 -54
  79. package/es/map/util/util.d.ts +0 -104
  80. package/es/map/util/util.js +0 -155
  81. package/lib/index.d.ts +0 -5
  82. package/lib/index.js +0 -33
  83. package/lib/map/camera.d.ts +0 -690
  84. package/lib/map/camera.js +0 -1145
  85. package/lib/map/css/l7.css +0 -171
  86. package/lib/map/events.d.ts +0 -384
  87. package/lib/map/events.js +0 -240
  88. package/lib/map/geo/edge_insets.d.ts +0 -97
  89. package/lib/map/geo/edge_insets.js +0 -122
  90. package/lib/map/geo/lng_lat.d.ts +0 -116
  91. package/lib/map/geo/lng_lat.js +0 -166
  92. package/lib/map/geo/lng_lat_bounds.d.ts +0 -217
  93. package/lib/map/geo/lng_lat_bounds.js +0 -341
  94. package/lib/map/geo/mercator_coordinate.d.ts +0 -113
  95. package/lib/map/geo/mercator_coordinate.js +0 -157
  96. package/lib/map/geo/transform.d.ts +0 -262
  97. package/lib/map/geo/transform.js +0 -744
  98. package/lib/map/handler/box_zoom.d.ts +0 -65
  99. package/lib/map/handler/box_zoom.js +0 -153
  100. package/lib/map/handler/click_zoom.d.ts +0 -24
  101. package/lib/map/handler/click_zoom.js +0 -54
  102. package/lib/map/handler/cooperative_gestures.d.ts +0 -40
  103. package/lib/map/handler/cooperative_gestures.js +0 -101
  104. package/lib/map/handler/drag_handler.d.ts +0 -88
  105. package/lib/map/handler/drag_handler.js +0 -97
  106. package/lib/map/handler/drag_move_state_manager.d.ts +0 -30
  107. package/lib/map/handler/drag_move_state_manager.js +0 -103
  108. package/lib/map/handler/handler_util.d.ts +0 -3
  109. package/lib/map/handler/handler_util.js +0 -14
  110. package/lib/map/handler/keyboard.d.ts +0 -88
  111. package/lib/map/handler/keyboard.js +0 -205
  112. package/lib/map/handler/map_event.d.ts +0 -46
  113. package/lib/map/handler/map_event.js +0 -140
  114. package/lib/map/handler/mouse.d.ts +0 -30
  115. package/lib/map/handler/mouse.js +0 -93
  116. package/lib/map/handler/one_finger_touch_drag.d.ts +0 -15
  117. package/lib/map/handler/one_finger_touch_drag.js +0 -47
  118. package/lib/map/handler/scroll_zoom.d.ts +0 -102
  119. package/lib/map/handler/scroll_zoom.js +0 -320
  120. package/lib/map/handler/shim/dblclick_zoom.d.ts +0 -44
  121. package/lib/map/handler/shim/dblclick_zoom.js +0 -68
  122. package/lib/map/handler/shim/drag_pan.d.ts +0 -79
  123. package/lib/map/handler/shim/drag_pan.js +0 -85
  124. package/lib/map/handler/shim/drag_rotate.d.ts +0 -54
  125. package/lib/map/handler/shim/drag_rotate.js +0 -74
  126. package/lib/map/handler/shim/two_fingers_touch.d.ts +0 -74
  127. package/lib/map/handler/shim/two_fingers_touch.js +0 -114
  128. package/lib/map/handler/tap_drag_zoom.d.ts +0 -28
  129. package/lib/map/handler/tap_drag_zoom.js +0 -99
  130. package/lib/map/handler/tap_recognizer.d.ts +0 -35
  131. package/lib/map/handler/tap_recognizer.js +0 -116
  132. package/lib/map/handler/tap_zoom.d.ts +0 -28
  133. package/lib/map/handler/tap_zoom.js +0 -94
  134. package/lib/map/handler/touch_pan.d.ts +0 -40
  135. package/lib/map/handler/touch_pan.js +0 -92
  136. package/lib/map/handler/transform-provider.d.ts +0 -23
  137. package/lib/map/handler/transform-provider.js +0 -43
  138. package/lib/map/handler/two_fingers_touch.d.ts +0 -107
  139. package/lib/map/handler/two_fingers_touch.js +0 -296
  140. package/lib/map/handler_inertia.d.ts +0 -20
  141. package/lib/map/handler_inertia.js +0 -136
  142. package/lib/map/handler_manager.d.ts +0 -154
  143. package/lib/map/handler_manager.js +0 -474
  144. package/lib/map/map.d.ts +0 -637
  145. package/lib/map/map.js +0 -991
  146. package/lib/map/util/abort_error.d.ts +0 -15
  147. package/lib/map/util/abort_error.js +0 -29
  148. package/lib/map/util/browser.d.ts +0 -10
  149. package/lib/map/util/browser.js +0 -36
  150. package/lib/map/util/dom.d.ts +0 -30
  151. package/lib/map/util/dom.js +0 -113
  152. package/lib/map/util/evented.d.ts +0 -75
  153. package/lib/map/util/evented.js +0 -167
  154. package/lib/map/util/simpleMapCoord.d.ts +0 -31
  155. package/lib/map/util/simpleMapCoord.js +0 -62
  156. package/lib/map/util/task_queue.d.ts +0 -18
  157. package/lib/map/util/task_queue.js +0 -62
  158. package/lib/map/util/util.d.ts +0 -104
  159. package/lib/map/util/util.js +0 -171
@@ -1,113 +0,0 @@
1
- import type { LngLatLike } from './lng_lat';
2
- import { LngLat } from './lng_lat';
3
- interface ILngLat {
4
- lng: number;
5
- lat: number;
6
- wrap(): ILngLat;
7
- toArray(): [number, number];
8
- distanceTo(lngLat: ILngLat): number;
9
- toString(): string;
10
- }
11
- interface IMercatorCoordinate {
12
- x: number;
13
- y: number;
14
- z: number;
15
- toLngLat(): ILngLat;
16
- toAltitude(): number;
17
- meterInMercatorCoordinateUnits(): number;
18
- }
19
- export declare function mercatorXfromLng(lng: number): number;
20
- export declare function mercatorYfromLat(lat: number): number;
21
- export declare function mercatorZfromAltitude(altitude: number, lat: number): number;
22
- export declare function lngFromMercatorX(x: number): number;
23
- export declare function latFromMercatorY(y: number): number;
24
- export declare function altitudeFromMercatorZ(z: number, y: number): number;
25
- /**
26
- * Determine the Mercator scale factor for a given latitude, see
27
- * https://en.wikipedia.org/wiki/Mercator_projection#Scale_factor
28
- *
29
- * At the equator the scale factor will be 1, which increases at higher latitudes.
30
- *
31
- * @param lat - Latitude
32
- * @returns scale factor
33
- */
34
- export declare function mercatorScale(lat: number): number;
35
- /**
36
- * A `MercatorCoordinate` object represents a projected three dimensional position.
37
- *
38
- * `MercatorCoordinate` uses the web mercator projection ([EPSG:3857](https://epsg.io/3857)) with slightly different units:
39
- *
40
- * - the size of 1 unit is the width of the projected world instead of the "mercator meter"
41
- * - the origin of the coordinate space is at the north-west corner instead of the middle
42
- *
43
- * For example, `MercatorCoordinate(0, 0, 0)` is the north-west corner of the mercator world and
44
- * `MercatorCoordinate(1, 1, 0)` is the south-east corner. If you are familiar with
45
- * [vector tiles](https://github.com/mapbox/vector-tile-spec) it may be helpful to think
46
- * of the coordinate space as the `0/0/0` tile with an extent of `1`.
47
- *
48
- * The `z` dimension of `MercatorCoordinate` is conformal. A cube in the mercator coordinate space would be rendered as a cube.
49
- *
50
- * @group Geography and Geometry
51
- *
52
- * @example
53
- * ```ts
54
- * let nullIsland = new MercatorCoordinate(0.5, 0.5, 0);
55
- * ```
56
- * @see [Add a custom style layer](https://maplibre.org/maplibre-gl-js/docs/examples/custom-style-layer/)
57
- */
58
- export declare class MercatorCoordinate implements IMercatorCoordinate {
59
- x: number;
60
- y: number;
61
- z: number;
62
- /**
63
- * @param x - The x component of the position.
64
- * @param y - The y component of the position.
65
- * @param z - The z component of the position.
66
- */
67
- constructor(x: number, y: number, z?: number);
68
- /**
69
- * Project a `LngLat` to a `MercatorCoordinate`.
70
- *
71
- * @param lngLatLike - The location to project.
72
- * @param altitude - The altitude in meters of the position.
73
- * @returns The projected mercator coordinate.
74
- * @example
75
- * ```ts
76
- * let coord = MercatorCoordinate.fromLngLat({ lng: 0, lat: 0}, 0);
77
- * coord; // MercatorCoordinate(0.5, 0.5, 0)
78
- * ```
79
- */
80
- static fromLngLat(lngLatLike: LngLatLike, altitude?: number): MercatorCoordinate;
81
- /**
82
- * Returns the `LngLat` for the coordinate.
83
- *
84
- * @returns The `LngLat` object.
85
- * @example
86
- * ```ts
87
- * let coord = new MercatorCoordinate(0.5, 0.5, 0);
88
- * let lngLat = coord.toLngLat(); // LngLat(0, 0)
89
- * ```
90
- */
91
- toLngLat(): LngLat;
92
- /**
93
- * Returns the altitude in meters of the coordinate.
94
- *
95
- * @returns The altitude in meters.
96
- * @example
97
- * ```ts
98
- * let coord = new MercatorCoordinate(0, 0, 0.02);
99
- * coord.toAltitude(); // 6914.281956295339
100
- * ```
101
- */
102
- toAltitude(): number;
103
- /**
104
- * Returns the distance of 1 meter in `MercatorCoordinate` units at this latitude.
105
- *
106
- * For coordinates in real world units using meters, this naturally provides the scale
107
- * to transform into `MercatorCoordinate`s.
108
- *
109
- * @returns Distance of 1 meter in `MercatorCoordinate` units.
110
- */
111
- meterInMercatorCoordinateUnits(): number;
112
- }
113
- export {};
@@ -1,142 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
- import { LngLat, earthRadius } from "./lng_lat";
3
- /*
4
- * The average circumference of the world in meters.
5
- */
6
- const earthCircumfrence = 2 * Math.PI * earthRadius; // meters
7
-
8
- /*
9
- * The circumference at a line of latitude in meters.
10
- */
11
- function circumferenceAtLatitude(latitude) {
12
- return earthCircumfrence * Math.cos(latitude * Math.PI / 180);
13
- }
14
- export function mercatorXfromLng(lng) {
15
- return (180 + lng) / 360;
16
- }
17
- export function mercatorYfromLat(lat) {
18
- return (180 - 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + lat * Math.PI / 360))) / 360;
19
- }
20
- export function mercatorZfromAltitude(altitude, lat) {
21
- return altitude / circumferenceAtLatitude(lat);
22
- }
23
- export function lngFromMercatorX(x) {
24
- return x * 360 - 180;
25
- }
26
- export function latFromMercatorY(y) {
27
- const y2 = 180 - y * 360;
28
- return 360 / Math.PI * Math.atan(Math.exp(y2 * Math.PI / 180)) - 90;
29
- }
30
- export function altitudeFromMercatorZ(z, y) {
31
- return z * circumferenceAtLatitude(latFromMercatorY(y));
32
- }
33
-
34
- /**
35
- * Determine the Mercator scale factor for a given latitude, see
36
- * https://en.wikipedia.org/wiki/Mercator_projection#Scale_factor
37
- *
38
- * At the equator the scale factor will be 1, which increases at higher latitudes.
39
- *
40
- * @param lat - Latitude
41
- * @returns scale factor
42
- */
43
- export function mercatorScale(lat) {
44
- return 1 / Math.cos(lat * Math.PI / 180);
45
- }
46
-
47
- /**
48
- * A `MercatorCoordinate` object represents a projected three dimensional position.
49
- *
50
- * `MercatorCoordinate` uses the web mercator projection ([EPSG:3857](https://epsg.io/3857)) with slightly different units:
51
- *
52
- * - the size of 1 unit is the width of the projected world instead of the "mercator meter"
53
- * - the origin of the coordinate space is at the north-west corner instead of the middle
54
- *
55
- * For example, `MercatorCoordinate(0, 0, 0)` is the north-west corner of the mercator world and
56
- * `MercatorCoordinate(1, 1, 0)` is the south-east corner. If you are familiar with
57
- * [vector tiles](https://github.com/mapbox/vector-tile-spec) it may be helpful to think
58
- * of the coordinate space as the `0/0/0` tile with an extent of `1`.
59
- *
60
- * The `z` dimension of `MercatorCoordinate` is conformal. A cube in the mercator coordinate space would be rendered as a cube.
61
- *
62
- * @group Geography and Geometry
63
- *
64
- * @example
65
- * ```ts
66
- * let nullIsland = new MercatorCoordinate(0.5, 0.5, 0);
67
- * ```
68
- * @see [Add a custom style layer](https://maplibre.org/maplibre-gl-js/docs/examples/custom-style-layer/)
69
- */
70
- export class MercatorCoordinate {
71
- /**
72
- * @param x - The x component of the position.
73
- * @param y - The y component of the position.
74
- * @param z - The z component of the position.
75
- */
76
- constructor(x, y, z = 0) {
77
- _defineProperty(this, "x", void 0);
78
- _defineProperty(this, "y", void 0);
79
- _defineProperty(this, "z", void 0);
80
- this.x = +x;
81
- this.y = +y;
82
- this.z = +z;
83
- }
84
-
85
- /**
86
- * Project a `LngLat` to a `MercatorCoordinate`.
87
- *
88
- * @param lngLatLike - The location to project.
89
- * @param altitude - The altitude in meters of the position.
90
- * @returns The projected mercator coordinate.
91
- * @example
92
- * ```ts
93
- * let coord = MercatorCoordinate.fromLngLat({ lng: 0, lat: 0}, 0);
94
- * coord; // MercatorCoordinate(0.5, 0.5, 0)
95
- * ```
96
- */
97
- static fromLngLat(lngLatLike, altitude = 0) {
98
- const lngLat = LngLat.convert(lngLatLike);
99
- return new MercatorCoordinate(mercatorXfromLng(lngLat.lng), mercatorYfromLat(lngLat.lat), mercatorZfromAltitude(altitude, lngLat.lat));
100
- }
101
-
102
- /**
103
- * Returns the `LngLat` for the coordinate.
104
- *
105
- * @returns The `LngLat` object.
106
- * @example
107
- * ```ts
108
- * let coord = new MercatorCoordinate(0.5, 0.5, 0);
109
- * let lngLat = coord.toLngLat(); // LngLat(0, 0)
110
- * ```
111
- */
112
- toLngLat() {
113
- return new LngLat(lngFromMercatorX(this.x), latFromMercatorY(this.y));
114
- }
115
-
116
- /**
117
- * Returns the altitude in meters of the coordinate.
118
- *
119
- * @returns The altitude in meters.
120
- * @example
121
- * ```ts
122
- * let coord = new MercatorCoordinate(0, 0, 0.02);
123
- * coord.toAltitude(); // 6914.281956295339
124
- * ```
125
- */
126
- toAltitude() {
127
- return altitudeFromMercatorZ(this.z, this.y);
128
- }
129
-
130
- /**
131
- * Returns the distance of 1 meter in `MercatorCoordinate` units at this latitude.
132
- *
133
- * For coordinates in real world units using meters, this naturally provides the scale
134
- * to transform into `MercatorCoordinate`s.
135
- *
136
- * @returns Distance of 1 meter in `MercatorCoordinate` units.
137
- */
138
- meterInMercatorCoordinateUnits() {
139
- // 1 meter / circumference at equator in meters * Mercator projection scale factor at this latitude
140
- return 1 / earthCircumfrence * mercatorScale(latFromMercatorY(this.y));
141
- }
142
- }
@@ -1,262 +0,0 @@
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
- }