@openglobus/og 0.15.1 → 0.15.3
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 +10 -4
- package/css/og.css +44 -45
- 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 +12 -12
- package/src/og/Clock.js +1 -1
- package/src/og/Events.js +1 -1
- package/src/og/Extent.js +1 -1
- package/src/og/Globe.js +3 -5
- package/src/og/Popup.js +38 -63
- package/src/og/astro/earth.js +2 -2
- package/src/og/astro/rotation.js +2 -2
- package/src/og/bv/Box.js +1 -0
- package/src/og/bv/index.js +1 -1
- package/src/og/camera/Camera.js +4 -4
- package/src/og/camera/PlanetCamera.js +26 -6
- package/src/og/camera/index.js +1 -1
- package/src/og/control/Atmosphere.js +3 -8
- package/src/og/control/CompassButton.js +4 -5
- package/src/og/control/EarthCoordinates.js +3 -2
- package/src/og/control/EarthNavigation.js +0 -1
- package/src/og/control/GeoImageDragControl.js +2 -2
- package/src/og/control/KeyboardNavigation.js +3 -2
- package/src/og/control/LayerAnimation.js +2 -2
- package/src/og/control/LayerSwitcher.js +5 -4
- package/src/og/control/Lighting.js +106 -35
- package/src/og/control/MouseNavigation.js +4 -4
- package/src/og/control/MouseWheelZoomControl.js +2 -2
- package/src/og/control/RulerSwitcher.js +4 -3
- package/src/og/control/ScaleControl.js +2 -2
- package/src/og/control/ShowFps.js +2 -1
- package/src/og/control/SimpleNavigation.js +2 -1
- package/src/og/control/SimpleSkyBackground.js +2 -2
- package/src/og/control/Sun.js +8 -1
- package/src/og/control/ToggleWireframe.js +2 -1
- package/src/og/control/TouchNavigation.js +4 -3
- package/src/og/control/ZoomControl.js +6 -5
- package/src/og/control/index.js +10 -10
- package/src/og/control/ruler/RulerScene.js +19 -11
- package/src/og/control/selection/Selection.js +1 -1
- package/src/og/control/selection/SelectionScene.js +5 -8
- package/src/og/control/timeline/TimelineControl.js +3 -4
- package/src/og/control/timeline/TimelineModel.js +2 -2
- package/src/og/control/timeline/TimelineView.js +10 -5
- package/src/og/control/visibleExtent/Segment.js +5 -5
- package/src/og/control/visibleExtent/VisibleExtent.js +1 -1
- package/src/og/ellipsoid/Ellipsoid.js +3 -3
- package/src/og/entity/BaseBillboard.js +2 -2
- package/src/og/entity/BillboardHandler.js +10 -2
- package/src/og/entity/Entity.js +10 -51
- package/src/og/entity/EntityCollection.js +3 -20
- package/src/og/entity/GeoObject.js +2 -4
- package/src/og/entity/GeoObjectHandler.js +12 -11
- package/src/og/entity/Geometry.js +2 -2
- package/src/og/entity/GeometryHandler.js +2 -2
- package/src/og/entity/Label.js +2 -2
- package/src/og/entity/LabelHandler.js +7 -5
- package/src/og/entity/Polyline.js +8 -7
- package/src/og/entity/Ray.js +1 -2
- package/src/og/entity/RayHandler.js +4 -0
- package/src/og/entity/Strip.js +8 -5
- package/src/og/entity/index.js +1 -1
- package/src/og/index.core.js +4 -4
- package/src/og/index.js +4 -4
- package/src/og/index.webgl.js +3 -3
- package/src/og/layer/BaseGeoImage.js +2 -2
- package/src/og/layer/GeoImage.js +2 -2
- package/src/og/layer/GeoTexture2d.js +1 -1
- package/src/og/layer/Layer.js +3 -3
- package/src/og/layer/Vector.js +7 -11
- package/src/og/layer/WMS.js +2 -1
- package/src/og/layer/XYZ.js +2 -4
- package/src/og/math/Line3.js +0 -1
- package/src/og/math/Plane.js +0 -1
- package/src/og/math/Ray.js +0 -1
- package/src/og/math/Vec2.js +62 -62
- package/src/og/math/Vec3.js +1 -1
- package/src/og/math/Vec4.js +1 -1
- package/src/og/math/index.js +1 -1
- package/src/og/proj/EPSG3857.js +1 -1
- package/src/og/proj/EPSG4326.js +1 -1
- package/src/og/quadTree/EarthQuadTreeStrategy.js +4 -4
- package/src/og/quadTree/MarsQuadTreeStrategy.js +4 -4
- package/src/og/quadTree/Node.js +1 -1
- package/src/og/quadTree/Wgs84QuadTreeStrategy.js +4 -4
- package/src/og/quadTree/index.js +2 -2
- package/src/og/renderer/Renderer.js +196 -77
- package/src/og/renderer/RendererEvents.js +35 -10
- package/src/og/scene/Axes.js +2 -2
- package/src/og/scene/Planet.js +47 -75
- package/src/og/scene/RenderNode.js +2 -13
- package/src/og/scene/SkyBox.js +1 -1
- package/src/og/scene/index.js +2 -2
- package/src/og/segment/Segment.js +5 -5
- package/src/og/segment/SegmentLonLatWgs84.js +2 -3
- package/src/og/shaders/drawnode.js +5 -1
- package/src/og/shaders/geoObject.js +2 -6
- package/src/og/shaders/pickingMask.js +31 -0
- package/src/og/shaders/polyline.js +212 -212
- package/src/og/terrain/BilTerrain.js +4 -4
- package/src/og/terrain/GlobusTerrain.js +7 -7
- package/src/og/terrain/MapboxTerrain.js +2 -2
- package/src/og/terrain/index.js +2 -2
- package/src/og/ui/Button.js +5 -4
- package/src/og/ui/Dialog.js +3 -6
- package/src/og/ui/Slider.js +29 -3
- package/src/og/ui/View.js +5 -5
- package/src/og/ui/icons.js +3 -0
- package/src/og/utils/FontAtlas.js +2 -2
- package/src/og/utils/GeoImageCreator.js +0 -1
- package/src/og/utils/NormalMapCreator.js +6 -5
- package/src/og/utils/TerrainWorker.js +1 -1
- package/src/og/utils/VectorTileCreator.js +4 -4
- package/src/og/utils/shared.js +1 -1
- package/src/og/webgl/Framebuffer.js +3 -1
- package/src/og/webgl/Handler.js +77 -62
- package/src/og/webgl/Multisample.js +18 -7
- package/src/og/webgl/Program.js +2 -2
- package/src/og/webgl/index.js +2 -2
- package/types/Popup.d.ts +8 -21
- package/types/camera/PlanetCamera.d.ts +1 -0
- package/types/control/Sun.d.ts +1 -0
- package/types/control/ruler/RulerScene.d.ts +4 -3
- package/types/entity/Entity.d.ts +2 -19
- package/types/entity/EntityCollection.d.ts +0 -7
- package/types/math/Vec2.d.ts +95 -95
- package/types/renderer/Renderer.d.ts +28 -16
- package/types/scene/Planet.d.ts +2 -7
- package/types/shaders/pickingMask.d.ts +2 -0
- package/types/ui/Slider.d.ts +3 -0
- package/types/ui/View.d.ts +1 -0
- package/types/ui/icons.d.ts +1 -0
- package/types/webgl/Framebuffer.d.ts +1 -0
- package/types/webgl/Handler.d.ts +3 -2
- package/src/og/entity/ShapeHandler.js +0 -99
- package/src/og/shaders/shape.js +0 -135
- package/src/og/shapes/BaseShape.js +0 -557
- package/src/og/shapes/Icosphere.js +0 -179
- package/src/og/shapes/Sphere.js +0 -100
- package/types/entity/ShapeHandler.d.ts +0 -22
- package/types/shaders/shape.d.ts +0 -4
- package/types/shapes/BaseShape.d.ts +0 -250
- package/types/shapes/Sphere.d.ts +0 -41
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const CLOSE_ICON = `<svg className="svg-icon" style="width: 1em; height: 1em;vertical-align: middle;fill: currentColor; overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M777.856 280.192l-33.92-33.952-231.872 231.872-231.84-231.872-33.984 33.888 231.872 231.904-231.84 231.84 33.888 33.984 231.904-231.904 231.84 231.872 33.952-33.888-231.872-231.904z"/>
|
|
3
|
+
</svg>`
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
'use strict';
|
|
6
6
|
|
|
7
|
+
import { Deferred } from '../Deferred.js';
|
|
7
8
|
import { Rectangle } from '../Rectangle.js';
|
|
8
9
|
import { TextureAtlas, TextureAtlasNode } from './TextureAtlas.js';
|
|
9
|
-
import { Deferred } from '../Deferred.js';
|
|
10
10
|
|
|
11
11
|
//TODO: get the value from shader module
|
|
12
12
|
const MAX_SIZE = 11;
|
|
@@ -219,4 +219,4 @@ class FontAtlas {
|
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
-
export { FontAtlas };
|
|
222
|
+
export { FontAtlas };
|
|
@@ -4,7 +4,6 @@ import { LonLat } from '../LonLat.js';
|
|
|
4
4
|
import * as utils from '../utils/shared.js';
|
|
5
5
|
import { Framebuffer } from '../webgl/Framebuffer.js';
|
|
6
6
|
import { Program } from '../webgl/Program.js';
|
|
7
|
-
import { types } from '../webgl/types.js';
|
|
8
7
|
|
|
9
8
|
export class GeoImageCreator {
|
|
10
9
|
|
|
@@ -4,12 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
"use strict";
|
|
6
6
|
|
|
7
|
+
import { Lock } from "../Lock.js";
|
|
7
8
|
import * as quadTree from "../quadTree/quadTree.js";
|
|
9
|
+
import { QueueArray } from "../QueueArray.js";
|
|
8
10
|
import { Framebuffer } from "../webgl/Framebuffer.js";
|
|
9
|
-
import { Lock } from "../Lock.js";
|
|
10
11
|
import { Program } from "../webgl/Program.js";
|
|
11
|
-
import { types } from "../webgl/types.js";
|
|
12
|
-
import { QueueArray } from "../QueueArray.js";
|
|
13
12
|
|
|
14
13
|
export class NormalMapCreator {
|
|
15
14
|
|
|
@@ -313,6 +312,7 @@ export class NormalMapCreator {
|
|
|
313
312
|
|
|
314
313
|
gl.disable(gl.CULL_FACE);
|
|
315
314
|
gl.disable(gl.DEPTH_TEST);
|
|
315
|
+
gl.disable(gl.BLEND);
|
|
316
316
|
|
|
317
317
|
if (segment.terrainReady && this._drawNormalMap(segment)) {
|
|
318
318
|
segment.normalMapReady = true;
|
|
@@ -323,9 +323,9 @@ export class NormalMapCreator {
|
|
|
323
323
|
}
|
|
324
324
|
segment._inTheQueue = false;
|
|
325
325
|
|
|
326
|
-
gl.disable(gl.BLEND);
|
|
327
326
|
gl.enable(gl.DEPTH_TEST);
|
|
328
327
|
gl.enable(gl.CULL_FACE);
|
|
328
|
+
gl.enable(gl.BLEND);
|
|
329
329
|
|
|
330
330
|
this._framebuffer.deactivate();
|
|
331
331
|
}
|
|
@@ -339,6 +339,7 @@ export class NormalMapCreator {
|
|
|
339
339
|
|
|
340
340
|
gl.disable(gl.CULL_FACE);
|
|
341
341
|
gl.disable(gl.DEPTH_TEST);
|
|
342
|
+
gl.disable(gl.BLEND);
|
|
342
343
|
|
|
343
344
|
var deltaTime = 0,
|
|
344
345
|
startTime = window.performance.now();
|
|
@@ -356,7 +357,7 @@ export class NormalMapCreator {
|
|
|
356
357
|
deltaTime = window.performance.now() - startTime;
|
|
357
358
|
}
|
|
358
359
|
|
|
359
|
-
gl.
|
|
360
|
+
gl.enable(gl.BLEND);
|
|
360
361
|
gl.enable(gl.DEPTH_TEST);
|
|
361
362
|
gl.enable(gl.CULL_FACE);
|
|
362
363
|
|
|
@@ -198,9 +198,10 @@ export class VectorTileCreator {
|
|
|
198
198
|
|
|
199
199
|
gl.disable(gl.CULL_FACE);
|
|
200
200
|
gl.disable(gl.DEPTH_TEST);
|
|
201
|
-
|
|
202
|
-
gl.
|
|
203
|
-
gl.
|
|
201
|
+
|
|
202
|
+
// gl.enable(gl.BLEND);
|
|
203
|
+
// gl.blendEquationSeparate(gl.FUNC_ADD, gl.FUNC_ADD);
|
|
204
|
+
// gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
|
|
204
205
|
|
|
205
206
|
var hLine = h.programs.vectorTileLineRasterization,
|
|
206
207
|
hPoly = h.programs.vectorTilePolygonRasterization;
|
|
@@ -396,7 +397,6 @@ export class VectorTileCreator {
|
|
|
396
397
|
// prevLayerId = material.layer._id;
|
|
397
398
|
}
|
|
398
399
|
|
|
399
|
-
gl.disable(gl.BLEND);
|
|
400
400
|
gl.enable(gl.DEPTH_TEST);
|
|
401
401
|
gl.enable(gl.CULL_FACE);
|
|
402
402
|
|
package/src/og/utils/shared.js
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
"use strict";
|
|
6
6
|
|
|
7
|
-
import { colorTable } from "./colorTable.js";
|
|
8
7
|
import { Extent } from "../Extent.js";
|
|
9
8
|
import { LonLat } from "../LonLat.js";
|
|
10
9
|
import { Vec2 } from "../math/Vec2.js";
|
|
11
10
|
import { Vec3 } from "../math/Vec3.js";
|
|
12
11
|
import { Vec4 } from "../math/Vec4.js";
|
|
12
|
+
import { colorTable } from "./colorTable.js";
|
|
13
13
|
|
|
14
14
|
export function getDefault(param, def) {
|
|
15
15
|
return param != undefined ? param : def;
|
|
@@ -77,6 +77,8 @@ export class Framebuffer {
|
|
|
77
77
|
|
|
78
78
|
this._depthComponent = options.depthComponent != undefined ? options.depthComponent : "DEPTH_COMPONENT16";
|
|
79
79
|
|
|
80
|
+
this._renderbufferTarget = options.renderbufferTarget != undefined ? options.renderbufferTarget : "DEPTH_ATTACHMENT";
|
|
81
|
+
|
|
80
82
|
this._useDepth = options.useDepth != undefined ? options.useDepth : true;
|
|
81
83
|
|
|
82
84
|
/**
|
|
@@ -170,7 +172,7 @@ export class Framebuffer {
|
|
|
170
172
|
this._depthRenderbuffer = gl.createRenderbuffer();
|
|
171
173
|
gl.bindRenderbuffer(gl.RENDERBUFFER, this._depthRenderbuffer);
|
|
172
174
|
gl.renderbufferStorage(gl.RENDERBUFFER, gl[this._depthComponent], this._width, this._height);
|
|
173
|
-
gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.
|
|
175
|
+
gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl[this._renderbufferTarget], gl.RENDERBUFFER, this._depthRenderbuffer);
|
|
174
176
|
gl.bindRenderbuffer(gl.RENDERBUFFER, null);
|
|
175
177
|
}
|
|
176
178
|
|
package/src/og/webgl/Handler.js
CHANGED
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
"use strict";
|
|
6
6
|
|
|
7
|
-
import { cons } from "../cons.js";
|
|
8
7
|
import { Clock } from "../Clock.js";
|
|
8
|
+
import { cons } from "../cons.js";
|
|
9
|
+
import { Events } from "../Events.js";
|
|
9
10
|
import { ImageCanvas } from "../ImageCanvas.js";
|
|
11
|
+
import { Vec2 } from "../math/Vec2.js";
|
|
12
|
+
import { Stack } from "../Stack.js";
|
|
10
13
|
import { isEmpty } from "../utils/shared.js";
|
|
11
14
|
import { ProgramController } from "./ProgramController.js";
|
|
12
|
-
import { Stack } from "../Stack.js";
|
|
13
|
-
import { Vec2 } from "../math/Vec2.js";
|
|
14
|
-
import { Events } from "../Events.js";
|
|
15
15
|
|
|
16
16
|
const vendorPrefixes = ["", "WEBKIT_", "MOZ_"];
|
|
17
17
|
|
|
@@ -99,6 +99,8 @@ class Handler {
|
|
|
99
99
|
this._params.extensions = this._params.extensions || [];
|
|
100
100
|
this._oneByHeight = 1.0 / (this._params.height * this._params.pixelRatio);
|
|
101
101
|
|
|
102
|
+
this._params.context.stencil = true;
|
|
103
|
+
|
|
102
104
|
/**
|
|
103
105
|
* Current WebGL extensions. Becomes here after context initialization.
|
|
104
106
|
* @public
|
|
@@ -145,8 +147,6 @@ class Handler {
|
|
|
145
147
|
if (params.autoActivate || isEmpty(params.autoActivate)) {
|
|
146
148
|
this.initialize();
|
|
147
149
|
}
|
|
148
|
-
|
|
149
|
-
this.createTexture_n = this.gl.type === "webgl2" ? this.createTexture_n_webgl2 : this.createTexture_n_webgl1;
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
/**
|
|
@@ -176,11 +176,18 @@ class Handler {
|
|
|
176
176
|
let ctx = null;
|
|
177
177
|
|
|
178
178
|
try {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
179
|
+
let urlParams = new URLSearchParams(location.search);
|
|
180
|
+
let ver = urlParams.get('og_ver');
|
|
181
|
+
if (ver) {
|
|
182
|
+
ctx = canvas.getContext(ver, contextAttributes);
|
|
183
|
+
ctx.type = ver;
|
|
184
|
+
} else {
|
|
185
|
+
for (let i = 0; i < CONTEXT_TYPE.length; i++) {
|
|
186
|
+
ctx = canvas.getContext(CONTEXT_TYPE[i], contextAttributes);
|
|
187
|
+
if (ctx) {
|
|
188
|
+
ctx.type = CONTEXT_TYPE[i];
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
184
191
|
}
|
|
185
192
|
}
|
|
186
193
|
} catch (ex) {
|
|
@@ -613,64 +620,72 @@ class Handler {
|
|
|
613
620
|
}
|
|
614
621
|
|
|
615
622
|
this.gl = Handler.getContext(this.canvas, this._params.context);
|
|
616
|
-
this._initialized = true;
|
|
617
|
-
|
|
618
|
-
/** Sets deafult extensions */
|
|
619
|
-
this._params.extensions.push("EXT_texture_filter_anisotropic");
|
|
620
|
-
|
|
621
|
-
if (this.gl.type === "webgl") {
|
|
622
|
-
this._params.extensions.push("OES_standard_derivatives");
|
|
623
|
-
this._params.extensions.push("OES_element_index_uint");
|
|
624
|
-
this._params.extensions.push("WEBGL_depth_texture");
|
|
625
|
-
this._params.extensions.push("ANGLE_instanced_arrays");
|
|
626
|
-
//this._params.extensions.push("WEBGL_draw_buffers");
|
|
627
|
-
//this._params.extensions.push("EXT_frag_depth");
|
|
628
|
-
} else {
|
|
629
|
-
this._params.extensions.push("EXT_color_buffer_float");
|
|
630
|
-
this._params.extensions.push("OES_texture_float_linear");
|
|
631
|
-
//this._params.extensions.push("WEBGL_draw_buffers");
|
|
632
|
-
}
|
|
633
623
|
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
this.initializeExtension(this._params.extensions[i], true);
|
|
637
|
-
}
|
|
624
|
+
if(this.gl) {
|
|
625
|
+
this._initialized = true;
|
|
638
626
|
|
|
639
|
-
|
|
640
|
-
this.
|
|
641
|
-
this.createTexture_l = this.createTexture_l_webgl1.bind(this);
|
|
642
|
-
this.createTexture_mm = this.createTexture_mm_webgl1.bind(this);
|
|
643
|
-
this.createTexture_a = this.createTexture_a_webgl1.bind(this);
|
|
644
|
-
} else {
|
|
645
|
-
this.createTexture_n = this.createTexture_n_webgl2.bind(this);
|
|
646
|
-
this.createTexture_l = this.createTexture_l_webgl2.bind(this);
|
|
647
|
-
this.createTexture_mm = this.createTexture_mm_webgl2.bind(this);
|
|
648
|
-
this.createTexture_a = this.createTexture_a_webgl2.bind(this);
|
|
649
|
-
}
|
|
627
|
+
/** Sets default extensions */
|
|
628
|
+
this._params.extensions.push("EXT_texture_filter_anisotropic");
|
|
650
629
|
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
630
|
+
if (this.gl.type === "webgl") {
|
|
631
|
+
this._params.extensions.push("OES_standard_derivatives");
|
|
632
|
+
this._params.extensions.push("OES_element_index_uint");
|
|
633
|
+
this._params.extensions.push("WEBGL_depth_texture");
|
|
634
|
+
this._params.extensions.push("ANGLE_instanced_arrays");
|
|
635
|
+
//this._params.extensions.push("WEBGL_draw_buffers");
|
|
636
|
+
//this._params.extensions.push("EXT_frag_depth");
|
|
637
|
+
} else {
|
|
638
|
+
this._params.extensions.push("EXT_color_buffer_float");
|
|
639
|
+
this._params.extensions.push("OES_texture_float_linear");
|
|
640
|
+
//this._params.extensions.push("WEBGL_draw_buffers");
|
|
641
|
+
}
|
|
655
642
|
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
643
|
+
let i = this._params.extensions.length;
|
|
644
|
+
while (i--) {
|
|
645
|
+
this.initializeExtension(this._params.extensions[i], true);
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
if (this.gl.type === "webgl") {
|
|
649
|
+
this.createTexture_n = this.createTexture_n_webgl1.bind(this);
|
|
650
|
+
this.createTexture_l = this.createTexture_l_webgl1.bind(this);
|
|
651
|
+
this.createTexture_mm = this.createTexture_mm_webgl1.bind(this);
|
|
652
|
+
this.createTexture_a = this.createTexture_a_webgl1.bind(this);
|
|
653
|
+
} else {
|
|
654
|
+
this.createTexture_n = this.createTexture_n_webgl2.bind(this);
|
|
655
|
+
this.createTexture_l = this.createTexture_l_webgl2.bind(this);
|
|
656
|
+
this.createTexture_mm = this.createTexture_mm_webgl2.bind(this);
|
|
657
|
+
this.createTexture_a = this.createTexture_a_webgl2.bind(this);
|
|
658
|
+
}
|
|
661
659
|
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
660
|
+
this.createTexture["NEAREST"] = this.createTexture_n;
|
|
661
|
+
this.createTexture["LINEAR"] = this.createTexture_l;
|
|
662
|
+
this.createTexture["MIPMAP"] = this.createTexture_mm;
|
|
663
|
+
this.createTexture["ANISOTROPIC"] = this.createTexture_a;
|
|
665
664
|
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
665
|
+
if (!this.extensions.EXT_texture_filter_anisotropic) {
|
|
666
|
+
this.createTextureDefault = this.createTexture_mm;
|
|
667
|
+
} else {
|
|
668
|
+
this.createTextureDefault = this.createTexture_a;
|
|
669
|
+
}
|
|
670
670
|
|
|
671
|
-
|
|
672
|
-
this.
|
|
673
|
-
|
|
671
|
+
/** Initilalize shaders and rendering parameters*/
|
|
672
|
+
this._initPrograms();
|
|
673
|
+
this._setDefaults();
|
|
674
|
+
|
|
675
|
+
this.intersectionObserver = new IntersectionObserver((entries) => {
|
|
676
|
+
this._toggleVisibilityChange(entries[0].isIntersecting === true);
|
|
677
|
+
}, { threshold: 0 });
|
|
678
|
+
this.intersectionObserver.observe(this.canvas);
|
|
679
|
+
|
|
680
|
+
this.resizeObserver = new ResizeObserver(entries => {
|
|
681
|
+
this._toggleVisibilityChange(entries[0].contentRect.width !== 0 && entries[0].contentRect.height !== 0);
|
|
682
|
+
});
|
|
683
|
+
this.resizeObserver.observe(this.canvas);
|
|
684
|
+
|
|
685
|
+
document.addEventListener("visibilitychange", () => {
|
|
686
|
+
this._toggleVisibilityChange(document.visibilityState === 'visible');
|
|
687
|
+
});
|
|
688
|
+
}
|
|
674
689
|
}
|
|
675
690
|
|
|
676
691
|
_toggleVisibilityChange(visibility) {
|
|
@@ -123,13 +123,24 @@ export class Multisample {
|
|
|
123
123
|
for (var i = 0; i < this.renderbuffers.length; i++) {
|
|
124
124
|
let rb = gl.createRenderbuffer();
|
|
125
125
|
gl.bindRenderbuffer(gl.RENDERBUFFER, rb);
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
126
|
+
|
|
127
|
+
if (this._msaa > 0) {
|
|
128
|
+
gl.renderbufferStorageMultisample(
|
|
129
|
+
gl.RENDERBUFFER,
|
|
130
|
+
this._msaa,
|
|
131
|
+
gl[this._internalFormat],
|
|
132
|
+
this._width,
|
|
133
|
+
this._height
|
|
134
|
+
);
|
|
135
|
+
} else {
|
|
136
|
+
gl.renderbufferStorage(
|
|
137
|
+
gl.RENDERBUFFER,
|
|
138
|
+
gl[this._internalFormat],
|
|
139
|
+
this._width,
|
|
140
|
+
this._height
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
|
|
133
144
|
gl.framebufferRenderbuffer(
|
|
134
145
|
gl.FRAMEBUFFER,
|
|
135
146
|
gl.COLOR_ATTACHMENT0 + i,
|
package/src/og/webgl/Program.js
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
"use strict";
|
|
6
6
|
|
|
7
|
-
import { callbacks } from "./callbacks.js";
|
|
8
7
|
import { cons } from "../cons.js";
|
|
9
|
-
import {
|
|
8
|
+
import { callbacks } from "./callbacks.js";
|
|
9
|
+
import { types, typeStr } from "./types.js";
|
|
10
10
|
|
|
11
11
|
const itemTypes = ["BYTE", "SHORT", "UNSIGNED_BYTE", "UNSIGNED_SHORT", "FLOAT", "HALF_FLOAT"];
|
|
12
12
|
|
package/src/og/webgl/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Framebuffer } from "./Framebuffer.js";
|
|
2
2
|
import { Handler } from "./Handler.js";
|
|
3
3
|
import { Multisample } from "./Multisample.js";
|
|
4
|
-
import { types } from "./types.js";
|
|
5
4
|
import { Program } from "./Program.js";
|
|
5
|
+
import { types } from "./types.js";
|
|
6
6
|
|
|
7
7
|
export {
|
|
8
8
|
Framebuffer,
|
|
@@ -10,4 +10,4 @@ export {
|
|
|
10
10
|
Multisample,
|
|
11
11
|
types,
|
|
12
12
|
Program
|
|
13
|
-
};
|
|
13
|
+
};
|
package/types/Popup.d.ts
CHANGED
|
@@ -1,42 +1,29 @@
|
|
|
1
|
-
export class Popup {
|
|
2
|
-
static set _staticCounter(arg: any);
|
|
3
|
-
static get _staticCounter(): any;
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
* @param {*} options
|
|
7
|
-
*/
|
|
8
|
-
constructor(options: any);
|
|
9
|
-
_id: number;
|
|
10
|
-
events: Events;
|
|
11
|
-
_template: string;
|
|
12
|
-
el: ChildNode;
|
|
13
|
-
_title: any;
|
|
1
|
+
export class Popup extends View {
|
|
14
2
|
_content: any;
|
|
15
|
-
|
|
16
|
-
|
|
3
|
+
$content: any;
|
|
4
|
+
$tip: any;
|
|
5
|
+
$title: any;
|
|
17
6
|
_planet: any;
|
|
18
7
|
_offset: any;
|
|
19
8
|
_lonLat: any;
|
|
20
9
|
_cartPos: Vec3;
|
|
21
10
|
_visibility: any;
|
|
22
|
-
_renderTemplate(): ChildNode;
|
|
23
11
|
_updatePosition(): void;
|
|
24
12
|
setScreen(p: any): void;
|
|
25
13
|
get clientWidth(): any;
|
|
26
14
|
get clientHeight(): any;
|
|
27
15
|
setOffset(x?: number, y?: number): Popup;
|
|
28
16
|
render(params: any): Popup;
|
|
29
|
-
_tipEl: any;
|
|
30
17
|
setVisibility(visibility: any): Popup;
|
|
31
18
|
getContainer(): any;
|
|
32
19
|
getToolbarContainer(): any;
|
|
33
20
|
show(): Popup;
|
|
34
21
|
hide(): Popup;
|
|
35
22
|
setCartesian3v(cart: any, height?: number): Popup;
|
|
36
|
-
setTitle(html: any):
|
|
37
|
-
setLonLat(lonLat: any):
|
|
38
|
-
setContent(content: any):
|
|
23
|
+
setTitle(html: any): void;
|
|
24
|
+
setLonLat(lonLat: any): void;
|
|
25
|
+
setContent(content: any): void;
|
|
39
26
|
clear(): void;
|
|
40
27
|
}
|
|
41
|
-
import {
|
|
28
|
+
import { View } from "./ui/View.js";
|
|
42
29
|
import { Vec3 } from "./math/Vec3.js";
|
package/types/control/Sun.d.ts
CHANGED
|
@@ -21,14 +21,16 @@ export class RulerScene extends RenderNode {
|
|
|
21
21
|
_onLclick_: any;
|
|
22
22
|
_onMouseMove_: any;
|
|
23
23
|
_onLdblclick_: any;
|
|
24
|
+
_onLUp_: any;
|
|
24
25
|
_onCornerEnter_: any;
|
|
25
26
|
_onCornerLeave_: any;
|
|
26
27
|
_onCornerLdown_: any;
|
|
27
28
|
_onCornerLup_: any;
|
|
28
29
|
_deactivate(): void;
|
|
29
30
|
_onCornerLdown(e: any): void;
|
|
30
|
-
_anchorLonLat: LonLat;
|
|
31
|
-
|
|
31
|
+
_anchorLonLat: import("../../LonLat.js").LonLat;
|
|
32
|
+
_onLUp(): void;
|
|
33
|
+
_onCornerLup(): void;
|
|
32
34
|
_onCornerEnter(e: any): void;
|
|
33
35
|
_onCornerLeave(e: any): void;
|
|
34
36
|
_onLdblclick(): void;
|
|
@@ -44,4 +46,3 @@ import { RenderNode } from "../../scene/RenderNode.js";
|
|
|
44
46
|
import { Vec2 } from "../../math/Vec2.js";
|
|
45
47
|
import { Entity } from "../../entity/Entity.js";
|
|
46
48
|
import { Vector } from "../../layer/Vector.js";
|
|
47
|
-
import { LonLat } from "../../LonLat.js";
|
package/types/entity/Entity.d.ts
CHANGED
|
@@ -5,14 +5,12 @@
|
|
|
5
5
|
* @class
|
|
6
6
|
* @param {Object} [options] - Entity options:
|
|
7
7
|
* @param {string} [options.name] - A human readable name to display to users. It does not have to be unique.
|
|
8
|
-
* @param {Vec3|Array.<number>} [options.cartesian] - Spatial entities like billboard, label
|
|
9
|
-
* @param {LonLat} [options.lonlat] - Geodetic coordiantes for an entities like billboard, label
|
|
8
|
+
* @param {Vec3|Array.<number>} [options.cartesian] - Spatial entities like billboard, label etc. cartesian position.
|
|
9
|
+
* @param {LonLat} [options.lonlat] - Geodetic coordiantes for an entities like billboard, label etc.
|
|
10
10
|
* @param {boolean} [options.aground] - True for entities that have to be placed on the relief.
|
|
11
11
|
* @param {boolean} [options.visibility] - Entity visibility.
|
|
12
12
|
* @param {*} [options.billboard] - Billboard options(see {@link og.Billboard}).
|
|
13
13
|
* @param {*} [options.label] - Label options(see {@link og.Label}).
|
|
14
|
-
* @param {*} [options.sphere] - Sphere options(see {@link og.shape.Sphere}).
|
|
15
|
-
* @param {*} [options.box] - Sphere options(see {@link og.shape.Box}).
|
|
16
14
|
* @param {*} [options.polyline] - Polyline options(see {@link og.Polyline}).
|
|
17
15
|
* @param {*} [options.ray] - Ray options(see {@link og.Ray}).
|
|
18
16
|
* @param {*} [options.pointCloud] - Point cloud options(see {@link og.PointCloud}).
|
|
@@ -110,7 +108,6 @@ export class Entity {
|
|
|
110
108
|
_featureConstructorArray: {
|
|
111
109
|
billboard: (typeof Billboard | ((billboard: Billboard) => Billboard))[];
|
|
112
110
|
label: (typeof Label | ((label: Label) => Label))[];
|
|
113
|
-
sphere: (typeof Sphere | ((shape: BaseShape) => Polyline))[];
|
|
114
111
|
polyline: (typeof Polyline | ((polyline: Polyline) => Polyline))[];
|
|
115
112
|
pointCloud: (typeof PointCloud | ((pointCloud: PointCloud) => PointCloud))[];
|
|
116
113
|
geometry: (typeof Geometry | ((geometry: Geometry) => Geometry))[];
|
|
@@ -130,12 +127,6 @@ export class Entity {
|
|
|
130
127
|
* @type {Label}
|
|
131
128
|
*/
|
|
132
129
|
public label: Label;
|
|
133
|
-
/**
|
|
134
|
-
* Shape entity.
|
|
135
|
-
* @public
|
|
136
|
-
* @type {shape.BaseShape}
|
|
137
|
-
*/
|
|
138
|
-
public shape: shape.BaseShape;
|
|
139
130
|
/**
|
|
140
131
|
* Polyline entity.
|
|
141
132
|
* @public
|
|
@@ -280,13 +271,6 @@ export class Entity {
|
|
|
280
271
|
* @returns {Ray} -
|
|
281
272
|
*/
|
|
282
273
|
public setRay(ray: Ray): Ray;
|
|
283
|
-
/**
|
|
284
|
-
* Sets entity shape.
|
|
285
|
-
* @public
|
|
286
|
-
* @param {BaseShape} shape - Shape object.
|
|
287
|
-
* @returns {Polyline} -
|
|
288
|
-
*/
|
|
289
|
-
public setShape(shape: BaseShape): Polyline;
|
|
290
274
|
/**
|
|
291
275
|
* Sets entity polyline.
|
|
292
276
|
* @public
|
|
@@ -346,7 +330,6 @@ import { Vec3 } from "../math/Vec3.js";
|
|
|
346
330
|
import { LonLat } from "../LonLat.js";
|
|
347
331
|
import { Billboard } from "./Billboard.js";
|
|
348
332
|
import { Label } from "./Label.js";
|
|
349
|
-
import { Sphere } from "../shapes/Sphere.js";
|
|
350
333
|
import { Polyline } from "./Polyline.js";
|
|
351
334
|
import { PointCloud } from "./PointCloud.js";
|
|
352
335
|
import { Geometry } from "./Geometry.js";
|
|
@@ -92,12 +92,6 @@ export class EntityCollection {
|
|
|
92
92
|
* @type {LabelHandler}
|
|
93
93
|
*/
|
|
94
94
|
public labelHandler: LabelHandler;
|
|
95
|
-
/**
|
|
96
|
-
* Shape handler
|
|
97
|
-
* @public
|
|
98
|
-
* @type {ShapeHandler}
|
|
99
|
-
*/
|
|
100
|
-
public shapeHandler: ShapeHandler;
|
|
101
95
|
/**
|
|
102
96
|
* Polyline handler
|
|
103
97
|
* @public
|
|
@@ -301,7 +295,6 @@ export class EntityCollection {
|
|
|
301
295
|
}
|
|
302
296
|
import { BillboardHandler } from "./BillboardHandler.js";
|
|
303
297
|
import { LabelHandler } from "./LabelHandler.js";
|
|
304
|
-
import { ShapeHandler } from "./ShapeHandler.js";
|
|
305
298
|
import { PolylineHandler } from "./PolylineHandler.js";
|
|
306
299
|
import { RayHandler } from "./RayHandler.js";
|
|
307
300
|
import { PointCloudHandler } from "./PointCloudHandler.js";
|