@openglobus/og 0.10.6 → 0.11.1
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 +10 -7
- package/src/og/Extent.js +1 -1
- package/src/og/LonLat.js +7 -2
- package/src/og/Popup.js +2 -1
- package/src/og/camera/PlanetCamera.js +4 -2
- package/src/og/entity/EntityCollection.js +1 -1
- package/src/og/entity/LabelHandler.js +366 -74
- package/src/og/entity/Polyline.js +3 -2
- package/src/og/layer/KML.js +7 -5
- package/src/og/layer/Vector.js +5 -0
- package/src/og/layer/index.js +2 -1
- package/src/og/math/Vec2.js +448 -448
- package/src/og/math/Vec3.js +759 -757
- package/src/og/math/Vec4.js +216 -215
- package/src/og/scene/Planet.js +14 -4
- package/src/og/segment/SegmentLonLat.js +7 -0
- package/src/og/terrain/GlobusTerrain.js +4 -0
- package/src/og/utils/GeoImageCreator.js +123 -121
- package/src/og/utils/Loader.js +81 -80
- package/src/og/utils/NormalMapCreator.js +320 -318
- package/src/og/utils/VectorTileCreator.js +251 -250
- package/src/og/webgl/Framebuffer.js +265 -264
- package/src/og/webgl/Handler.js +1022 -1022
- package/src/og/webgl/Multisample.js +169 -168
- package/src/og/webgl/ProgramController.js +113 -112
- package/types/Clock.d.ts +90 -0
- package/types/Deferred.d.ts +6 -0
- package/types/Events.d.ts +73 -0
- package/types/Extent.d.ts +162 -0
- package/types/Globe.d.ts +80 -0
- package/types/ImageCanvas.d.ts +121 -0
- package/types/Lock.d.ts +12 -0
- package/types/LonLat.d.ts +108 -0
- package/types/Popup.d.ts +38 -0
- package/types/QueueArray.d.ts +15 -0
- package/types/Rectangle.d.ts +74 -0
- package/types/Stack.d.ts +15 -0
- package/types/ajax.d.ts +24 -0
- package/types/arial.d.ts +48 -0
- package/types/astro/astro.d.ts +38 -0
- package/types/astro/earth.d.ts +6 -0
- package/types/astro/jd.d.ts +254 -0
- package/types/bv/Box.d.ts +25 -0
- package/types/bv/Sphere.d.ts +32 -0
- package/types/bv/index.d.ts +3 -0
- package/types/camera/Camera.d.ts +303 -0
- package/types/camera/Frustum.d.ts +129 -0
- package/types/camera/PlanetCamera.d.ts +222 -0
- package/types/camera/index.d.ts +3 -0
- package/types/cons.d.ts +40 -0
- package/types/control/CompassButton.d.ts +17 -0
- package/types/control/Control.d.ts +101 -0
- package/types/control/DebugInfo.d.ts +16 -0
- package/types/control/EarthCoordinates.d.ts +47 -0
- package/types/control/GeoImageDragControl.d.ts +6 -0
- package/types/control/KeyboardNavigation.d.ts +22 -0
- package/types/control/LayerSwitcher.d.ts +23 -0
- package/types/control/Lighting.d.ts +16 -0
- package/types/control/ScaleControl.d.ts +22 -0
- package/types/control/ShowFps.d.ts +12 -0
- package/types/control/SimpleNavigation.d.ts +28 -0
- package/types/control/Sun.d.ts +52 -0
- package/types/control/ToggleWireframe.d.ts +12 -0
- package/types/control/ZoomControl.d.ts +28 -0
- package/types/control/index.d.ts +15 -0
- package/types/ellipsoid/Ellipsoid.d.ts +142 -0
- package/types/ellipsoid/index.d.ts +3 -0
- package/types/ellipsoid/wgs84.d.ts +5 -0
- package/types/entity/BaseBillboard.d.ts +208 -0
- package/types/entity/Billboard.d.ts +94 -0
- package/types/entity/BillboardHandler.d.ts +74 -0
- package/types/entity/Entity.d.ts +330 -0
- package/types/entity/EntityCollection.d.ts +303 -0
- package/types/entity/Geometry.d.ts +72 -0
- package/types/entity/GeometryHandler.d.ts +76 -0
- package/types/entity/Label.d.ts +194 -0
- package/types/entity/LabelHandler.d.ts +24 -0
- package/types/entity/PointCloud.d.ts +174 -0
- package/types/entity/PointCloudHandler.d.ts +38 -0
- package/types/entity/Polyline.d.ts +303 -0
- package/types/entity/PolylineHandler.d.ts +18 -0
- package/types/entity/Ray.d.ts +123 -0
- package/types/entity/RayHandler.d.ts +67 -0
- package/types/entity/ShapeHandler.d.ts +22 -0
- package/types/entity/Strip.d.ts +118 -0
- package/types/entity/StripHandler.d.ts +38 -0
- package/types/entity/index.d.ts +8 -0
- package/types/index.core.d.ts +65 -0
- package/types/index.d.ts +45 -0
- package/types/index.webgl.d.ts +7 -0
- package/types/inherits.d.ts +4 -0
- package/types/input/input.d.ts +34 -0
- package/types/layer/BaseGeoImage.d.ts +106 -0
- package/types/layer/CanvasTiles.d.ts +75 -0
- package/types/layer/GeoImage.d.ts +65 -0
- package/types/layer/GeoTexture2d.d.ts +8 -0
- package/types/layer/GeoVideo.d.ts +80 -0
- package/types/layer/KML.d.ts +58 -0
- package/types/layer/WMS.d.ts +66 -0
- package/types/layer/XYZ.d.ts +126 -0
- package/types/layer/index.d.ts +10 -0
- package/types/light/LightSource.d.ts +177 -0
- package/types/math/Mat3.d.ts +53 -0
- package/types/math/Mat4.d.ts +157 -0
- package/types/math/Plane.d.ts +17 -0
- package/types/math/Vec2.d.ts +308 -0
- package/types/math/Vec3.d.ts +459 -0
- package/types/math/Vec4.d.ts +161 -0
- package/types/math/coder.d.ts +42 -0
- package/types/math/index.d.ts +11 -0
- package/types/math.d.ts +261 -0
- package/types/mercator.d.ts +92 -0
- package/types/proj/EPSG3857.d.ts +5 -0
- package/types/proj/EPSG4326.d.ts +5 -0
- package/types/quadTree/quadTree.d.ts +40 -0
- package/types/renderer/RendererEvents.d.ts +230 -0
- package/types/res/images.d.ts +3 -0
- package/types/scene/Axes.d.ts +11 -0
- package/types/scene/BaseNode.d.ts +60 -0
- package/types/scene/Planet.d.ts +572 -0
- package/types/scene/RenderNode.d.ts +143 -0
- package/types/scene/SkyBox.d.ts +10 -0
- package/types/scene/index.d.ts +4 -0
- package/types/segment/segmentHelper.d.ts +13 -0
- package/types/shaders/billboard.d.ts +3 -0
- package/types/shaders/depth.d.ts +2 -0
- package/types/shaders/drawnode.d.ts +7 -0
- package/types/shaders/label.d.ts +4 -0
- package/types/shaders/pointCloud.d.ts +2 -0
- package/types/shaders/polyline.d.ts +3 -0
- package/types/shaders/ray.d.ts +2 -0
- package/types/shaders/screenFrame.d.ts +2 -0
- package/types/shaders/shape.d.ts +4 -0
- package/types/shaders/skybox.d.ts +2 -0
- package/types/shaders/toneMapping.d.ts +2 -0
- package/types/shapes/BaseShape.d.ts +247 -0
- package/types/shapes/Sphere.d.ts +41 -0
- package/types/terrain/BilTerrain.d.ts +8 -0
- package/types/terrain/EmptyTerrain.d.ts +72 -0
- package/types/terrain/Geoid.d.ts +26 -0
- package/types/terrain/GlobusTerrain.d.ts +153 -0
- package/types/terrain/MapboxTerrain.d.ts +8 -0
- package/types/terrain/index.d.ts +5 -0
- package/types/utils/FontAtlas.d.ts +14 -0
- package/types/utils/GeoImageCreator.d.ts +29 -0
- package/types/utils/ImagesCacheManager.d.ts +10 -0
- package/types/utils/Loader.d.ts +25 -0
- package/types/utils/NormalMapCreator.d.ts +39 -0
- package/types/utils/PlainSegmentWorker.d.ts +10 -0
- package/types/utils/TerrainWorker.d.ts +9 -0
- package/types/utils/TextureAtlas.d.ts +111 -0
- package/types/utils/VectorTileCreator.d.ts +16 -0
- package/types/utils/colorTable.d.ts +143 -0
- package/types/utils/earcut.d.ts +6 -0
- package/types/utils/shared.d.ts +230 -0
- package/types/webgl/Framebuffer.d.ts +135 -0
- package/types/webgl/Handler.d.ts +372 -0
- package/types/webgl/Multisample.d.ts +89 -0
- package/types/webgl/Program.d.ts +155 -0
- package/types/webgl/ProgramController.d.ts +84 -0
- package/types/webgl/callbacks.d.ts +1 -0
- package/types/webgl/index.d.ts +6 -0
- package/types/webgl/types.d.ts +2 -0
package/package.json
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openglobus/og",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"description": "[OpenGlobus](http://www.openglobus.org/) is a javascript library designed to display interactive 3d maps and planets with map tiles, imagery and vector data, markers and 3d objects. It uses the WebGL technology, open source and completely free.",
|
|
5
5
|
"directories": {
|
|
6
6
|
"example": "./sandbox"
|
|
7
7
|
},
|
|
8
8
|
"main": "./src/og/index.js",
|
|
9
9
|
"style": "./css/og.css",
|
|
10
|
+
"types": "./types/index.d.ts",
|
|
10
11
|
"scripts": {
|
|
11
|
-
"api": "
|
|
12
|
+
"api": "jsdoc -t ./jsdoc -r ./src/ -c ./jsdoc/conf.json -d ./api",
|
|
12
13
|
"serve": "ws",
|
|
13
14
|
"build": "rollup -c",
|
|
14
15
|
"webgl": "rollup -c --environment entry:webgl",
|
|
15
16
|
"core": "rollup -c --environment entry:core",
|
|
16
|
-
"test": "jest --
|
|
17
|
+
"test": "jest --env=jsdom",
|
|
17
18
|
"lint": "eslint src/og",
|
|
19
|
+
"generate_types": "rm -rf types; tsc src/**/*.js --declaration --allowJs --emitDeclarationOnly --outDir types; exit 0",
|
|
18
20
|
"prepare": "husky install"
|
|
19
21
|
},
|
|
20
22
|
"repository": {
|
|
@@ -48,11 +50,10 @@
|
|
|
48
50
|
"eslint-plugin-import": "^2.22.1",
|
|
49
51
|
"eslint-plugin-node": "^11.1.0",
|
|
50
52
|
"eslint-plugin-promise": "^4.3.1",
|
|
51
|
-
"eslint-plugin-react": "^7.21.5",
|
|
52
53
|
"eslint-plugin-standard": "^4.1.0",
|
|
53
54
|
"husky": "^6.0.0",
|
|
54
55
|
"jaguarjs-jsdoc": "^1.1.0",
|
|
55
|
-
"jest": "^
|
|
56
|
+
"jest": "^27.2.3",
|
|
56
57
|
"jsdoc": "^3.6.7",
|
|
57
58
|
"lint-staged": "^11.0.0",
|
|
58
59
|
"local-web-server": "^5.1.1",
|
|
@@ -61,7 +62,8 @@
|
|
|
61
62
|
"prettier": "^2.3.0",
|
|
62
63
|
"rollup": "^1.32.1",
|
|
63
64
|
"rollup-plugin-postcss": "^4.0.0",
|
|
64
|
-
"rollup-plugin-terser": "^5.3.1"
|
|
65
|
+
"rollup-plugin-terser": "^5.3.1",
|
|
66
|
+
"typescript": "^4.4.3"
|
|
65
67
|
},
|
|
66
68
|
"lint-staged": {
|
|
67
69
|
"*.{js,ts}": [
|
|
@@ -70,7 +72,8 @@
|
|
|
70
72
|
},
|
|
71
73
|
"files": [
|
|
72
74
|
"src/**/*",
|
|
73
|
-
"css/**/*"
|
|
75
|
+
"css/**/*",
|
|
76
|
+
"types/**/*"
|
|
74
77
|
],
|
|
75
78
|
"keywords": [
|
|
76
79
|
"map",
|
package/src/og/Extent.js
CHANGED
|
@@ -48,7 +48,7 @@ export class Extent {
|
|
|
48
48
|
/**
|
|
49
49
|
* Creates extent instance from values in array.
|
|
50
50
|
* @static
|
|
51
|
-
* @param {Array.<number
|
|
51
|
+
* @param {Array.<number>} arr - South west and north east longitude and latidudes packed in array. (exactly 4 entries)
|
|
52
52
|
* @return {og.Extent} Extent object.
|
|
53
53
|
*/
|
|
54
54
|
static createFromArray(arr) {
|
package/src/og/LonLat.js
CHANGED
|
@@ -21,6 +21,11 @@ const INV_PI_BY_180_HALF_PI = INV_PI_BY_180 * HALF_PI;
|
|
|
21
21
|
*/
|
|
22
22
|
export class LonLat {
|
|
23
23
|
|
|
24
|
+
/**
|
|
25
|
+
* @param {number} [lon]
|
|
26
|
+
* @param {number} [lat]
|
|
27
|
+
* @param {number} [height]
|
|
28
|
+
*/
|
|
24
29
|
constructor(lon, lat, height) {
|
|
25
30
|
|
|
26
31
|
/**
|
|
@@ -52,7 +57,7 @@ export class LonLat {
|
|
|
52
57
|
/**
|
|
53
58
|
* Creates coordinates array.
|
|
54
59
|
* @static
|
|
55
|
-
* @param{Array.<Array<number
|
|
60
|
+
* @param{Array.<Array<number>>} arr - Coordinates array data. (exactly 3 entries)
|
|
56
61
|
* @return{Array.<og.LonLat>} the same coordinates array but each element is LonLat instance.
|
|
57
62
|
*/
|
|
58
63
|
static join(arr) {
|
|
@@ -67,7 +72,7 @@ export class LonLat {
|
|
|
67
72
|
/**
|
|
68
73
|
* Creates an object by coordinate array.
|
|
69
74
|
* @static
|
|
70
|
-
* @param {Array.<number
|
|
75
|
+
* @param {Array.<number>} arr - Coordiante array, where first is longitude, second is latitude and third is a height. (exactly 3 entries)
|
|
71
76
|
* @returns {og.LonLat} -
|
|
72
77
|
*/
|
|
73
78
|
static createFromArray(arr) {
|
package/src/og/Popup.js
CHANGED
|
@@ -72,7 +72,7 @@ class Popup {
|
|
|
72
72
|
|
|
73
73
|
setScreen(p) {
|
|
74
74
|
if (this._planet) {
|
|
75
|
-
this.el.style.transform = "translate(" + (p.x - this.clientWidth * 0.5) + "px, " + (p.y - this._planet.renderer.handler.canvas.height - this.clientHeight
|
|
75
|
+
this.el.style.transform = "translate(" + (p.x - this.clientWidth * 0.5) + "px, " + (p.y - this._planet.renderer.handler.canvas.height - this._tipEl.clientHeight) + "px)"
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
|
|
@@ -98,6 +98,7 @@ class Popup {
|
|
|
98
98
|
this.el = this._renderTemplate(params);
|
|
99
99
|
this._contentEl = this.el.querySelector(".og-popup-content");
|
|
100
100
|
this._titleEl = this.el.querySelector(".og-popup-title")
|
|
101
|
+
this._tipEl = this.el.querySelector(".og-popup-tip-container")
|
|
101
102
|
this.setOffset(this._offset[0], this._offset[1]);
|
|
102
103
|
this.setContent(this._content);
|
|
103
104
|
this.setTitle(this._title);
|
|
@@ -297,6 +297,7 @@ class PlanetCamera extends Camera {
|
|
|
297
297
|
* @param {Number} [ampl] - Altitude amplitude factor.
|
|
298
298
|
* @param {cameraCallback} [completeCallback] - Callback that calls after flying when flying is finished.
|
|
299
299
|
* @param {cameraCallback} [startCallback] - Callback that calls befor the flying begins.
|
|
300
|
+
* @param [frameCallback]
|
|
300
301
|
*/
|
|
301
302
|
flyExtent(extent, height, up, ampl, completeCallback, startCallback, frameCallback) {
|
|
302
303
|
this.flyCartesian(
|
|
@@ -361,6 +362,7 @@ class PlanetCamera extends Camera {
|
|
|
361
362
|
* @param {Number} [ampl=1.0] - Altitude amplitude factor.
|
|
362
363
|
* @param {cameraCallback} [completeCallback] - Callback that calls after flying when flying is finished.
|
|
363
364
|
* @param {cameraCallback} [startCallback] - Callback that calls befor the flying begins.
|
|
365
|
+
* @param [frameCallback]
|
|
364
366
|
*/
|
|
365
367
|
flyCartesian(cartesian, look, up, ampl = 1.0, completeCallback, startCallback, frameCallback) {
|
|
366
368
|
this.stopFlying();
|
|
@@ -551,9 +553,9 @@ class PlanetCamera extends Camera {
|
|
|
551
553
|
let slope = n.dot(eyeNorm);
|
|
552
554
|
|
|
553
555
|
if (minSlope) {
|
|
554
|
-
|
|
556
|
+
let dSlope = slope - this.slope;
|
|
555
557
|
|
|
556
|
-
|
|
558
|
+
if (slope < minSlope && dSlope < 0) return;
|
|
557
559
|
|
|
558
560
|
if (
|
|
559
561
|
(slope > 0.1 && v.dot(eyeNorm) > 0) ||
|
|
@@ -21,7 +21,7 @@ import { ShapeHandler } from './ShapeHandler.js';
|
|
|
21
21
|
* @param {Object} [options] - Entity options:
|
|
22
22
|
* @param {Array.<og.Entity>} [options.entities] - Entities array.
|
|
23
23
|
* @param {boolean} [options.visibility=true] - Entity visibility.
|
|
24
|
-
* @param {Array.<number
|
|
24
|
+
* @param {Array.<number>} [options.scaleByDistance] - Entity scale by distance parameters. (exactly 3 entries)
|
|
25
25
|
* First index - near distance to the entity, after entity becomes full scale.
|
|
26
26
|
* Second index - far distance to the entity, when entity becomes zero scale.
|
|
27
27
|
* Third index - far distance to the entity, when entity becomes invisible.
|