@openglobus/og 0.12.4 → 0.13.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/README.md +0 -2
- package/dist/@openglobus/og.esm.js +2 -2
- package/dist/@openglobus/og.esm.js.map +1 -1
- package/dist/@openglobus/og.umd.js +2 -2
- package/dist/@openglobus/og.umd.js.map +1 -1
- package/package.json +7 -7
- package/src/og/Extent.js +3 -3
- package/src/og/Globe.js +277 -275
- package/src/og/ImageCanvas.js +3 -3
- package/src/og/LonLat.js +9 -9
- package/src/og/QueueArray.js +2 -2
- package/src/og/Rectangle.js +5 -5
- package/src/og/bv/Box.js +1 -1
- package/src/og/bv/Sphere.js +2 -2
- package/src/og/camera/Camera.js +1 -1
- package/src/og/camera/PlanetCamera.js +649 -646
- package/src/og/control/LayerSwitcher.js +1 -1
- package/src/og/control/MouseNavigation.js +22 -13
- package/src/og/control/MouseWheelZoomControl.js +2 -2
- package/src/og/control/ScaleControl.js +1 -1
- package/src/og/control/TouchNavigation.js +319 -319
- package/src/og/control/ZoomControl.js +132 -132
- package/src/og/control/visibleExtent/Segment.js +12 -12
- package/src/og/ellipsoid/Ellipsoid.js +577 -567
- package/src/og/entity/BillboardHandler.js +878 -1051
- package/src/og/entity/Entity.js +1 -1
- package/src/og/entity/EntityCollection.js +847 -857
- package/src/og/entity/GeoObjectHandler.js +2 -2
- package/src/og/entity/LabelHandler.js +887 -1040
- package/src/og/entity/LabelWorker.js +0 -6
- package/src/og/entity/PointCloud.js +495 -495
- package/src/og/entity/Polyline.js +2218 -2222
- package/src/og/entity/RayHandler.js +1 -1
- package/src/og/layer/CanvasTiles.js +6 -3
- package/src/og/layer/GeoImage.js +1 -1
- package/src/og/layer/KML.js +5 -5
- package/src/og/layer/Layer.js +800 -752
- package/src/og/layer/Vector.js +997 -1010
- package/src/og/layer/XYZ.js +359 -357
- package/src/og/math/Line2.js +4 -4
- package/src/og/math/Quat.js +2 -2
- package/src/og/math/Ray.js +2 -2
- package/src/og/math/Vec2.js +524 -524
- package/src/og/math/Vec3.js +900 -900
- package/src/og/math/Vec4.js +261 -261
- package/src/og/math.js +397 -398
- package/src/og/quadTree/EntityCollectionNode.js +389 -387
- package/src/og/renderer/Renderer.js +14 -20
- package/src/og/renderer/RendererEvents.js +1034 -1045
- package/src/og/scene/Planet.js +12 -9
- package/src/og/scene/RenderNode.js +347 -354
- package/src/og/segment/Segment.js +3 -1
- package/src/og/segment/SegmentLonLat.js +1 -4
- package/src/og/shaders/billboard.js +220 -204
- package/src/og/shaders/drawnode.js +607 -603
- package/src/og/shaders/label.js +576 -456
- package/src/og/shaders/polyline.js +365 -361
- package/src/og/terrain/MapboxTerrain.js +1 -1
- package/src/og/utils/FontAtlas.js +209 -200
- package/src/og/utils/GeoImageCreator.js +4 -5
- package/src/og/utils/TextureAtlas.js +4 -4
- package/src/og/utils/VectorTileCreator.js +414 -414
- package/src/og/utils/shared.js +1 -1
- package/src/og/webgl/Handler.js +28 -60
- package/src/og/webgl/Multisample.js +260 -260
- package/src/og/webgl/Program.js +411 -396
- package/types/bv/Box.d.ts +1 -1
- package/types/bv/Sphere.d.ts +1 -1
- package/types/camera/PlanetCamera.d.ts +3 -3
- package/types/control/LayerSwitcher.d.ts +1 -1
- package/types/ellipsoid/Ellipsoid.d.ts +9 -2
- package/types/entity/BillboardHandler.d.ts +0 -4
- package/types/entity/EntityCollection.d.ts +0 -8
- package/types/entity/LabelHandler.d.ts +0 -2
- package/types/entity/Polyline.d.ts +1 -1
- package/types/layer/KML.d.ts +11 -11
- package/types/layer/Layer.d.ts +4 -0
- package/types/layer/Vector.d.ts +1 -8
- package/types/math/Line2.d.ts +4 -4
- package/types/math/Ray.d.ts +2 -2
- package/types/math/Vec2.d.ts +1 -1
- package/types/math/Vec3.d.ts +1 -1
- package/types/math/Vec4.d.ts +2 -2
- package/types/math.d.ts +1 -1
- package/types/renderer/Renderer.d.ts +1 -1
- package/types/renderer/RendererEvents.d.ts +1 -1
- package/types/shaders/label.d.ts +1 -1
- package/types/utils/FontAtlas.d.ts +3 -2
- package/types/utils/TextureAtlas.d.ts +3 -3
- package/types/utils/VectorTileCreator.d.ts +4 -4
- package/types/utils/shared.d.ts +1 -1
- package/types/webgl/Handler.d.ts +6 -31
- package/types/webgl/Program.d.ts +2 -0
package/src/og/LonLat.js
CHANGED
|
@@ -25,27 +25,27 @@ export class LonLat {
|
|
|
25
25
|
* @param {number} [lat] - Latitude.
|
|
26
26
|
* @param {number} [height] - Height over the surface.
|
|
27
27
|
*/
|
|
28
|
-
constructor(lon, lat, height) {
|
|
28
|
+
constructor(lon = 0 , lat = 0, height = 0) {
|
|
29
29
|
/**
|
|
30
30
|
* Longitude.
|
|
31
31
|
* @public
|
|
32
32
|
* @type {number}
|
|
33
33
|
*/
|
|
34
|
-
this.lon = lon
|
|
34
|
+
this.lon = lon;
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* Latitude.
|
|
38
38
|
* @public
|
|
39
39
|
* @type {number}
|
|
40
40
|
*/
|
|
41
|
-
this.lat = lat
|
|
41
|
+
this.lat = lat;
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* Height.
|
|
45
45
|
* @public
|
|
46
46
|
* @type {number}
|
|
47
47
|
*/
|
|
48
|
-
this.height = height
|
|
48
|
+
this.height = height;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
isZero() {
|
|
@@ -101,7 +101,7 @@ export class LonLat {
|
|
|
101
101
|
* @param {number} [height] - Height.
|
|
102
102
|
* @returns {LonLat} -
|
|
103
103
|
*/
|
|
104
|
-
static inverseMercator(x, y, height) {
|
|
104
|
+
static inverseMercator(x, y, height = 0) {
|
|
105
105
|
return new LonLat(
|
|
106
106
|
x * mercator.INV_POLE_BY_180,
|
|
107
107
|
INV_PI_BY_360 * Math.atan(Math.exp(y * mercator.PI_BY_POLE)) - INV_PI_BY_180_HALF_PI,
|
|
@@ -117,10 +117,10 @@ export class LonLat {
|
|
|
117
117
|
* @param {number} [height] - Height.
|
|
118
118
|
* @returns {LonLat} -
|
|
119
119
|
*/
|
|
120
|
-
set(lon, lat, height) {
|
|
121
|
-
this.lon = lon
|
|
122
|
-
this.lat = lat
|
|
123
|
-
this.height = height
|
|
120
|
+
set(lon = 0, lat = 0, height = 0) {
|
|
121
|
+
this.lon = lon;
|
|
122
|
+
this.lat = lat;
|
|
123
|
+
this.height = height;
|
|
124
124
|
return this;
|
|
125
125
|
}
|
|
126
126
|
|
package/src/og/QueueArray.js
CHANGED
|
@@ -5,8 +5,8 @@ class QueueArray {
|
|
|
5
5
|
*
|
|
6
6
|
* @param {number} [size]
|
|
7
7
|
*/
|
|
8
|
-
constructor(size) {
|
|
9
|
-
this._size = size
|
|
8
|
+
constructor(size = 2048) {
|
|
9
|
+
this._size = size;
|
|
10
10
|
this._array = new Array(this._size);
|
|
11
11
|
this._popIndex = parseInt(this._size * 0.5);
|
|
12
12
|
this._shiftIndex = this._popIndex;
|
package/src/og/Rectangle.js
CHANGED
|
@@ -15,34 +15,34 @@ class Rectangle {
|
|
|
15
15
|
* @param {number} [right] - Right coordinate. 0 - default.
|
|
16
16
|
* @param {number} [bottom] - Bottom coordinate. 0 - default.
|
|
17
17
|
*/
|
|
18
|
-
constructor(left, top, right, bottom) {
|
|
18
|
+
constructor(left = 0, top = 0, right = 0, bottom = 0) {
|
|
19
19
|
/**
|
|
20
20
|
* Left coordinate.
|
|
21
21
|
* @public
|
|
22
22
|
* @type {number}
|
|
23
23
|
*/
|
|
24
|
-
this.left = left
|
|
24
|
+
this.left = left;
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Right coordinate.
|
|
28
28
|
* @public
|
|
29
29
|
* @type {number}
|
|
30
30
|
*/
|
|
31
|
-
this.right = right
|
|
31
|
+
this.right = right;
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Top coordinate.
|
|
35
35
|
* @public
|
|
36
36
|
* @type {number}
|
|
37
37
|
*/
|
|
38
|
-
this.top = top
|
|
38
|
+
this.top = top;
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* Top coordinate.
|
|
42
42
|
* @public
|
|
43
43
|
* @type {number}
|
|
44
44
|
*/
|
|
45
|
-
this.bottom = bottom
|
|
45
|
+
this.bottom = bottom;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
/**
|
package/src/og/bv/Box.js
CHANGED
package/src/og/bv/Sphere.js
CHANGED
|
@@ -18,13 +18,13 @@ class Sphere {
|
|
|
18
18
|
* @param {number} radius
|
|
19
19
|
* @param {Vec3} center
|
|
20
20
|
*/
|
|
21
|
-
constructor(radius, center) {
|
|
21
|
+
constructor(radius = 0, center = Vec3.ZERO) {
|
|
22
22
|
/**
|
|
23
23
|
* Sphere radius.
|
|
24
24
|
* @public
|
|
25
25
|
* @type {Number}
|
|
26
26
|
*/
|
|
27
|
-
this.radius = radius
|
|
27
|
+
this.radius = radius;
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* Sphere coordiantes.
|
package/src/og/camera/Camera.js
CHANGED
|
@@ -532,7 +532,7 @@ class Camera {
|
|
|
532
532
|
* @param {Vec3} center - Point that the camera rotates around.
|
|
533
533
|
* @param {Vec3} [up] - Camera up vector.
|
|
534
534
|
*/
|
|
535
|
-
rotateHorizontal(angle, isArc, center, up) {
|
|
535
|
+
rotateHorizontal(angle, isArc, center, up = Vec3.ZERO) {
|
|
536
536
|
this.rotateAround(angle, isArc, center, up);
|
|
537
537
|
}
|
|
538
538
|
|