@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,166 +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.earthRadius = exports.LngLat = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _util = require("../util/util");
10
- /*
11
- * Approximate radius of the earth in meters.
12
- * Uses the WGS-84 approximation. The radius at the equator is ~6378137 and at the poles is ~6356752. https://en.wikipedia.org/wiki/World_Geodetic_System#WGS84
13
- * 6371008.8 is one published "average radius" see https://en.wikipedia.org/wiki/Earth_radius#Mean_radius, or ftp://athena.fsv.cvut.cz/ZFG/grs80-Moritz.pdf p.4
14
- */
15
- const earthRadius = exports.earthRadius = 6371008.8;
16
-
17
- /**
18
- * A {@link LngLat} object, an array of two numbers representing longitude and latitude,
19
- * or an object with `lng` and `lat` or `lon` and `lat` properties.
20
- *
21
- * @group Geography and Geometry
22
- *
23
- * @example
24
- * ```ts
25
- * let v1 = new LngLat(-122.420679, 37.772537);
26
- * let v2 = [-122.420679, 37.772537];
27
- * let v3 = {lon: -122.420679, lat: 37.772537};
28
- * ```
29
- */
30
-
31
- /**
32
- * A `LngLat` object represents a given longitude and latitude coordinate, measured in degrees.
33
- * These coordinates are based on the [WGS84 (EPSG:4326) standard](https://en.wikipedia.org/wiki/World_Geodetic_System#WGS84).
34
- *
35
- * MapLibre GL JS uses longitude, latitude coordinate order (as opposed to latitude, longitude) to match the
36
- * [GeoJSON specification](https://tools.ietf.org/html/rfc7946).
37
- *
38
- * Note that any MapLibre GL JS method that accepts a `LngLat` object as an argument or option
39
- * can also accept an `Array` of two numbers and will perform an implicit conversion.
40
- * This flexible type is documented as {@link LngLatLike}.
41
- *
42
- * @group Geography and Geometry
43
- *
44
- * @example
45
- * ```ts
46
- * let ll = new LngLat(-123.9749, 40.7736);
47
- * ll.lng; // = -123.9749
48
- * ```
49
- * @see [Get coordinates of the mouse pointer](https://maplibre.org/maplibre-gl-js/docs/examples/mouse-position/)
50
- * @see [Display a popup](https://maplibre.org/maplibre-gl-js/docs/examples/popup/)
51
- * @see [Create a timeline animation](https://maplibre.org/maplibre-gl-js/docs/examples/timeline-animation/)
52
- */
53
- class LngLat {
54
- /**
55
- * @param lng - Longitude, measured in degrees.
56
- * @param lat - Latitude, measured in degrees.
57
- */
58
- constructor(lng, lat) {
59
- (0, _defineProperty2.default)(this, "lng", void 0);
60
- (0, _defineProperty2.default)(this, "lat", void 0);
61
- if (isNaN(lng) || isNaN(lat)) {
62
- throw new Error(`Invalid LngLat object: (${lng}, ${lat})`);
63
- }
64
- this.lng = +lng;
65
- this.lat = +lat;
66
- if (this.lat > 90 || this.lat < -90) {
67
- throw new Error('Invalid LngLat latitude value: must be between -90 and 90');
68
- }
69
- }
70
-
71
- /**
72
- * Returns a new `LngLat` object whose longitude is wrapped to the range (-180, 180).
73
- *
74
- * @returns The wrapped `LngLat` object.
75
- * @example
76
- * ```ts
77
- * let ll = new LngLat(286.0251, 40.7736);
78
- * let wrapped = ll.wrap();
79
- * wrapped.lng; // = -73.9749
80
- * ```
81
- */
82
- wrap() {
83
- return new LngLat((0, _util.wrap)(this.lng, -180, 180), this.lat);
84
- }
85
-
86
- /**
87
- * Returns the coordinates represented as an array of two numbers.
88
- *
89
- * @returns The coordinates represented as an array of longitude and latitude.
90
- * @example
91
- * ```ts
92
- * let ll = new LngLat(-73.9749, 40.7736);
93
- * ll.toArray(); // = [-73.9749, 40.7736]
94
- * ```
95
- */
96
- toArray() {
97
- return [this.lng, this.lat];
98
- }
99
-
100
- /**
101
- * Returns the coordinates represent as a string.
102
- *
103
- * @returns The coordinates represented as a string of the format `'LngLat(lng, lat)'`.
104
- * @example
105
- * ```ts
106
- * let ll = new LngLat(-73.9749, 40.7736);
107
- * ll.toString(); // = "LngLat(-73.9749, 40.7736)"
108
- * ```
109
- */
110
- toString() {
111
- return `LngLat(${this.lng}, ${this.lat})`;
112
- }
113
-
114
- /**
115
- * Returns the approximate distance between a pair of coordinates in meters
116
- * Uses the Haversine Formula (from R.W. Sinnott, "Virtues of the Haversine", Sky and Telescope, vol. 68, no. 2, 1984, p. 159)
117
- *
118
- * @param lngLat - coordinates to compute the distance to
119
- * @returns Distance in meters between the two coordinates.
120
- * @example
121
- * ```ts
122
- * let new_york = new LngLat(-74.0060, 40.7128);
123
- * let los_angeles = new LngLat(-118.2437, 34.0522);
124
- * new_york.distanceTo(los_angeles); // = 3935751.690893987, "true distance" using a non-spherical approximation is ~3966km
125
- * ```
126
- */
127
- distanceTo(lngLat) {
128
- const rad = Math.PI / 180;
129
- const lat1 = this.lat * rad;
130
- const lat2 = lngLat.lat * rad;
131
- const a = Math.sin(lat1) * Math.sin(lat2) + Math.cos(lat1) * Math.cos(lat2) * Math.cos((lngLat.lng - this.lng) * rad);
132
- const maxMeters = earthRadius * Math.acos(Math.min(a, 1));
133
- return maxMeters;
134
- }
135
-
136
- /**
137
- * Converts an array of two numbers or an object with `lng` and `lat` or `lon` and `lat` properties
138
- * to a `LngLat` object.
139
- *
140
- * If a `LngLat` object is passed in, the function returns it unchanged.
141
- *
142
- * @param input - An array of two numbers or object to convert, or a `LngLat` object to return.
143
- * @returns A new `LngLat` object, if a conversion occurred, or the original `LngLat` object.
144
- * @example
145
- * ```ts
146
- * let arr = [-73.9749, 40.7736];
147
- * let ll = LngLat.convert(arr);
148
- * ll; // = LngLat {lng: -73.9749, lat: 40.7736}
149
- * ```
150
- */
151
- static convert(input) {
152
- if (input instanceof LngLat) {
153
- return input;
154
- }
155
- if (Array.isArray(input) && (input.length === 2 || input.length === 3)) {
156
- return new LngLat(Number(input[0]), Number(input[1]));
157
- }
158
- if (!Array.isArray(input) && typeof input === 'object' && input !== null) {
159
- return new LngLat(
160
- // flow can't refine this to have one of lng or lat, so we have to cast to any
161
- Number('lng' in input ? input.lng : input.lon), Number(input.lat));
162
- }
163
- throw new Error('`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]');
164
- }
165
- }
166
- exports.LngLat = LngLat;
@@ -1,217 +0,0 @@
1
- import type { LngLatLike } from './lng_lat';
2
- import { LngLat } from './lng_lat';
3
- /**
4
- * A {@link LngLatBounds} object, an array of {@link LngLatLike} objects in [sw, ne] order,
5
- * or an array of numbers in [west, south, east, north] order.
6
- *
7
- * @group Geography and Geometry
8
- *
9
- * @example
10
- * ```ts
11
- * let v1 = new LngLatBounds(
12
- * new LngLat(-73.9876, 40.7661),
13
- * new LngLat(-73.9397, 40.8002)
14
- * );
15
- * let v2 = new LngLatBounds([-73.9876, 40.7661], [-73.9397, 40.8002])
16
- * let v3 = [[-73.9876, 40.7661], [-73.9397, 40.8002]];
17
- * ```
18
- */
19
- export type LngLatBoundsLike = LngLatBounds | [LngLatLike, LngLatLike] | [number, number, number, number];
20
- /**
21
- * A `LngLatBounds` object represents a geographical bounding box,
22
- * defined by its southwest and northeast points in longitude and latitude.
23
- *
24
- * If no arguments are provided to the constructor, a `null` bounding box is created.
25
- *
26
- * Note that any Mapbox GL method that accepts a `LngLatBounds` object as an argument or option
27
- * can also accept an `Array` of two {@link LngLatLike} constructs and will perform an implicit conversion.
28
- * This flexible type is documented as {@link LngLatBoundsLike}.
29
- *
30
- * @group Geography and Geometry
31
- *
32
- * @example
33
- * ```ts
34
- * let sw = new LngLat(-73.9876, 40.7661);
35
- * let ne = new LngLat(-73.9397, 40.8002);
36
- * let llb = new LngLatBounds(sw, ne);
37
- * ```
38
- */
39
- export declare class LngLatBounds {
40
- _ne: LngLat;
41
- _sw: LngLat;
42
- /**
43
- * @param sw - The southwest corner of the bounding box.
44
- * OR array of 4 numbers in the order of west, south, east, north
45
- * OR array of 2 LngLatLike: [sw,ne]
46
- * @param ne - The northeast corner of the bounding box.
47
- * @example
48
- * ```ts
49
- * let sw = new LngLat(-73.9876, 40.7661);
50
- * let ne = new LngLat(-73.9397, 40.8002);
51
- * let llb = new LngLatBounds(sw, ne);
52
- * ```
53
- * OR
54
- * ```ts
55
- * let llb = new LngLatBounds([-73.9876, 40.7661, -73.9397, 40.8002]);
56
- * ```
57
- * OR
58
- * ```ts
59
- * let llb = new LngLatBounds([sw, ne]);
60
- * ```
61
- */
62
- constructor(sw?: LngLatLike | [number, number, number, number] | [LngLatLike, LngLatLike], ne?: LngLatLike);
63
- /**
64
- * Set the northeast corner of the bounding box
65
- *
66
- * @param ne - a {@link LngLatLike} object describing the northeast corner of the bounding box.
67
- */
68
- setNorthEast(ne: LngLatLike): this;
69
- /**
70
- * Set the southwest corner of the bounding box
71
- *
72
- * @param sw - a {@link LngLatLike} object describing the southwest corner of the bounding box.
73
- */
74
- setSouthWest(sw: LngLatLike): this;
75
- /**
76
- * Extend the bounds to include a given LngLatLike or LngLatBoundsLike.
77
- *
78
- * @param obj - object to extend to
79
- */
80
- extend(obj: LngLatLike | LngLatBoundsLike): this;
81
- /**
82
- * Returns the geographical coordinate equidistant from the bounding box's corners.
83
- *
84
- * @returns The bounding box's center.
85
- * @example
86
- * ```ts
87
- * let llb = new LngLatBounds([-73.9876, 40.7661], [-73.9397, 40.8002]);
88
- * llb.getCenter(); // = LngLat {lng: -73.96365, lat: 40.78315}
89
- * ```
90
- */
91
- getCenter(): LngLat;
92
- /**
93
- * Returns the southwest corner of the bounding box.
94
- *
95
- * @returns The southwest corner of the bounding box.
96
- */
97
- getSouthWest(): LngLat;
98
- /**
99
- * Returns the northeast corner of the bounding box.
100
- *
101
- * @returns The northeast corner of the bounding box.
102
- */
103
- getNorthEast(): LngLat;
104
- /**
105
- * Returns the northwest corner of the bounding box.
106
- *
107
- * @returns The northwest corner of the bounding box.
108
- */
109
- getNorthWest(): LngLat;
110
- /**
111
- * Returns the southeast corner of the bounding box.
112
- *
113
- * @returns The southeast corner of the bounding box.
114
- */
115
- getSouthEast(): LngLat;
116
- /**
117
- * Returns the west edge of the bounding box.
118
- *
119
- * @returns The west edge of the bounding box.
120
- */
121
- getWest(): number;
122
- /**
123
- * Returns the south edge of the bounding box.
124
- *
125
- * @returns The south edge of the bounding box.
126
- */
127
- getSouth(): number;
128
- /**
129
- * Returns the east edge of the bounding box.
130
- *
131
- * @returns The east edge of the bounding box.
132
- */
133
- getEast(): number;
134
- /**
135
- * Returns the north edge of the bounding box.
136
- *
137
- * @returns The north edge of the bounding box.
138
- */
139
- getNorth(): number;
140
- /**
141
- * Returns the bounding box represented as an array.
142
- *
143
- * @returns The bounding box represented as an array, consisting of the
144
- * southwest and northeast coordinates of the bounding represented as arrays of numbers.
145
- * @example
146
- * ```ts
147
- * let llb = new LngLatBounds([-73.9876, 40.7661], [-73.9397, 40.8002]);
148
- * llb.toArray(); // = [[-73.9876, 40.7661], [-73.9397, 40.8002]]
149
- * ```
150
- */
151
- toArray(): [number, number][];
152
- /**
153
- * Return the bounding box represented as a string.
154
- *
155
- * @returns The bounding box represents as a string of the format
156
- * `'LngLatBounds(LngLat(lng, lat), LngLat(lng, lat))'`.
157
- * @example
158
- * ```ts
159
- * let llb = new LngLatBounds([-73.9876, 40.7661], [-73.9397, 40.8002]);
160
- * llb.toString(); // = "LngLatBounds(LngLat(-73.9876, 40.7661), LngLat(-73.9397, 40.8002))"
161
- * ```
162
- */
163
- toString(): string;
164
- /**
165
- * Check if the bounding box is an empty/`null`-type box.
166
- *
167
- * @returns True if bounds have been defined, otherwise false.
168
- */
169
- isEmpty(): boolean;
170
- /**
171
- * Check if the point is within the bounding box.
172
- *
173
- * @param lnglat - geographic point to check against.
174
- * @returns `true` if the point is within the bounding box.
175
- * @example
176
- * ```ts
177
- * let llb = new LngLatBounds(
178
- * new LngLat(-73.9876, 40.7661),
179
- * new LngLat(-73.9397, 40.8002)
180
- * );
181
- *
182
- * let ll = new LngLat(-73.9567, 40.7789);
183
- *
184
- * console.log(llb.contains(ll)); // = true
185
- * ```
186
- */
187
- contains(lnglat: LngLatLike): boolean;
188
- /**
189
- * Converts an array to a `LngLatBounds` object.
190
- *
191
- * If a `LngLatBounds` object is passed in, the function returns it unchanged.
192
- *
193
- * Internally, the function calls `LngLat#convert` to convert arrays to `LngLat` values.
194
- *
195
- * @param input - An array of two coordinates to convert, or a `LngLatBounds` object to return.
196
- * @returns A new `LngLatBounds` object, if a conversion occurred, or the original `LngLatBounds` object.
197
- * @example
198
- * ```ts
199
- * let arr = [[-73.9876, 40.7661], [-73.9397, 40.8002]];
200
- * let llb = LngLatBounds.convert(arr); // = LngLatBounds {_sw: LngLat {lng: -73.9876, lat: 40.7661}, _ne: LngLat {lng: -73.9397, lat: 40.8002}}
201
- * ```
202
- */
203
- static convert(input: LngLatBoundsLike): LngLatBounds;
204
- /**
205
- * Returns a `LngLatBounds` from the coordinates extended by a given `radius`. The returned `LngLatBounds` completely contains the `radius`.
206
- *
207
- * @param center - center coordinates of the new bounds.
208
- * @param radius - Distance in meters from the coordinates to extend the bounds.
209
- * @returns A new `LngLatBounds` object representing the coordinates extended by the `radius`.
210
- * @example
211
- * ```ts
212
- * let center = new LngLat(-73.9749, 40.7736);
213
- * LngLatBounds.fromLngLat(100).toArray(); // = [[-73.97501862141328, 40.77351016847229], [-73.97478137858673, 40.77368983152771]]
214
- * ```
215
- */
216
- static fromLngLat(center: LngLat, radius?: number): LngLatBounds;
217
- }