@antv/l7-map 2.17.12 → 2.18.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.
- package/package.json +4 -4
- package/es/camera.d.ts +0 -85
- package/es/camera.js +0 -775
- package/es/css/l7.css +0 -98
- package/es/earthmap.d.ts +0 -66
- package/es/earthmap.js +0 -422
- package/es/geo/edge_insets.d.ts +0 -54
- package/es/geo/edge_insets.js +0 -118
- package/es/geo/lng_lat.d.ts +0 -18
- package/es/geo/lng_lat.js +0 -81
- package/es/geo/lng_lat_bounds.d.ts +0 -24
- package/es/geo/lng_lat_bounds.js +0 -167
- package/es/geo/mercator.d.ts +0 -29
- package/es/geo/mercator.js +0 -92
- package/es/geo/point.d.ts +0 -40
- package/es/geo/point.js +0 -231
- package/es/geo/simple.d.ts +0 -29
- package/es/geo/simple.js +0 -92
- package/es/geo/transform.d.ts +0 -198
- package/es/geo/transform.js +0 -971
- package/es/handler/IHandler.d.ts +0 -34
- package/es/handler/IHandler.js +0 -1
- package/es/handler/blockable_map_event.d.ts +0 -17
- package/es/handler/blockable_map_event.js +0 -83
- package/es/handler/box_zoom.d.ts +0 -59
- package/es/handler/box_zoom.js +0 -200
- package/es/handler/click_zoom.d.ts +0 -16
- package/es/handler/click_zoom.js +0 -59
- package/es/handler/events/event.d.ts +0 -4
- package/es/handler/events/event.js +0 -12
- package/es/handler/events/index.d.ts +0 -4
- package/es/handler/events/index.js +0 -4
- package/es/handler/events/map_mouse_event.d.ts +0 -34
- package/es/handler/events/map_mouse_event.js +0 -75
- package/es/handler/events/map_touch_event.d.ts +0 -57
- package/es/handler/events/map_touch_event.js +0 -105
- package/es/handler/events/map_wheel_event.d.ts +0 -33
- package/es/handler/events/map_wheel_event.js +0 -61
- package/es/handler/events/render_event.d.ts +0 -5
- package/es/handler/events/render_event.js +0 -39
- package/es/handler/handler_inertia.d.ts +0 -23
- package/es/handler/handler_inertia.js +0 -184
- package/es/handler/handler_manager.d.ts +0 -61
- package/es/handler/handler_manager.js +0 -684
- package/es/handler/handler_util.d.ts +0 -4
- package/es/handler/handler_util.js +0 -10
- package/es/handler/keyboard.d.ts +0 -36
- package/es/handler/keyboard.js +0 -162
- package/es/handler/map_event.d.ts +0 -29
- package/es/handler/map_event.js +0 -131
- package/es/handler/mouse/index.d.ts +0 -4
- package/es/handler/mouse/index.js +0 -4
- package/es/handler/mouse/mouse_handler.d.ts +0 -22
- package/es/handler/mouse/mouse_handler.js +0 -131
- package/es/handler/mouse/mousepan_handler.d.ts +0 -10
- package/es/handler/mouse/mousepan_handler.js +0 -54
- package/es/handler/mouse/mousepitch_hander.d.ts +0 -9
- package/es/handler/mouse/mousepitch_hander.js +0 -56
- package/es/handler/mouse/mouserotate_hander.d.ts +0 -9
- package/es/handler/mouse/mouserotate_hander.js +0 -56
- package/es/handler/mouse/util.d.ts +0 -6
- package/es/handler/mouse/util.js +0 -12
- package/es/handler/scroll_zoom.d.ts +0 -93
- package/es/handler/scroll_zoom.js +0 -353
- package/es/handler/shim/dblclick_zoom.d.ts +0 -40
- package/es/handler/shim/dblclick_zoom.js +0 -72
- package/es/handler/shim/drag_pan.d.ts +0 -61
- package/es/handler/shim/drag_pan.js +0 -96
- package/es/handler/shim/drag_rotate.d.ts +0 -46
- package/es/handler/shim/drag_rotate.js +0 -80
- package/es/handler/shim/touch_zoom_rotate.d.ts +0 -70
- package/es/handler/shim/touch_zoom_rotate.js +0 -130
- package/es/handler/tap/single_tap_recognizer.d.ts +0 -20
- package/es/handler/tap/single_tap_recognizer.js +0 -120
- package/es/handler/tap/tap_drag_zoom.d.ts +0 -22
- package/es/handler/tap/tap_drag_zoom.js +0 -114
- package/es/handler/tap/tap_recognizer.d.ts +0 -17
- package/es/handler/tap/tap_recognizer.js +0 -62
- package/es/handler/tap/tap_zoom.d.ts +0 -22
- package/es/handler/tap/tap_zoom.js +0 -115
- package/es/handler/touch/index.d.ts +0 -5
- package/es/handler/touch/index.js +0 -5
- package/es/handler/touch/touch_pan.d.ts +0 -30
- package/es/handler/touch/touch_pan.js +0 -128
- package/es/handler/touch/touch_pitch.d.ts +0 -13
- package/es/handler/touch/touch_pitch.js +0 -110
- package/es/handler/touch/touch_rotate.d.ts +0 -12
- package/es/handler/touch/touch_rotate.js +0 -88
- package/es/handler/touch/touch_zoom.d.ts +0 -12
- package/es/handler/touch/touch_zoom.js +0 -67
- package/es/handler/touch/two_touch.d.ts +0 -23
- package/es/handler/touch/two_touch.js +0 -138
- package/es/hash.d.ts +0 -14
- package/es/hash.js +0 -156
- package/es/index.d.ts +0 -4
- package/es/index.js +0 -4
- package/es/interface.d.ts +0 -34
- package/es/interface.js +0 -1
- package/es/map.d.ts +0 -70
- package/es/map.js +0 -464
- package/es/util.d.ts +0 -25
- package/es/util.js +0 -101
- package/es/utils/Aabb.d.ts +0 -12
- package/es/utils/Aabb.js +0 -133
- package/es/utils/dom.d.ts +0 -4
- package/es/utils/dom.js +0 -218
- package/es/utils/performance.d.ts +0 -17
- package/es/utils/performance.js +0 -62
- package/es/utils/primitives.d.ts +0 -6
- package/es/utils/primitives.js +0 -45
- package/es/utils/task_queue.d.ts +0 -13
- package/es/utils/task_queue.js +0 -106
- package/lib/camera.js +0 -801
- package/lib/css/l7.css +0 -98
- package/lib/earthmap.js +0 -445
- package/lib/geo/edge_insets.js +0 -129
- package/lib/geo/lng_lat.js +0 -94
- package/lib/geo/lng_lat_bounds.js +0 -177
- package/lib/geo/mercator.js +0 -121
- package/lib/geo/point.js +0 -239
- package/lib/geo/simple.js +0 -123
- package/lib/geo/transform.js +0 -1013
- package/lib/handler/IHandler.js +0 -5
- package/lib/handler/blockable_map_event.js +0 -92
- package/lib/handler/box_zoom.js +0 -217
- package/lib/handler/click_zoom.js +0 -67
- package/lib/handler/events/event.js +0 -23
- package/lib/handler/events/index.js +0 -31
- package/lib/handler/events/map_mouse_event.js +0 -87
- package/lib/handler/events/map_touch_event.js +0 -119
- package/lib/handler/events/map_wheel_event.js +0 -72
- package/lib/handler/events/render_event.js +0 -52
- package/lib/handler/handler_inertia.js +0 -193
- package/lib/handler/handler_manager.js +0 -714
- package/lib/handler/handler_util.js +0 -17
- package/lib/handler/keyboard.js +0 -172
- package/lib/handler/map_event.js +0 -140
- package/lib/handler/mouse/index.js +0 -31
- package/lib/handler/mouse/mouse_handler.js +0 -141
- package/lib/handler/mouse/mousepan_handler.js +0 -66
- package/lib/handler/mouse/mousepitch_hander.js +0 -67
- package/lib/handler/mouse/mouserotate_hander.js +0 -67
- package/lib/handler/mouse/util.js +0 -26
- package/lib/handler/scroll_zoom.js +0 -367
- package/lib/handler/shim/dblclick_zoom.js +0 -80
- package/lib/handler/shim/drag_pan.js +0 -105
- package/lib/handler/shim/drag_rotate.js +0 -88
- package/lib/handler/shim/touch_zoom_rotate.js +0 -139
- package/lib/handler/tap/single_tap_recognizer.js +0 -131
- package/lib/handler/tap/tap_drag_zoom.js +0 -124
- package/lib/handler/tap/tap_recognizer.js +0 -78
- package/lib/handler/tap/tap_zoom.js +0 -124
- package/lib/handler/touch/index.js +0 -39
- package/lib/handler/touch/touch_pan.js +0 -138
- package/lib/handler/touch/touch_pitch.js +0 -120
- package/lib/handler/touch/touch_rotate.js +0 -99
- package/lib/handler/touch/touch_zoom.js +0 -78
- package/lib/handler/touch/two_touch.js +0 -148
- package/lib/hash.js +0 -169
- package/lib/index.js +0 -57
- package/lib/interface.js +0 -5
- package/lib/map.js +0 -489
- package/lib/util.js +0 -135
- package/lib/utils/Aabb.js +0 -143
- package/lib/utils/dom.js +0 -233
- package/lib/utils/performance.js +0 -72
- package/lib/utils/primitives.js +0 -57
- package/lib/utils/task_queue.js +0 -115
package/es/geo/point.js
DELETED
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
|
|
4
|
-
var Point = /*#__PURE__*/function () {
|
|
5
|
-
function Point(x, y) {
|
|
6
|
-
_classCallCheck(this, Point);
|
|
7
|
-
|
|
8
|
-
this.x = x;
|
|
9
|
-
this.y = y;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
_createClass(Point, [{
|
|
13
|
-
key: "clone",
|
|
14
|
-
value: function clone() {
|
|
15
|
-
return new Point(this.x, this.y);
|
|
16
|
-
}
|
|
17
|
-
}, {
|
|
18
|
-
key: "_add",
|
|
19
|
-
value: function _add(p) {
|
|
20
|
-
this.x += p.x;
|
|
21
|
-
this.y += p.y;
|
|
22
|
-
return this;
|
|
23
|
-
}
|
|
24
|
-
}, {
|
|
25
|
-
key: "add",
|
|
26
|
-
value: function add(p) {
|
|
27
|
-
return this.clone()._add(p);
|
|
28
|
-
}
|
|
29
|
-
}, {
|
|
30
|
-
key: "_sub",
|
|
31
|
-
value: function _sub(p) {
|
|
32
|
-
this.x -= p.x;
|
|
33
|
-
this.y -= p.y;
|
|
34
|
-
return this;
|
|
35
|
-
}
|
|
36
|
-
}, {
|
|
37
|
-
key: "sub",
|
|
38
|
-
value: function sub(p) {
|
|
39
|
-
return this.clone()._sub(p);
|
|
40
|
-
}
|
|
41
|
-
}, {
|
|
42
|
-
key: "_multByPoint",
|
|
43
|
-
value: function _multByPoint(p) {
|
|
44
|
-
this.x *= p.x;
|
|
45
|
-
this.y *= p.y;
|
|
46
|
-
return this;
|
|
47
|
-
}
|
|
48
|
-
}, {
|
|
49
|
-
key: "multByPoint",
|
|
50
|
-
value: function multByPoint(p) {
|
|
51
|
-
return this.clone()._multByPoint(p);
|
|
52
|
-
}
|
|
53
|
-
}, {
|
|
54
|
-
key: "_divByPoint",
|
|
55
|
-
value: function _divByPoint(p) {
|
|
56
|
-
this.x /= p.x;
|
|
57
|
-
this.y /= p.y;
|
|
58
|
-
return this;
|
|
59
|
-
}
|
|
60
|
-
}, {
|
|
61
|
-
key: "divByPoint",
|
|
62
|
-
value: function divByPoint(p) {
|
|
63
|
-
return this.clone()._divByPoint(p);
|
|
64
|
-
}
|
|
65
|
-
}, {
|
|
66
|
-
key: "_mult",
|
|
67
|
-
value: function _mult(k) {
|
|
68
|
-
this.x *= k;
|
|
69
|
-
this.y *= k;
|
|
70
|
-
return this;
|
|
71
|
-
}
|
|
72
|
-
}, {
|
|
73
|
-
key: "mult",
|
|
74
|
-
value: function mult(k) {
|
|
75
|
-
return this.clone()._mult(k);
|
|
76
|
-
}
|
|
77
|
-
}, {
|
|
78
|
-
key: "_div",
|
|
79
|
-
value: function _div(k) {
|
|
80
|
-
this.x /= k;
|
|
81
|
-
this.y /= k;
|
|
82
|
-
return this;
|
|
83
|
-
}
|
|
84
|
-
}, {
|
|
85
|
-
key: "div",
|
|
86
|
-
value: function div(k) {
|
|
87
|
-
return this.clone()._div(k);
|
|
88
|
-
}
|
|
89
|
-
}, {
|
|
90
|
-
key: "_rotate",
|
|
91
|
-
value: function _rotate(angle) {
|
|
92
|
-
var cos = Math.cos(angle);
|
|
93
|
-
var sin = Math.sin(angle);
|
|
94
|
-
var x = cos * this.x - sin * this.y;
|
|
95
|
-
var y = sin * this.x + cos * this.y;
|
|
96
|
-
this.x = x;
|
|
97
|
-
this.y = y;
|
|
98
|
-
return this;
|
|
99
|
-
}
|
|
100
|
-
}, {
|
|
101
|
-
key: "rotate",
|
|
102
|
-
value: function rotate(angle) {
|
|
103
|
-
return this.clone()._rotate(angle);
|
|
104
|
-
}
|
|
105
|
-
}, {
|
|
106
|
-
key: "_rotateAround",
|
|
107
|
-
value: function _rotateAround(angle, p) {
|
|
108
|
-
var cos = Math.cos(angle);
|
|
109
|
-
var sin = Math.sin(angle);
|
|
110
|
-
var x = p.x + cos * (this.x - p.x) - sin * (this.y - p.y);
|
|
111
|
-
var y = p.y + sin * (this.x - p.x) + cos * (this.y - p.y);
|
|
112
|
-
this.x = x;
|
|
113
|
-
this.y = y;
|
|
114
|
-
return this;
|
|
115
|
-
}
|
|
116
|
-
}, {
|
|
117
|
-
key: "roateAround",
|
|
118
|
-
value: function roateAround(angle, p) {
|
|
119
|
-
return this.clone()._rotateAround(angle, p);
|
|
120
|
-
}
|
|
121
|
-
}, {
|
|
122
|
-
key: "_matMult",
|
|
123
|
-
value: function _matMult(m) {
|
|
124
|
-
var x = m[0] * this.x + m[1] * this.y;
|
|
125
|
-
var y = m[2] * this.x + m[3] * this.y;
|
|
126
|
-
this.x = x;
|
|
127
|
-
this.y = y;
|
|
128
|
-
return this;
|
|
129
|
-
}
|
|
130
|
-
}, {
|
|
131
|
-
key: "matMult",
|
|
132
|
-
value: function matMult(m) {
|
|
133
|
-
return this.clone()._matMult(m);
|
|
134
|
-
}
|
|
135
|
-
}, {
|
|
136
|
-
key: "_unit",
|
|
137
|
-
value: function _unit() {
|
|
138
|
-
this.div(this.mag());
|
|
139
|
-
return this;
|
|
140
|
-
}
|
|
141
|
-
}, {
|
|
142
|
-
key: "unit",
|
|
143
|
-
value: function unit() {
|
|
144
|
-
return this.clone()._unit();
|
|
145
|
-
}
|
|
146
|
-
}, {
|
|
147
|
-
key: "_perp",
|
|
148
|
-
value: function _perp() {
|
|
149
|
-
var y = this.y;
|
|
150
|
-
this.y = this.x;
|
|
151
|
-
this.x = -y;
|
|
152
|
-
return this;
|
|
153
|
-
}
|
|
154
|
-
}, {
|
|
155
|
-
key: "perp",
|
|
156
|
-
value: function perp() {
|
|
157
|
-
return this.clone()._perp();
|
|
158
|
-
}
|
|
159
|
-
}, {
|
|
160
|
-
key: "_round",
|
|
161
|
-
value: function _round() {
|
|
162
|
-
this.x = Math.round(this.x);
|
|
163
|
-
this.y = Math.round(this.y);
|
|
164
|
-
return this;
|
|
165
|
-
}
|
|
166
|
-
}, {
|
|
167
|
-
key: "round",
|
|
168
|
-
value: function round() {
|
|
169
|
-
return this.clone()._round();
|
|
170
|
-
}
|
|
171
|
-
}, {
|
|
172
|
-
key: "mag",
|
|
173
|
-
value: function mag() {
|
|
174
|
-
return Math.sqrt(this.x * this.x + this.y * this.y);
|
|
175
|
-
}
|
|
176
|
-
}, {
|
|
177
|
-
key: "equals",
|
|
178
|
-
value: function equals(other) {
|
|
179
|
-
return this.x === other.x && this.y === other.y;
|
|
180
|
-
}
|
|
181
|
-
}, {
|
|
182
|
-
key: "dist",
|
|
183
|
-
value: function dist(p) {
|
|
184
|
-
return Math.sqrt(this.distSqr(p));
|
|
185
|
-
}
|
|
186
|
-
}, {
|
|
187
|
-
key: "distSqr",
|
|
188
|
-
value: function distSqr(p) {
|
|
189
|
-
var dx = p.x - this.x;
|
|
190
|
-
var dy = p.y - this.y;
|
|
191
|
-
return dx * dx + dy * dy;
|
|
192
|
-
}
|
|
193
|
-
}, {
|
|
194
|
-
key: "angle",
|
|
195
|
-
value: function angle() {
|
|
196
|
-
return Math.atan2(this.y, this.x);
|
|
197
|
-
}
|
|
198
|
-
}, {
|
|
199
|
-
key: "angleTo",
|
|
200
|
-
value: function angleTo(b) {
|
|
201
|
-
return Math.atan2(this.y - b.y, this.x - b.x);
|
|
202
|
-
}
|
|
203
|
-
}, {
|
|
204
|
-
key: "angleWith",
|
|
205
|
-
value: function angleWith(b) {
|
|
206
|
-
return this.angleWithSep(b.x, b.y);
|
|
207
|
-
}
|
|
208
|
-
}, {
|
|
209
|
-
key: "angleWithSep",
|
|
210
|
-
value: function angleWithSep(x, y) {
|
|
211
|
-
return Math.atan2(this.x * y - this.y * x, this.x * x + this.y * y);
|
|
212
|
-
}
|
|
213
|
-
}], [{
|
|
214
|
-
key: "convert",
|
|
215
|
-
value: function convert(a) {
|
|
216
|
-
if (a instanceof Point) {
|
|
217
|
-
return a;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
if (Array.isArray(a)) {
|
|
221
|
-
return new Point(a[0], a[1]);
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
return a;
|
|
225
|
-
}
|
|
226
|
-
}]);
|
|
227
|
-
|
|
228
|
-
return Point;
|
|
229
|
-
}();
|
|
230
|
-
|
|
231
|
-
export { Point as default };
|
package/es/geo/simple.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import LngLat, { LngLatLike } from '../geo/lng_lat';
|
|
2
|
-
export declare function circumferenceAtLatitude(latitude: number): number;
|
|
3
|
-
export declare function mercatorXfromLng(lng: number): number;
|
|
4
|
-
export declare function mercatorYfromLat(lat: number): number;
|
|
5
|
-
export declare function mercatorZfromAltitude(altitude: number, lat: number): number;
|
|
6
|
-
export declare function lngFromMercatorX(x: number): number;
|
|
7
|
-
export declare function latFromMercatorY(y: number): number;
|
|
8
|
-
export declare function altitudeFromMercatorZ(z: number, y: number): number;
|
|
9
|
-
/**
|
|
10
|
-
* Determine the Mercator scale factor for a given latitude, see
|
|
11
|
-
* https://en.wikipedia.org/wiki/Mercator_projection#Scale_factor
|
|
12
|
-
*
|
|
13
|
-
* At the equator the scale factor will be 1, which increases at higher latitudes.
|
|
14
|
-
*
|
|
15
|
-
* @param {number} lat Latitude
|
|
16
|
-
* @returns {number} scale factor
|
|
17
|
-
* @private
|
|
18
|
-
*/
|
|
19
|
-
export declare function mercatorScale(lat: number): number;
|
|
20
|
-
export default class SimpleCoordinate {
|
|
21
|
-
static fromLngLat(lngLatLike: LngLatLike, altitude?: number): SimpleCoordinate;
|
|
22
|
-
x: number;
|
|
23
|
-
y: number;
|
|
24
|
-
z: number;
|
|
25
|
-
constructor(x: number, y: number, z?: number);
|
|
26
|
-
toLngLat(): LngLat;
|
|
27
|
-
toAltitude(): number;
|
|
28
|
-
meterInMercatorCoordinateUnits(): number;
|
|
29
|
-
}
|
package/es/geo/simple.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import LngLat, { earthRadius } from "../geo/lng_lat";
|
|
4
|
-
/*
|
|
5
|
-
* The average circumference of the world in meters.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
var earthCircumfrence = 2 * Math.PI * earthRadius; // meters
|
|
9
|
-
|
|
10
|
-
/*
|
|
11
|
-
* The circumference at a line of latitude in meters.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
export function circumferenceAtLatitude(latitude) {
|
|
15
|
-
return earthCircumfrence * Math.cos(latitude * Math.PI / 180);
|
|
16
|
-
}
|
|
17
|
-
export function mercatorXfromLng(lng) {
|
|
18
|
-
return lng;
|
|
19
|
-
}
|
|
20
|
-
export function mercatorYfromLat(lat) {
|
|
21
|
-
return lat;
|
|
22
|
-
} // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
23
|
-
|
|
24
|
-
export function mercatorZfromAltitude(altitude, lat) {
|
|
25
|
-
return altitude;
|
|
26
|
-
}
|
|
27
|
-
export function lngFromMercatorX(x) {
|
|
28
|
-
return x;
|
|
29
|
-
}
|
|
30
|
-
export function latFromMercatorY(y) {
|
|
31
|
-
return y;
|
|
32
|
-
} // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
33
|
-
|
|
34
|
-
export function altitudeFromMercatorZ(z, y) {
|
|
35
|
-
return z;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Determine the Mercator scale factor for a given latitude, see
|
|
39
|
-
* https://en.wikipedia.org/wiki/Mercator_projection#Scale_factor
|
|
40
|
-
*
|
|
41
|
-
* At the equator the scale factor will be 1, which increases at higher latitudes.
|
|
42
|
-
*
|
|
43
|
-
* @param {number} lat Latitude
|
|
44
|
-
* @returns {number} scale factor
|
|
45
|
-
* @private
|
|
46
|
-
*/
|
|
47
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
48
|
-
|
|
49
|
-
export function mercatorScale(lat) {
|
|
50
|
-
return 1;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
var SimpleCoordinate = /*#__PURE__*/function () {
|
|
54
|
-
function SimpleCoordinate(x, y) {
|
|
55
|
-
var z = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
56
|
-
|
|
57
|
-
_classCallCheck(this, SimpleCoordinate);
|
|
58
|
-
|
|
59
|
-
this.x = +x;
|
|
60
|
-
this.y = +y;
|
|
61
|
-
this.z = +z;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
_createClass(SimpleCoordinate, [{
|
|
65
|
-
key: "toLngLat",
|
|
66
|
-
value: function toLngLat() {
|
|
67
|
-
return new LngLat(this.x, this.y);
|
|
68
|
-
}
|
|
69
|
-
}, {
|
|
70
|
-
key: "toAltitude",
|
|
71
|
-
value: function toAltitude() {
|
|
72
|
-
return this.z;
|
|
73
|
-
}
|
|
74
|
-
}, {
|
|
75
|
-
key: "meterInMercatorCoordinateUnits",
|
|
76
|
-
value: function meterInMercatorCoordinateUnits() {
|
|
77
|
-
// 1 meter / circumference at equator in meters * Mercator projection scale factor at this latitude
|
|
78
|
-
return 1;
|
|
79
|
-
}
|
|
80
|
-
}], [{
|
|
81
|
-
key: "fromLngLat",
|
|
82
|
-
value: function fromLngLat(lngLatLike) {
|
|
83
|
-
var altitude = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
84
|
-
var lngLat = LngLat.convert(lngLatLike);
|
|
85
|
-
return new SimpleCoordinate(mercatorXfromLng(lngLat.lng), mercatorYfromLat(lngLat.lat), mercatorZfromAltitude(altitude, lngLat.lat));
|
|
86
|
-
}
|
|
87
|
-
}]);
|
|
88
|
-
|
|
89
|
-
return SimpleCoordinate;
|
|
90
|
-
}();
|
|
91
|
-
|
|
92
|
-
export { SimpleCoordinate as default };
|
package/es/geo/transform.d.ts
DELETED
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import { mat2, mat4 } from 'gl-matrix';
|
|
2
|
-
import Point from '../geo/point';
|
|
3
|
-
import { 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
|
-
}
|