@openglobus/og 0.16.3 → 0.17.0
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 +1 -1
- package/css/og.css +24 -2
- package/dist/@openglobus/og.css +1 -1
- 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 +1 -1
- package/src/og/Clock.js +1 -5
- package/src/og/Events.js +0 -4
- package/src/og/Extent.js +5 -9
- package/src/og/Globe.js +92 -55
- package/src/og/ImageCanvas.js +12 -5
- package/src/og/Lock.js +44 -48
- package/src/og/LonLat.js +0 -4
- package/src/og/Object3d.js +1 -1
- package/src/og/Stack.js +49 -53
- package/src/og/astro/earth.js +112 -116
- package/src/og/astro/jd.js +514 -518
- package/src/og/astro/orbit.js +119 -123
- package/src/og/astro/rotation.js +36 -40
- package/src/og/bv/Box.js +77 -81
- package/src/og/bv/Sphere.js +57 -61
- package/src/og/camera/Camera.js +20 -7
- package/src/og/camera/PlanetCamera.js +8 -15
- package/src/og/control/Atmosphere.js +0 -4
- package/src/og/control/Control.js +9 -8
- package/src/og/control/DebugInfo.js +0 -4
- package/src/og/control/DrawingSwitcher.js +117 -0
- package/src/og/control/EarthCoordinates.js +214 -214
- package/src/og/control/GeoImageDragControl.js +0 -4
- package/src/og/control/KeyboardNavigation.js +0 -4
- package/src/og/control/LayerAnimation.js +0 -4
- package/src/og/control/LayerSwitcher.js +2 -4
- package/src/og/control/Lighting.js +11 -15
- package/src/og/control/MouseNavigation.js +0 -4
- package/src/og/control/MouseWheelZoomControl.js +0 -4
- package/src/og/control/RulerSwitcher.js +0 -4
- package/src/og/control/ScaleControl.js +2 -6
- package/src/og/control/ShowFps.js +40 -44
- package/src/og/control/SimpleNavigation.js +10 -10
- package/src/og/control/SimpleSkyBackground.js +0 -4
- package/src/og/control/Sun.js +0 -4
- package/src/og/control/ToggleWireframe.js +35 -39
- package/src/og/control/ZoomControl.js +0 -4
- package/src/og/control/drawing/DrawingControl.js +51 -0
- package/src/og/control/drawing/LineStringDrawingScene.js +203 -0
- package/src/og/control/drawing/PolygonDrawingScene.js +785 -0
- package/src/og/control/elevationProfile/ElevationProfile.js +275 -0
- package/src/og/control/index.js +5 -1
- package/src/og/control/ruler/Ruler.js +0 -4
- package/src/og/control/ruler/RulerScene.js +3 -2
- package/src/og/control/selection/Selection.js +0 -4
- package/src/og/control/selection/SelectionScene.js +2 -4
- package/src/og/control/timeline/TimelineControl.js +4 -4
- package/src/og/control/timeline/TimelineModel.js +2 -2
- package/src/og/control/timeline/TimelineView.js +1 -0
- package/src/og/control/visibleExtent/Segment.js +5 -5
- package/src/og/control/visibleExtent/drawnode.js +0 -4
- package/src/og/ellipsoid/Ellipsoid.js +205 -275
- package/src/og/ellipsoid/wgs84.js +0 -4
- package/src/og/entity/BaseBillboard.js +375 -379
- package/src/og/entity/Billboard.js +0 -4
- package/src/og/entity/BillboardHandler.js +0 -4
- package/src/og/entity/Entity.js +22 -22
- package/src/og/entity/EntityCollection.js +7 -11
- package/src/og/entity/GeoObject.js +0 -4
- package/src/og/entity/GeoObjectHandler.js +0 -4
- package/src/og/entity/Geometry.js +5 -4
- package/src/og/entity/GeometryHandler.js +3 -4
- package/src/og/entity/Label.js +0 -4
- package/src/og/entity/LabelHandler.js +0 -4
- package/src/og/entity/PointCloud.js +0 -4
- package/src/og/entity/PointCloudHandler.js +122 -126
- package/src/og/entity/Polyline.js +4 -6
- package/src/og/entity/PolylineHandler.js +104 -108
- package/src/og/entity/Ray.js +29 -29
- package/src/og/entity/Strip.js +1 -1
- package/src/og/index.js +3 -1
- package/src/og/input/KeyboardHandler.js +128 -132
- package/src/og/input/MouseHandler.js +94 -98
- package/src/og/input/TouchHandler.js +59 -63
- package/src/og/input/input.js +44 -48
- package/src/og/layer/BaseGeoImage.js +5 -8
- package/src/og/layer/CanvasTiles.js +0 -4
- package/src/og/layer/GeoImage.js +0 -4
- package/src/og/layer/GeoTexture2d.js +0 -4
- package/src/og/layer/GeoVideo.js +0 -4
- package/src/og/layer/KML.js +1 -0
- package/src/og/layer/Layer.js +22 -26
- package/src/og/layer/Material.js +0 -4
- package/src/og/layer/Vector.js +23 -20
- package/src/og/layer/WMS.js +182 -186
- package/src/og/layer/XYZ.js +0 -4
- package/src/og/light/LightSource.js +0 -4
- package/src/og/math/Line2.js +28 -32
- package/src/og/math/Mat3.js +152 -156
- package/src/og/math/Ray.js +0 -4
- package/src/og/math/Vec2.js +0 -4
- package/src/og/math/Vec3.js +0 -4
- package/src/og/math/Vec4.js +0 -4
- package/src/og/math/coder.js +104 -104
- package/src/og/math.js +39 -7
- package/src/og/proj/EPSG3857.js +13 -13
- package/src/og/proj/Proj.js +59 -63
- package/src/og/quadTree/EPSG4326QuadTreeStrategy.js +1 -0
- package/src/og/quadTree/EarthQuadTreeStrategy.js +1 -0
- package/src/og/quadTree/EntityCollectionNode.js +12 -16
- package/src/og/quadTree/MarsQuadTreeStrategy.js +1 -0
- package/src/og/quadTree/QuadTreeStrategy.js +1 -0
- package/src/og/quadTree/Wgs84QuadTreeStrategy.js +1 -0
- package/src/og/renderer/Renderer.js +109 -22
- package/src/og/renderer/RendererEvents.js +0 -4
- package/src/og/scene/Axes.js +74 -78
- package/src/og/scene/BaseNode.js +0 -4
- package/src/og/scene/Planet.js +114 -112
- package/src/og/scene/RenderNode.js +11 -3
- package/src/og/scene/SkyBox.js +104 -108
- package/src/og/segment/Segment.js +8 -4
- package/src/og/segment/SegmentLonLat.js +2 -6
- package/src/og/segment/segmentHelper.js +229 -225
- package/src/og/shaders/billboard.js +0 -4
- package/src/og/shaders/drawnode.js +5 -9
- package/src/og/shaders/geoObject.js +0 -4
- package/src/og/shaders/label.js +0 -4
- package/src/og/shaders/pickingMask.js +0 -4
- package/src/og/shaders/pointCloud.js +0 -4
- package/src/og/shaders/polyline.js +0 -4
- package/src/og/shaders/ray.js +0 -4
- package/src/og/shaders/skybox.js +0 -4
- package/src/og/terrain/EmptyTerrain.js +0 -4
- package/src/og/utils/FontAtlas.js +0 -4
- package/src/og/utils/GeoImageCreator.js +1 -2
- package/src/og/utils/NormalMapCreator.js +8 -9
- package/src/og/utils/VectorTileCreator.js +3 -9
- package/src/og/utils/shared.js +20 -1
- package/src/og/webgl/Framebuffer.js +0 -4
- package/src/og/webgl/Handler.js +45 -19
- package/src/og/webgl/Multisample.js +0 -4
- package/src/og/webgl/Program.js +0 -4
- package/src/og/webgl/ProgramController.js +2 -2
- package/types/Clock.d.ts +1 -1
- package/types/Extent.d.ts +5 -5
- package/types/Globe.d.ts +15 -1
- package/types/ImageCanvas.d.ts +5 -0
- package/types/bv/Box.d.ts +1 -1
- package/types/bv/Sphere.d.ts +3 -3
- package/types/camera/Camera.d.ts +3 -2
- package/types/camera/PlanetCamera.d.ts +4 -4
- package/types/control/DrawingSwitcher.d.ts +13 -0
- package/types/control/EarthCoordinates.d.ts +1 -1
- package/types/control/Lighting.d.ts +8 -8
- package/types/control/drawing/DrawingControl.d.ts +14 -0
- package/types/control/drawing/LineStringDrawingScene.d.ts +5 -0
- package/types/control/drawing/PolygonDrawingScene.d.ts +99 -0
- package/types/control/index.d.ts +3 -1
- package/types/control/ruler/RulerScene.d.ts +0 -1
- package/types/control/selection/SelectionScene.d.ts +0 -1
- package/types/ellipsoid/Ellipsoid.d.ts +50 -63
- package/types/entity/Entity.d.ts +3 -2
- package/types/entity/Geometry.d.ts +5 -0
- package/types/entity/Polyline.d.ts +1 -1
- package/types/entity/Ray.d.ts +1 -0
- package/types/index.d.ts +1 -0
- package/types/layer/BaseGeoImage.d.ts +1 -1
- package/types/layer/CanvasTiles.d.ts +1 -1
- package/types/layer/Layer.d.ts +1 -1
- package/types/layer/Vector.d.ts +1 -0
- package/types/math.d.ts +7 -0
- package/types/renderer/Renderer.d.ts +7 -1
- package/types/scene/Axes.d.ts +0 -1
- package/types/scene/Planet.d.ts +26 -24
- package/types/scene/RenderNode.d.ts +2 -0
- package/types/scene/SkyBox.d.ts +0 -1
- package/types/segment/Segment.d.ts +3 -2
- package/types/segment/SegmentLonLat.d.ts +0 -1
- package/types/utils/GeoImageCreator.d.ts +1 -1
- package/types/utils/NormalMapCreator.d.ts +1 -1
- package/types/utils/VectorTileCreator.d.ts +2 -2
- package/types/utils/shared.d.ts +2 -0
- package/types/webgl/Handler.d.ts +6 -4
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module og/utils/VectorTileCreator
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
1
|
'use strict';
|
|
6
2
|
|
|
7
3
|
import { doubleToTwoFloats2 } from '../math/coder.js';
|
|
@@ -14,19 +10,17 @@ let tempArr = new Float32Array(2);
|
|
|
14
10
|
const MAX_FRAME_TIME = 25.0;
|
|
15
11
|
|
|
16
12
|
export class VectorTileCreator {
|
|
17
|
-
|
|
18
13
|
constructor(planet, width = 512, height = 512) {
|
|
19
|
-
|
|
20
14
|
this._width = width;
|
|
21
15
|
this._height = height;
|
|
22
|
-
this._handler = planet.renderer.handler;
|
|
23
16
|
this._planet = planet;
|
|
24
17
|
this._framebuffer = null;
|
|
25
18
|
this._queue = [];
|
|
26
|
-
this._initialize();
|
|
27
19
|
}
|
|
28
20
|
|
|
29
|
-
|
|
21
|
+
init() {
|
|
22
|
+
|
|
23
|
+
this._handler = this._planet.renderer.handler;
|
|
30
24
|
|
|
31
25
|
//Line
|
|
32
26
|
if (!this._handler.programs.vectorTileLineRasterization) {
|
package/src/og/utils/shared.js
CHANGED
|
@@ -956,6 +956,7 @@ export async function loadImage(url) {
|
|
|
956
956
|
resolve(image);
|
|
957
957
|
});
|
|
958
958
|
image.src = url;
|
|
959
|
+
image.crossOrigin = ""
|
|
959
960
|
return image;
|
|
960
961
|
});
|
|
961
962
|
}
|
|
@@ -967,4 +968,22 @@ export async function loadImage(url) {
|
|
|
967
968
|
*/
|
|
968
969
|
export function isImageLoaded(image) {
|
|
969
970
|
return image.complete && image.naturalHeight !== 0;
|
|
970
|
-
}
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
export function distanceFormat(v) {
|
|
974
|
+
if (v > 1000) {
|
|
975
|
+
return `${(v / 1000).toFixed(1)} km`;
|
|
976
|
+
} else if (v > 9) {
|
|
977
|
+
return `${Math.round(v)} m`;
|
|
978
|
+
} else {
|
|
979
|
+
return `${v.toFixed(1)} m`;
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
export function getUrlParam(paramName) {
|
|
984
|
+
let urlParams = new URLSearchParams(location.search);
|
|
985
|
+
let param = urlParams.get(paramName);
|
|
986
|
+
if (param) {
|
|
987
|
+
return Number(param);
|
|
988
|
+
}
|
|
989
|
+
}
|
package/src/og/webgl/Handler.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module og/webgl/Handler
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
1
|
"use strict";
|
|
6
2
|
|
|
7
3
|
import { Clock } from "../Clock.js";
|
|
@@ -10,7 +6,7 @@ import { Events } from "../Events.js";
|
|
|
10
6
|
import { ImageCanvas } from "../ImageCanvas.js";
|
|
11
7
|
import { Vec2 } from "../math/Vec2.js";
|
|
12
8
|
import { Stack } from "../Stack.js";
|
|
13
|
-
import { isEmpty } from "../utils/shared.js";
|
|
9
|
+
import { getUrlParam, isEmpty } from "../utils/shared.js";
|
|
14
10
|
import { ProgramController } from "./ProgramController.js";
|
|
15
11
|
|
|
16
12
|
const vendorPrefixes = ["", "WEBKIT_", "MOZ_"];
|
|
@@ -23,7 +19,7 @@ const MAX_LEVELS = 2;
|
|
|
23
19
|
/**
|
|
24
20
|
* A WebGL handler for accessing low-level WebGL capabilities.
|
|
25
21
|
* @class
|
|
26
|
-
* @param {string}
|
|
22
|
+
* @param {string | HTMLCanvasElement} canvasTarget - Canvas element target.
|
|
27
23
|
* or undefined creates hidden canvas and handler bacomes hidden.
|
|
28
24
|
* @param {Object} [params] - Handler options:
|
|
29
25
|
* @param {number} [params.anisotropy] - Anisotropy filter degree. 8 is default.
|
|
@@ -32,7 +28,7 @@ const MAX_LEVELS = 2;
|
|
|
32
28
|
* @param {Array.<string>} [params.extensions] - Additional WebGL extension list. Available by default: EXT_texture_filter_anisotropic.
|
|
33
29
|
*/
|
|
34
30
|
class Handler {
|
|
35
|
-
constructor(
|
|
31
|
+
constructor(canvasTarget, params = {}) {
|
|
36
32
|
|
|
37
33
|
this.events = new Events(["visibilitychange", "resize"]);
|
|
38
34
|
/**
|
|
@@ -94,7 +90,7 @@ class Handler {
|
|
|
94
90
|
this._params.anisotropy = this._params.anisotropy || 4;
|
|
95
91
|
this._params.width = this._params.width || 256;
|
|
96
92
|
this._params.height = this._params.height || 256;
|
|
97
|
-
this._params.pixelRatio = this._params.pixelRatio || 1.0;
|
|
93
|
+
this._params.pixelRatio = getUrlParam('og_dpi') || this._params.pixelRatio || 1.0;
|
|
98
94
|
this._params.context = this._params.context || {};
|
|
99
95
|
this._params.extensions = this._params.extensions || [];
|
|
100
96
|
this._oneByHeight = 1.0 / (this._params.height * this._params.pixelRatio);
|
|
@@ -109,11 +105,11 @@ class Handler {
|
|
|
109
105
|
this.extensions = {};
|
|
110
106
|
|
|
111
107
|
/**
|
|
112
|
-
* HTML Canvas
|
|
108
|
+
* HTML Canvas target.
|
|
113
109
|
* @private
|
|
114
110
|
* @type {Object}
|
|
115
111
|
*/
|
|
116
|
-
this.
|
|
112
|
+
this._canvasTarget = canvasTarget;
|
|
117
113
|
|
|
118
114
|
this._lastAnimationFrameTime = 0;
|
|
119
115
|
|
|
@@ -144,11 +140,31 @@ class Handler {
|
|
|
144
140
|
|
|
145
141
|
this.ONCANVASRESIZE = null;
|
|
146
142
|
|
|
143
|
+
this._createCanvas();
|
|
144
|
+
|
|
147
145
|
if (params.autoActivate || isEmpty(params.autoActivate)) {
|
|
148
146
|
this.initialize();
|
|
149
147
|
}
|
|
150
148
|
}
|
|
151
149
|
|
|
150
|
+
isInitialized() {
|
|
151
|
+
return this._initialized;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
_createCanvas() {
|
|
155
|
+
if (this._canvasTarget) {
|
|
156
|
+
if (this._canvasTarget instanceof HTMLElement) {
|
|
157
|
+
this.canvas = this._canvasTarget;
|
|
158
|
+
} else {
|
|
159
|
+
this.canvas = document.getElementById(this._canvasTarget) || document.querySelector(this._canvasTarget);
|
|
160
|
+
}
|
|
161
|
+
} else {
|
|
162
|
+
this.canvas = document.createElement("canvas");
|
|
163
|
+
this.canvas.width = this._params.width;
|
|
164
|
+
this.canvas.height = this._params.height;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
152
168
|
/**
|
|
153
169
|
* The return value is null if the extension is not supported, or an extension object otherwise.
|
|
154
170
|
* @param {Object} gl - WebGl context pointer.
|
|
@@ -611,17 +627,12 @@ class Handler {
|
|
|
611
627
|
* @public
|
|
612
628
|
*/
|
|
613
629
|
initialize() {
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
} else {
|
|
617
|
-
this.canvas = document.createElement("canvas");
|
|
618
|
-
this.canvas.width = this._params.width;
|
|
619
|
-
this.canvas.height = this._params.height;
|
|
620
|
-
}
|
|
630
|
+
|
|
631
|
+
if (this._initialized) return;
|
|
621
632
|
|
|
622
633
|
this.gl = Handler.getContext(this.canvas, this._params.context);
|
|
623
634
|
|
|
624
|
-
if(this.gl) {
|
|
635
|
+
if (this.gl) {
|
|
625
636
|
this._initialized = true;
|
|
626
637
|
|
|
627
638
|
/** Sets default extensions */
|
|
@@ -1017,6 +1028,9 @@ class Handler {
|
|
|
1017
1028
|
|
|
1018
1029
|
this.stop();
|
|
1019
1030
|
|
|
1031
|
+
//
|
|
1032
|
+
// Dispose shaders
|
|
1033
|
+
//
|
|
1020
1034
|
for (let p in this.programs) {
|
|
1021
1035
|
this.removeProgram(p);
|
|
1022
1036
|
}
|
|
@@ -1030,6 +1044,9 @@ class Handler {
|
|
|
1030
1044
|
this.framebufferStack = null;
|
|
1031
1045
|
this.framebufferStack = new Stack();
|
|
1032
1046
|
|
|
1047
|
+
//
|
|
1048
|
+
// Destroy canvas
|
|
1049
|
+
//
|
|
1033
1050
|
if (this.canvas.parentNode) {
|
|
1034
1051
|
this.canvas.parentNode.removeChild(this.canvas);
|
|
1035
1052
|
}
|
|
@@ -1037,6 +1054,9 @@ class Handler {
|
|
|
1037
1054
|
this.canvas.height = 1;
|
|
1038
1055
|
this.canvas = null;
|
|
1039
1056
|
|
|
1057
|
+
//
|
|
1058
|
+
// Clear attrib pointers
|
|
1059
|
+
//
|
|
1040
1060
|
let numAttribs = gl.getParameter(gl.MAX_VERTEX_ATTRIBS);
|
|
1041
1061
|
let tmp = gl.createBuffer();
|
|
1042
1062
|
gl.bindBuffer(gl.ARRAY_BUFFER, tmp);
|
|
@@ -1047,13 +1067,19 @@ class Handler {
|
|
|
1047
1067
|
}
|
|
1048
1068
|
gl.deleteBuffer(tmp);
|
|
1049
1069
|
|
|
1050
|
-
|
|
1070
|
+
//
|
|
1071
|
+
// Clear all possible textures
|
|
1072
|
+
//
|
|
1073
|
+
let numTextureUnits = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);
|
|
1051
1074
|
for (let ii = 0; ii < numTextureUnits; ++ii) {
|
|
1052
1075
|
gl.activeTexture(gl.TEXTURE0 + ii);
|
|
1053
1076
|
gl.bindTexture(gl.TEXTURE_CUBE_MAP, null);
|
|
1054
1077
|
gl.bindTexture(gl.TEXTURE_2D, null);
|
|
1055
1078
|
}
|
|
1056
1079
|
|
|
1080
|
+
//
|
|
1081
|
+
// Hard reset
|
|
1082
|
+
//
|
|
1057
1083
|
gl.activeTexture(gl.TEXTURE0);
|
|
1058
1084
|
gl.useProgram(null);
|
|
1059
1085
|
gl.bindBuffer(gl.ARRAY_BUFFER, null);
|
package/src/og/webgl/Program.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
1
3
|
import { Handler } from "./Handler.js";
|
|
2
4
|
import { Program } from "./Program.js";
|
|
3
5
|
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
6
|
/**
|
|
7
7
|
* This is shader program controller that used by hadler object to access the shader
|
|
8
8
|
* program capabilities, like switching program during the rendering.
|
package/types/Clock.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @param {number} [params.startDate=0.0] - Julian start date.
|
|
6
6
|
* @param {number} [params.endDate=0.0] - Julian end date.
|
|
7
7
|
* @param {number} [params.currentDate] - Julian current date. Default: current date.
|
|
8
|
-
* @param {number} [params.multiplier=1.0] - Time speed
|
|
8
|
+
* @param {number} [params.multiplier=1.0] - Time speed multiplier.
|
|
9
9
|
*/
|
|
10
10
|
export class Clock {
|
|
11
11
|
static set _staticCounter(arg: any);
|
package/types/Extent.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Represents geographical coordinates extent.
|
|
3
3
|
* @class
|
|
4
|
-
* @param {LonLat} [sw] - South West extent corner
|
|
5
|
-
* @param {LonLat} [ne] - North East extent corner
|
|
4
|
+
* @param {LonLat} [sw] - South West extent corner coordinates.
|
|
5
|
+
* @param {LonLat} [ne] - North East extent corner coordinates.
|
|
6
6
|
*/
|
|
7
7
|
export class Extent {
|
|
8
8
|
/**
|
|
@@ -35,7 +35,7 @@ export class Extent {
|
|
|
35
35
|
*/
|
|
36
36
|
static createByCoordinates(arr: Array<LonLat>): Extent;
|
|
37
37
|
/**
|
|
38
|
-
* Creates bound extent instance by
|
|
38
|
+
* Creates bound extent instance by coordinates array.
|
|
39
39
|
* @static
|
|
40
40
|
* @param {Array.<Array<number>>} arr - Coordinate array. (exactly 2 entries)
|
|
41
41
|
* @return {Extent} Extent object.
|
|
@@ -53,8 +53,8 @@ export class Extent {
|
|
|
53
53
|
*/
|
|
54
54
|
static fromTile(x: number, y: number, z: number, width: number, height: number): Extent;
|
|
55
55
|
/**
|
|
56
|
-
* @param {LonLat} [sw] - South West extent corner
|
|
57
|
-
* @param {LonLat} [ne] - North East extent corner
|
|
56
|
+
* @param {LonLat} [sw] - South West extent corner coordinates.
|
|
57
|
+
* @param {LonLat} [ne] - North East extent corner coordinates.
|
|
58
58
|
*/
|
|
59
59
|
constructor(sw?: LonLat, ne?: LonLat);
|
|
60
60
|
/**
|
package/types/Globe.d.ts
CHANGED
|
@@ -45,16 +45,26 @@
|
|
|
45
45
|
* @param {Number} [options.quadTreeStrategyPrototype] - Prototype of quadTree. QuadTreeStrategy for Earth is default.
|
|
46
46
|
* @param {Number} [options.msaa] - MSAA antialiasing parameter: 2,4,8,16. Default is 4.
|
|
47
47
|
* @param {Number} [options.dpi] - Device pixel ratio. Default is current screen DPI.
|
|
48
|
+
* @param {Boolean} [options.atmosphereEnabled] - Enables atmosphere effect.
|
|
48
49
|
*/
|
|
49
50
|
export class Globe {
|
|
51
|
+
static set __staticCounter(arg: any);
|
|
52
|
+
static get __staticCounter(): any;
|
|
50
53
|
static set _staticCounter(arg: any);
|
|
51
54
|
static get _staticCounter(): any;
|
|
52
55
|
/**
|
|
53
56
|
* @param {*} options
|
|
54
57
|
*/
|
|
55
58
|
constructor(options: any);
|
|
59
|
+
$target: any;
|
|
60
|
+
_instanceID: string;
|
|
56
61
|
_canvas: HTMLCanvasElement;
|
|
57
|
-
|
|
62
|
+
/**
|
|
63
|
+
* Dom element where WebGL canvas creates
|
|
64
|
+
* @public
|
|
65
|
+
* @type {Element}
|
|
66
|
+
*/
|
|
67
|
+
public $inner: Element;
|
|
58
68
|
/**
|
|
59
69
|
* Interface for the renderer context(events, input states, renderer nodes etc.)
|
|
60
70
|
* @public
|
|
@@ -78,6 +88,7 @@ export class Globe {
|
|
|
78
88
|
_opacityCounter: number;
|
|
79
89
|
_fadeHandler: any;
|
|
80
90
|
_stopHandler: any;
|
|
91
|
+
start(): void;
|
|
81
92
|
/**
|
|
82
93
|
* Starts screen brightness fading in effect by the duration time.
|
|
83
94
|
* @public
|
|
@@ -89,6 +100,9 @@ export class Globe {
|
|
|
89
100
|
* @param {number} duration - Fadeout duration time.
|
|
90
101
|
*/
|
|
91
102
|
public fadeOut(): void;
|
|
103
|
+
attachTo(target: any): void;
|
|
104
|
+
detach(): void;
|
|
105
|
+
destroy(): void;
|
|
92
106
|
}
|
|
93
107
|
import { Renderer } from "./renderer/Renderer.js";
|
|
94
108
|
import { Planet } from "./scene/Planet.js";
|
package/types/ImageCanvas.d.ts
CHANGED
package/types/bv/Box.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export class Box {
|
|
|
21
21
|
*/
|
|
22
22
|
setFromBoundsArr(bounds: Array<number>): void;
|
|
23
23
|
/**
|
|
24
|
-
* Sets bounding box
|
|
24
|
+
* Sets bounding box coordinates by ellipsoid geodetic extend.
|
|
25
25
|
* @param {Ellipsoid} ellipsoid - Ellipsoid.
|
|
26
26
|
* @param {Extent} extent - Geodetic extent.
|
|
27
27
|
*/
|
package/types/bv/Sphere.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Bounding sphere class.
|
|
3
3
|
* @class
|
|
4
4
|
* @param {Number} [radius] - Bounding sphere radius.
|
|
5
|
-
* @param {Vec3} [center] - Bounding sphere
|
|
5
|
+
* @param {Vec3} [center] - Bounding sphere coordinates.
|
|
6
6
|
*/
|
|
7
7
|
export class Sphere {
|
|
8
8
|
/**
|
|
@@ -18,7 +18,7 @@ export class Sphere {
|
|
|
18
18
|
*/
|
|
19
19
|
public radius: number;
|
|
20
20
|
/**
|
|
21
|
-
* Sphere
|
|
21
|
+
* Sphere coordinates.
|
|
22
22
|
* @public
|
|
23
23
|
* @type {Vec3}
|
|
24
24
|
*/
|
|
@@ -29,7 +29,7 @@ export class Sphere {
|
|
|
29
29
|
*/
|
|
30
30
|
setFromBounds(bounds: Array<number>): void;
|
|
31
31
|
/**
|
|
32
|
-
* Sets bounding sphere
|
|
32
|
+
* Sets bounding sphere coordinates by ellipsoid geodetic extend.
|
|
33
33
|
* @param {Ellipsoid} ellipsoid - Ellipsoid.
|
|
34
34
|
* @param {Extent} extent - Geodetic extent.
|
|
35
35
|
*/
|
package/types/camera/Camera.d.ts
CHANGED
|
@@ -105,6 +105,7 @@ export class Camera {
|
|
|
105
105
|
currentFrustumIndex: number;
|
|
106
106
|
isFirstPass: boolean;
|
|
107
107
|
checkMoveEnd(): void;
|
|
108
|
+
bindRenderer(renderer: any): void;
|
|
108
109
|
/**
|
|
109
110
|
* Camera initialization.
|
|
110
111
|
* @public
|
|
@@ -225,9 +226,9 @@ export class Camera {
|
|
|
225
226
|
*/
|
|
226
227
|
public unproject(x: number, y: number): Vec3;
|
|
227
228
|
/**
|
|
228
|
-
* Gets projected 3d point to the 2d screen
|
|
229
|
+
* Gets projected 3d point to the 2d screen coordinates
|
|
229
230
|
* @public
|
|
230
|
-
* @param {Vec3} v - Cartesian 3d
|
|
231
|
+
* @param {Vec3} v - Cartesian 3d coordinates
|
|
231
232
|
* @returns {Vec2} - Screen point coordinates
|
|
232
233
|
*/
|
|
233
234
|
public project(v: Vec3): Vec2;
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
* @param {Object} [options.name] - Camera name.
|
|
8
8
|
* @param {number} [options.viewAngle] - Camera angle of view.
|
|
9
9
|
* @param {number} [options.near] - Camera near plane distance. Default is 1.0
|
|
10
|
-
* @param {number} [options.far] - Camera far plane distance.
|
|
11
|
-
* @param {number} [options.minAltitude] - Minimal altitude for the camera.
|
|
12
|
-
* @param {number} [options.maxAltitude] - Maximal altitude for the camera.
|
|
10
|
+
* @param {number} [options.far] - Camera far plane distance. Default is og.math.MAX
|
|
11
|
+
* @param {number} [options.minAltitude] - Minimal altitude for the camera. Default is 5
|
|
12
|
+
* @param {number} [options.maxAltitude] - Maximal altitude for the camera. Default is 20000000
|
|
13
13
|
* @param {Vec3} [options.eye] - Camera eye position. Default (0,0,0)
|
|
14
14
|
* @param {Vec3} [options.look] - Camera look position. Default (0,0,0)
|
|
15
15
|
* @param {Vec3} [options.up] - Camera eye position. Default (0,1,0)
|
|
@@ -152,7 +152,7 @@ export class PlanetCamera extends Camera {
|
|
|
152
152
|
public flyCartesian(cartesian: Vec3, look?: Vec3, up?: Vec3, ampl?: number, completeCallback?: cameraCallback, startCallback?: cameraCallback, frameCallback?: () => void): void;
|
|
153
153
|
_frameCallback: () => void;
|
|
154
154
|
/**
|
|
155
|
-
* Flies to the geo
|
|
155
|
+
* Flies to the geo coordinates.
|
|
156
156
|
* @public
|
|
157
157
|
* @param {LonLat} lonlat - Finish coordinates.
|
|
158
158
|
* @param {Vec3} [look] - Camera LOOK in the end of flying. Default - (0,0,0)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Activate drawing control
|
|
3
|
+
* @class
|
|
4
|
+
* @extends {Control}
|
|
5
|
+
* @param {Object} [options] - Control options.
|
|
6
|
+
*/
|
|
7
|
+
export class DrawingSwitcher extends Control {
|
|
8
|
+
constructor(options?: {});
|
|
9
|
+
drawingControl: DrawingControl;
|
|
10
|
+
_createMenu(): void;
|
|
11
|
+
}
|
|
12
|
+
import { Control } from "./Control.js";
|
|
13
|
+
import { DrawingControl } from "./drawing/DrawingControl.js";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @class
|
|
4
4
|
* @extends {og.control.Control}
|
|
5
5
|
* @param {Object} [options] - Options:
|
|
6
|
-
* @param {Boolean} [options.center] - Earth
|
|
6
|
+
* @param {Boolean} [options.center] - Earth coordinates by screen center otherwise mouse pointer. False is default.
|
|
7
7
|
* @param {Boolean} [options.type] - Coordinates shown: 0 - is decimal degrees, 1 - degrees, 2 - mercator geodetic coordinates.
|
|
8
8
|
*/
|
|
9
9
|
export class EarthCoordinates {
|
|
@@ -21,14 +21,14 @@ export class Lighting extends Control {
|
|
|
21
21
|
_specular_b: Slider;
|
|
22
22
|
_shininess: Slider;
|
|
23
23
|
bindLayer(layer: any): void;
|
|
24
|
-
$atmosphereOpacity:
|
|
25
|
-
$gamma:
|
|
26
|
-
$exposure:
|
|
27
|
-
$opacity:
|
|
28
|
-
$diffuse:
|
|
29
|
-
$ambient:
|
|
30
|
-
$specular:
|
|
31
|
-
$night:
|
|
24
|
+
$atmosphereOpacity: any;
|
|
25
|
+
$gamma: any;
|
|
26
|
+
$exposure: any;
|
|
27
|
+
$opacity: any;
|
|
28
|
+
$diffuse: any;
|
|
29
|
+
$ambient: any;
|
|
30
|
+
$specular: any;
|
|
31
|
+
$night: any;
|
|
32
32
|
_update(): void;
|
|
33
33
|
_fetchLayers(): void;
|
|
34
34
|
_onLayerAdd(e: any): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Activate drawing
|
|
3
|
+
* @class
|
|
4
|
+
* @extends {Control}
|
|
5
|
+
* @param {Object} [options] - Control options.
|
|
6
|
+
*/
|
|
7
|
+
export class DrawingControl extends Control {
|
|
8
|
+
constructor(options?: {});
|
|
9
|
+
_drawingScene: LineStringDrawingScene;
|
|
10
|
+
activatePolygonDrawing(): void;
|
|
11
|
+
activateLineStringDrawing(): void;
|
|
12
|
+
}
|
|
13
|
+
import { Control } from "../Control.js";
|
|
14
|
+
import { LineStringDrawingScene } from "./LineStringDrawingScene.js";
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
export const NUM_SEGMENTS: 200;
|
|
2
|
+
export const OUTLINE_ALT: 0.3;
|
|
3
|
+
export const COORDINATES_COLOR: "rgb(350, 350, 0)";
|
|
4
|
+
export const CENTER_COLOR: "rgb(0, 350, 50)";
|
|
5
|
+
export const OUTLINE_COLOR: "rgb(0, 350, 50)";
|
|
6
|
+
export const OUTLINE_THICKNESS: 3.5;
|
|
7
|
+
export namespace CORNER_OPTIONS {
|
|
8
|
+
export const scale: number;
|
|
9
|
+
export const instanced: boolean;
|
|
10
|
+
export const tag: string;
|
|
11
|
+
export { COORDINATES_COLOR as color };
|
|
12
|
+
export { POINTER_OBJ3D as object3d };
|
|
13
|
+
}
|
|
14
|
+
export namespace CENTER_OPTIONS {
|
|
15
|
+
const scale_1: number;
|
|
16
|
+
export { scale_1 as scale };
|
|
17
|
+
const instanced_1: boolean;
|
|
18
|
+
export { instanced_1 as instanced };
|
|
19
|
+
const tag_1: string;
|
|
20
|
+
export { tag_1 as tag };
|
|
21
|
+
export { CENTER_COLOR as color };
|
|
22
|
+
export { POINTER_OBJ3D as object3d };
|
|
23
|
+
}
|
|
24
|
+
export namespace OUTLINE_OPTIONS {
|
|
25
|
+
export { OUTLINE_THICKNESS as thickness };
|
|
26
|
+
export { OUTLINE_COLOR as color };
|
|
27
|
+
}
|
|
28
|
+
declare const POINTER_OBJ3D: Object3d;
|
|
29
|
+
export class PolygonDrawingScene extends RenderNode {
|
|
30
|
+
constructor(options?: {});
|
|
31
|
+
_planet: any;
|
|
32
|
+
_initCoordinates: any;
|
|
33
|
+
_pickedCorner: any;
|
|
34
|
+
_pickedCenter: any;
|
|
35
|
+
_startPos: any;
|
|
36
|
+
_startClick: Vec2;
|
|
37
|
+
_geometryLayer: Vector;
|
|
38
|
+
_cornerLayer: Vector;
|
|
39
|
+
_centerLayer: Vector;
|
|
40
|
+
_outlineLayer: Vector;
|
|
41
|
+
_ghostCorner: Entity;
|
|
42
|
+
_ghostOutlineLayer: Vector;
|
|
43
|
+
_showGhostPointer: boolean;
|
|
44
|
+
_isStartPoint: boolean;
|
|
45
|
+
_insertCornerIndex: number;
|
|
46
|
+
get geometryType(): string;
|
|
47
|
+
getCoordinates(): any;
|
|
48
|
+
bindPlanet(planet: any): void;
|
|
49
|
+
_onChange_: any;
|
|
50
|
+
_onChange(e: any): void;
|
|
51
|
+
clear(): void;
|
|
52
|
+
setCoordinates(coords: any): void;
|
|
53
|
+
stopNewPoint(): void;
|
|
54
|
+
_onMouseDblClick_: any;
|
|
55
|
+
startNewPoint(): void;
|
|
56
|
+
showGhostPointer(): void;
|
|
57
|
+
hideGhostPointer(): void;
|
|
58
|
+
setGhostPointerPosition(groundPos: any): void;
|
|
59
|
+
_onCornerMouseEnter(e: any): void;
|
|
60
|
+
_onCornerMouseLeave(e: any): void;
|
|
61
|
+
_onCenterMouseEnter(e: any): void;
|
|
62
|
+
_onCenterMouseLeave(e: any): void;
|
|
63
|
+
_onLup(e: any): void;
|
|
64
|
+
_getLdown(e: any): any;
|
|
65
|
+
_onCornerLdown(e: any): void;
|
|
66
|
+
_onCenterLdown(e: any): void;
|
|
67
|
+
_onMouseMove(e: any): void;
|
|
68
|
+
_onCornerLdblclick(e: any): void;
|
|
69
|
+
_cornerDblClick: boolean;
|
|
70
|
+
_onMouseDblClick(e: any): void;
|
|
71
|
+
_initEvents(): void;
|
|
72
|
+
_onCornerLdblclick_: any;
|
|
73
|
+
_onCornerLdown_: any;
|
|
74
|
+
_onCenterLdown_: any;
|
|
75
|
+
_onLup_: any;
|
|
76
|
+
_onMouseMove_: any;
|
|
77
|
+
_onCornerMouseEnter_: any;
|
|
78
|
+
_onCornerMouseLeave_: any;
|
|
79
|
+
_onCenterMouseEnter_: any;
|
|
80
|
+
_onCenterMouseLeave_: any;
|
|
81
|
+
_clearEvents(): void;
|
|
82
|
+
_drawCorners(): void;
|
|
83
|
+
_drawCenters(): void;
|
|
84
|
+
_drawGhostCorner(): void;
|
|
85
|
+
_checkTerrainCollision(entity: any): void;
|
|
86
|
+
_moveCenterPoint(): void;
|
|
87
|
+
_addNew(cart: any): void;
|
|
88
|
+
_appendCart(cart: any): void;
|
|
89
|
+
_clearGhostPointer(): void;
|
|
90
|
+
_moveCornerPoint(e: any): void;
|
|
91
|
+
_updateGhostOutlinePointer(groundPos: any): void;
|
|
92
|
+
_initGhostLayerPointer(): void;
|
|
93
|
+
}
|
|
94
|
+
import { Object3d } from '../../Object3d.js';
|
|
95
|
+
import { RenderNode } from '../../scene/RenderNode.js';
|
|
96
|
+
import { Vec2 } from '../../math/Vec2.js';
|
|
97
|
+
import { Vector } from '../../layer/Vector.js';
|
|
98
|
+
import { Entity } from '../../entity/Entity.js';
|
|
99
|
+
export {};
|
package/types/control/index.d.ts
CHANGED
|
@@ -22,4 +22,6 @@ import { SimpleSkyBackground } from "./SimpleSkyBackground.js";
|
|
|
22
22
|
import { Selection } from "./selection/Selection.js";
|
|
23
23
|
import { LayerAnimation } from "./LayerAnimation.js";
|
|
24
24
|
import { TimelineControl } from "./timeline/TimelineControl.js";
|
|
25
|
-
|
|
25
|
+
import { DrawingSwitcher } from "./DrawingSwitcher.js";
|
|
26
|
+
import { DrawingControl } from "./drawing/DrawingControl.js";
|
|
27
|
+
export { Control, CompassButton, DebugInfo, EarthNavigation, EarthCoordinates, GeoImageDragControl, KeyboardNavigation, LayerSwitcher, MouseNavigation, ToggleWireframe, TouchNavigation, SimpleNavigation, ShowFps, ScaleControl, Sun, ZoomControl, MouseWheelZoomControl, Lighting, Ruler, HeightRuler, SimpleSkyBackground, Selection, LayerAnimation, TimelineControl, DrawingSwitcher, DrawingControl };
|