#698 fixed tests

This commit is contained in:
Zemledelec 2023-08-02 18:10:55 +04:00
parent ac9eff110d
commit c6b978b8cf
84 changed files with 348 additions and 260 deletions

View File

@ -5,5 +5,11 @@ module.exports = {
coverageProvider: "v8",
setupFiles: ["jest-canvas-mock"],
testEnvironment: "jsdom",
setupFilesAfterEnv: ["./tests/setupTests.js"]
setupFilesAfterEnv: ["./tests/setupTests.js"],
moduleFileExtensions: ["ts", "js"],
preset: 'ts-jest/presets/js-with-ts',
testRegex: [
"\\.test\\.js$",
"\\.test\\.ts$",
]
};

103
package-lock.json generated
View File

@ -15,7 +15,7 @@
"@babel/preset-env": "^7.21.5",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-terser": "^0.4.1",
"@types/jest": "^29.5.1",
"@types/jest": "^29.5.3",
"@typescript-eslint/eslint-plugin": "^6.2.1",
"@typescript-eslint/parser": "^6.2.1",
"clean-jsdoc-theme": "^4.2.7",
@ -30,6 +30,7 @@
"prettier": "^2.8.8",
"rollup": "^3.21.3",
"rollup-plugin-postcss": "^4.0.2",
"ts-jest": "^29.1.1",
"typescript": "^5.1.6"
}
},
@ -2880,9 +2881,9 @@
}
},
"node_modules/@types/jest": {
"version": "29.5.1",
"resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.1.tgz",
"integrity": "sha512-tEuVcHrpaixS36w7hpsfLBLpjtMRJUE09/MHXn923LOVojDwyC14cWcfc0rDs0VEfUyYmt/+iX1kxxp+gZMcaQ==",
"version": "29.5.3",
"resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.3.tgz",
"integrity": "sha512-1Nq7YrO/vJE/FYnqYyw0FS8LdrjExSgIiHyKg7xPpn+yi8Q4huZryKnkJatN1ZRH89Kw2v33/8ZMB7DuZeSLlA==",
"dev": true,
"dependencies": {
"expect": "^29.0.0",
@ -3760,6 +3761,18 @@
"node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
}
},
"node_modules/bs-logger": {
"version": "0.2.6",
"resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz",
"integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==",
"dev": true,
"dependencies": {
"fast-json-stable-stringify": "2.x"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/bser": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz",
@ -9055,6 +9068,12 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/make-error": {
"version": "1.3.6",
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
"integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
"dev": true
},
"node_modules/makeerror": {
"version": "1.0.12",
"resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz",
@ -11849,6 +11868,82 @@
"typescript": ">=4.2.0"
}
},
"node_modules/ts-jest": {
"version": "29.1.1",
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.1.tgz",
"integrity": "sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA==",
"dev": true,
"dependencies": {
"bs-logger": "0.x",
"fast-json-stable-stringify": "2.x",
"jest-util": "^29.0.0",
"json5": "^2.2.3",
"lodash.memoize": "4.x",
"make-error": "1.x",
"semver": "^7.5.3",
"yargs-parser": "^21.0.1"
},
"bin": {
"ts-jest": "cli.js"
},
"engines": {
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
},
"peerDependencies": {
"@babel/core": ">=7.0.0-beta.0 <8",
"@jest/types": "^29.0.0",
"babel-jest": "^29.0.0",
"jest": "^29.0.0",
"typescript": ">=4.3 <6"
},
"peerDependenciesMeta": {
"@babel/core": {
"optional": true
},
"@jest/types": {
"optional": true
},
"babel-jest": {
"optional": true
},
"esbuild": {
"optional": true
}
}
},
"node_modules/ts-jest/node_modules/lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"dev": true,
"dependencies": {
"yallist": "^4.0.0"
},
"engines": {
"node": ">=10"
}
},
"node_modules/ts-jest/node_modules/semver": {
"version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dev": true,
"dependencies": {
"lru-cache": "^6.0.0"
},
"bin": {
"semver": "bin/semver.js"
},
"engines": {
"node": ">=10"
}
},
"node_modules/ts-jest/node_modules/yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
"dev": true
},
"node_modules/tslib": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz",

View File

@ -42,7 +42,7 @@
"@babel/preset-env": "^7.21.5",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-terser": "^0.4.1",
"@types/jest": "^29.5.1",
"@types/jest": "^29.5.3",
"@typescript-eslint/eslint-plugin": "^6.2.1",
"@typescript-eslint/parser": "^6.2.1",
"clean-jsdoc-theme": "^4.2.7",
@ -57,6 +57,7 @@
"prettier": "^2.8.8",
"rollup": "^3.21.3",
"rollup-plugin-postcss": "^4.0.2",
"ts-jest": "^29.1.1",
"typescript": "^5.1.6"
},
"lint-staged": {

View File

@ -1,13 +1,10 @@
"use strict";
import * as math from "./math";
import * as mercator from "./mercator";
import {Ellipsoid} from "./ellipsoid/Ellipsoid";
import {LonLat} from "./LonLat";
//@ts-ignore
import * as math from "./math.js";
/**
* Represents geographical coordinates extent.
* @class
@ -26,7 +23,7 @@ export class Extent {
/**
* Creates extent instance from values in array.
* @static
* @param {Array.<number>} arr - South west and north east longitude and latidudes packed in array. (exactly 4 entries)
* @param {Array.<number>} arr - South west and north-east longitude and latitudes packed in array. (exactly 4 entries)
* @return {Extent} Extent object.
*/
static createFromArray(arr: [number, number, number, number]): Extent {
@ -76,7 +73,7 @@ export class Extent {
}
/**
* Creates extent by meractor grid tile coordinates.
* Creates extent by merсator grid tile coordinates.
* @static
* @param {number} x -
* @param {number} y -

View File

@ -1,9 +1,4 @@
// #StandWithUkraine
/**
* @module og/Globe
*/
"use strict";
import { CompassButton } from "./control/CompassButton.js";
@ -14,7 +9,6 @@ import { ScaleControl } from "./control/ScaleControl.js";
import { Sun } from "./control/Sun.js";
import { TouchNavigation } from "./control/TouchNavigation.js";
import { ZoomControl } from "./control/ZoomControl.js";
import { Vec3 } from "./math/Vec3.js";
import { Renderer } from "./renderer/Renderer.js";
import { Planet } from "./scene/Planet.js";
import { EmptyTerrain } from "./terrain/EmptyTerrain.js";

View File

@ -16,34 +16,37 @@ const INV_PI_BY_180_HALF_PI = INV_PI_BY_180 * HALF_PI;
* @param {number} [height] - Height over the surface.
*/
export class LonLat {
public lon: number = 0;
public lat: number = 0;
public height: number = 0;
constructor(lon: number = 0, lat: number = 0, height: number = 0) {
/**
* Longitude.
* @public
* @type {number}
*/
this.lon = lon;
public lon: number = 0;
/**
* Latitude.
* @public
* @type {number}
*/
this.lat = lat;
public lat: number = 0;
/**
* Height.
* @public
* @type {number}
*/
public height: number = 0;
constructor(lon: number = 0, lat: number = 0, height: number = 0) {
this.lon = lon;
this.lat = lat;
this.height = height;
}
/**
* Check zero coordinates
* @returns {boolean} -
*/
public isZero(): boolean {
return this.lon === 0.0 && this.lat === 0.0 && this.height === 0.0;
}

View File

@ -2,8 +2,8 @@
'use strict';
import { htmlColorToFloat32Array } from './utils/shared.js';
import { Vec3 } from './math/Vec3.js';
import { MAX, MIN } from './math.js';
import { Vec3 } from './math/Vec3';
import { MAX, MIN } from './math';
import { transformLeftToRightCoordinateSystem, objParser } from "./utils/objParser.js";
function getColor(color) {

View File

@ -1,6 +1,6 @@
"use strict";
import { Vec3 } from "./math/Vec3.js";
import { Vec3 } from "./math/Vec3";
import { createLonLat, stringTemplate } from "./utils/shared.js";
import { View } from './ui/View.js';
import { CLOSE_ICON } from './ui/icons.js';

View File

@ -1,8 +1,8 @@
"use strict";
import * as math from "../math.js";
import { Quat } from "../math/Quat.js";
import { Vec3 } from "../math/Vec3.js";
import * as math from "../math";
import { Quat } from "../math/Quat";
import { Vec3 } from "../math/Vec3";
import * as astro from "./astro.js";
import * as jd from "./jd.js";

View File

@ -1,7 +1,7 @@
"use strict";
import * as math from "../math.js";
import { Mat3 } from "../math/Mat3.js";
import * as math from "../math";
import { Mat3 } from "../math/Mat3";
export function getEccentricAnomaly(M, ecc) {
if (ecc == 0.0) {

View File

@ -1,8 +1,8 @@
"use strict";
import { PI_TWO } from "../math.js";
import { Mat3 } from "../math/Mat3.js";
import { Vec3 } from "../math/Vec3.js";
import { PI_TWO } from "../math";
import { Mat3 } from "../math/Mat3";
import { Vec3 } from "../math/Vec3";
export function getRotationMatrix(rightAscension, declination, res) {
let xAxis = new Vec3(),

View File

@ -1,6 +1,6 @@
"use strict";
import { Vec3 } from "../math/Vec3.js";
import { Vec3 } from "../math/Vec3";
/**
* Bounding box class.

View File

@ -1,6 +1,6 @@
"use strict";
import { Vec3 } from "../math/Vec3.js";
import { Vec3 } from "../math/Vec3";
/**
* Bounding sphere class.

View File

@ -1,12 +1,12 @@
"use strict";
import { Events } from "../Events.js";
import * as math from "../math.js";
import { Mat3 } from "../math/Mat3.js";
import { Mat4 } from "../math/Mat4.js";
import * as math from "../math";
import { Mat3 } from "../math/Mat3";
import { Mat4 } from "../math/Mat4";
import { Vec2 } from "../math/Vec2.js";
import { Vec3 } from "../math/Vec3.js";
import { Vec4 } from "../math/Vec4.js";
import { Vec3 } from "../math/Vec3";
import { Vec4 } from "../math/Vec4";
import { Frustum } from "./Frustum.js";
/**

View File

@ -1,6 +1,6 @@
"use strict";
import { Mat4 } from "../math/Mat4.js";
import { Mat4 } from "../math/Mat4";
function planeNormalize(plane) {
var t = 1.0 / Math.sqrt(plane[0] * plane[0] + plane[1] * plane[1] + plane[2] * plane[2]);

View File

@ -1,13 +1,13 @@
"use strict";
import { Key } from "../Lock.js";
import { LonLat } from "../LonLat.js";
import * as math from "../math.js";
import { Mat4 } from "../math/Mat4.js";
import { Quat } from "../math/Quat.js";
import { LonLat } from "../LonLat";
import * as math from "../math";
import { Mat4 } from "../math/Mat4";
import { Quat } from "../math/Quat";
import { Ray } from "../math/Ray.js";
import { Vec3 } from "../math/Vec3.js";
import * as mercator from "../mercator.js";
import { Vec3 } from "../math/Vec3";
import * as mercator from "../mercator";
import { Camera } from "./Camera.js";
import { Ellipsoid } from "../ellipsoid/index.js";

View File

@ -1,6 +1,6 @@
'use strict';
import { LonLat } from '../LonLat.js';
import { LonLat } from '../LonLat';
import { throttle } from '../utils/shared.js';
import * as units from '../utils/units.js';
import { heightMode } from '../utils/units.js';

View File

@ -1,10 +1,10 @@
"use strict";
import { Sphere } from "../bv/Sphere.js";
import { LonLat } from "../LonLat.js";
import { Quat } from "../math/Quat.js";
import { LonLat } from "../LonLat";
import { Quat } from "../math/Quat";
import { Ray } from "../math/Ray.js";
import { Vec3 } from "../math/Vec3.js";
import { Vec3 } from "../math/Vec3";
import { Control } from "./Control.js";
class Touch {

View File

@ -1,8 +1,8 @@
"use strict";
import { input } from "../input/input.js";
import * as math from "../math.js";
import { Vec3 } from "../math/Vec3.js";
import * as math from "../math";
import { Vec3 } from "../math/Vec3";
import { Control } from "./Control.js";
/**

View File

@ -3,12 +3,12 @@
import { Sphere } from "../bv/Sphere.js";
import { input } from "../input/input.js";
import { Key } from "../Lock.js";
import { LonLat } from "../LonLat.js";
import * as math from "../math.js";
import { Mat4 } from "../math/Mat4.js";
import { Quat } from "../math/Quat.js";
import { LonLat } from "../LonLat";
import * as math from "../math";
import { Mat4 } from "../math/Mat4";
import { Quat } from "../math/Quat";
import { Ray } from "../math/Ray.js";
import { Vec3 } from "../math/Vec3.js";
import { Vec3 } from "../math/Vec3";
import { Control } from "./Control.js";
/**

View File

@ -2,8 +2,8 @@
import { Sphere } from "../bv/Sphere.js";
import { Key } from "../Lock.js";
import { Quat } from "../math/Quat.js";
import { Vec3 } from "../math/Vec3.js";
import { Quat } from "../math/Quat";
import { Vec3 } from "../math/Vec3";
import { Control } from "./Control.js";
import { MouseNavigation } from "./MouseNavigation.js";

View File

@ -1,7 +1,7 @@
"use strict";
import { RADIANS } from "../math.js";
import { Vec3 } from "../math/Vec3.js";
import { RADIANS } from "../math";
import { Vec3 } from "../math/Vec3";
import { binarySearch, parseHTML } from "../utils/shared.js";
import { Control } from "./Control.js";

View File

@ -2,8 +2,8 @@
import { getSunPosition } from "../astro/earth.js";
import { LightSource } from "../light/LightSource.js";
import { Quat } from "../math/Quat.js";
import { Vec3 } from "../math/Vec3.js";
import { Quat } from "../math/Quat";
import { Vec3 } from "../math/Vec3";
import { Control } from "./Control.js";
/**

View File

@ -2,13 +2,13 @@
import { Sphere } from "../bv/Sphere.js";
import { Key } from "../Lock.js";
import { LonLat } from "../LonLat.js";
import { Quat } from "../math/Quat.js";
import { LonLat } from "../LonLat";
import { Quat } from "../math/Quat";
import { Ray } from "../math/Ray.js";
import { Vec3 } from "../math/Vec3.js";
import { Vec3 } from "../math/Vec3";
import { Control } from "./Control.js";
import { Vec2 } from "../math/index.js";
import { math } from "../index.js";
import { Vec2 } from "../math/Vec2.js";
import { math } from "../index";
class Touch {
constructor() {

View File

@ -7,8 +7,8 @@ import {
PolygonDrawingScene
} from "./PolygonDrawingScene.js";
import { Entity } from "../../entity/Entity.js";
import { Line3, Vec2, Vec3 } from "../../math/index.js";
import * as math from "../../math.js";
import { Line3, Vec2, Vec3 } from "../../math/index";
import * as math from "../../math";
import { GeometryType } from "../../entity/Geometry.js";
class LineStringDrawingScene extends PolygonDrawingScene {

View File

@ -1,15 +1,15 @@
'use strict';
import * as math from "../../math.js";
import * as math from "../../math";
import { Entity } from '../../entity/Entity.js';
import { Events } from '../../Events.js';
import { Vector } from '../../layer/Vector.js';
import { Vec2 } from '../../math/Vec2.js';
import { Object3d } from '../../Object3d.js';
import { RenderNode } from '../../scene/RenderNode.js';
import { Vec3 } from '../../math/Vec3.js';
import { Vec3 } from '../../math/Vec3';
import { Line3 } from '../../math/Line3.js';
import { LonLat } from '../../LonLat.js';
import { LonLat } from '../../LonLat';
import { Geometry, GeometryType } from "../../entity/Geometry.js";
const POINTER_OBJ3D = Object3d.createCylinder(1, 1, 2.0, 20, 1, true, false, 0, -0.5, 0);

View File

@ -1,6 +1,6 @@
'use strict';
import { Vec3 } from "../../math/Vec3.js";
import { Vec3 } from "../../math/Vec3";
import { Deferred } from "../../Deferred.js";
import { Events } from '../../Events.js';

View File

@ -1,6 +1,6 @@
'use strict';
import { Ellipsoid } from '../../ellipsoid/Ellipsoid.js';
import { Ellipsoid } from '../../ellipsoid/Ellipsoid';
import { Entity } from '../../entity/Entity.js';
import { Events } from '../../Events.js';
import { Vector } from '../../layer/Vector.js';

View File

@ -1,10 +1,10 @@
'use strict';
import { Ellipsoid } from '../../ellipsoid/Ellipsoid.js';
import { Ellipsoid } from '../../ellipsoid/Ellipsoid';
import { Entity } from '../../entity/Entity.js';
import { Events } from '../../Events.js';
import { Vector } from '../../layer/Vector.js';
import { LonLat } from '../../LonLat.js';
import { LonLat } from '../../LonLat';
import { Object3d } from '../../Object3d.js';
import { RenderNode } from '../../scene/RenderNode.js';

View File

@ -1,6 +1,6 @@
'use strict';
import * as math from '../../math.js';
import * as math from '../../math';
export function addSeconds(date, seconds) {
return new Date(+date + seconds * 1000);

View File

@ -2,12 +2,12 @@
import { Box } from "../../bv/Box.js";
import { Sphere } from "../../bv/Sphere.js";
import { Extent } from "../../Extent.js";
import { Extent } from "../../Extent";
import { Layer } from "../../layer/Layer.js";
import { LonLat } from "../../LonLat.js";
import { LonLat } from "../../LonLat";
import { Ray } from "../../math/Ray.js";
import { Vec3 } from "../../math/Vec3.js";
import * as mercator from "../../mercator.js";
import { Vec3 } from "../../math/Vec3";
import * as mercator from "../../mercator";
import { EPSG3857 } from "../../proj/EPSG3857.js";
import { E, N, NOTRENDERING, OPSIDE, S, W } from "../../quadTree/quadTree.js";
import * as segmentHelper from "../../segment/segmentHelper.js";

View File

@ -3,8 +3,7 @@
import {LonLat} from "../LonLat";
import {Quat} from "../math/Quat";
import {Vec3} from "../math/Vec3";
//@ts-ignore
import {DEGREES, EPS1, EPS12, EPS15, RADIANS, zeroTwoPI} from "../math.js";
import {DEGREES, EPS1, EPS12, EPS15, RADIANS, zeroTwoPI} from "../math";
export interface IInverseResult {
distance: number;

View File

@ -1,4 +1,4 @@
import { Ellipsoid } from './Ellipsoid.js';
import { wgs84 } from './wgs84.js';
import { Ellipsoid } from './Ellipsoid';
import { wgs84 } from './wgs84';
export { Ellipsoid, wgs84 };

View File

@ -1,6 +1,6 @@
"use strict";
import { Ellipsoid } from "./Ellipsoid.js";
import {Ellipsoid} from "./Ellipsoid";
/**
* WGS84 ellipsoid object.

View File

@ -1,6 +1,6 @@
"use strict";
import { Vec3 } from "../math/Vec3.js";
import { Vec3 } from "../math/Vec3";
import * as utils from "../utils/shared.js";
import { LOCK_FREE, LOCK_UPDATE } from "./LabelWorker.js";

View File

@ -1,9 +1,9 @@
"use strict";
import { Extent } from "../Extent.js";
import { LonLat } from "../LonLat.js";
import { Vec3 } from "../math/Vec3.js";
import * as mercator from "../mercator.js";
import { Extent } from "../Extent";
import { LonLat } from "../LonLat";
import { Vec3 } from "../math/Vec3";
import * as mercator from "../mercator";
import * as utils from "../utils/shared.js";
import { Billboard } from "./Billboard.js";
import { Geometry } from "./Geometry.js";

View File

@ -1,7 +1,7 @@
"use strict";
import { Events } from "../Events.js";
import * as math from "../math.js";
import * as math from "../math";
import { BillboardHandler } from "./BillboardHandler.js";
import { GeoObjectHandler } from "./GeoObjectHandler.js";
import { LabelHandler } from "./LabelHandler.js";

View File

@ -1,6 +1,6 @@
"use strict";
import { Quat, Vec3 } from "../math/index.js";
import { Quat, Vec3 } from "../math/index";
import { Planet } from "../scene/Planet.js";
import * as utils from "../utils/shared.js";

View File

@ -1,8 +1,8 @@
"use strict";
import { Extent } from "../Extent.js";
import { LonLat } from "../LonLat.js";
import { Vec4 } from "../math/Vec4.js";
import { Extent } from "../Extent";
import { LonLat } from "../LonLat";
import { Vec4 } from "../math/Vec4";
import * as utils from "../utils/shared.js";
const GeometryType = {

View File

@ -2,7 +2,7 @@
import { doubleToTwoFloatsV2 } from "../math/coder.js";
import { Vec2 } from "../math/Vec2.js";
import * as mercator from "../mercator.js";
import * as mercator from "../mercator";
import * as quadTree from "../quadTree/quadTree.js";
import { earcut, flatten } from "../utils/earcut.js";
import { GeometryType } from "./Geometry.js";

View File

@ -1,6 +1,6 @@
"use strict";
import { Vec4 } from "../math/Vec4.js";
import { Vec4 } from "../math/Vec4";
import * as utils from "../utils/shared.js";
import { BaseBillboard } from "./BaseBillboard.js";
import { LOCK_FREE, LOCK_UPDATE } from "./LabelWorker.js";

View File

@ -1,7 +1,7 @@
"use strict";
import { Vec3 } from "../math/Vec3.js";
import { Vec4 } from "../math/Vec4.js";
import { Vec3 } from "../math/Vec3";
import { Vec4 } from "../math/Vec4";
const COORDINATES_BUFFER = 0;
const COLOR_BUFFER = 1;

View File

@ -1,8 +1,8 @@
"use strict";
import { Extent } from "../Extent.js";
import { LonLat } from "../LonLat.js";
import { Vec3 } from "../math/Vec3.js";
import { Extent } from "../Extent";
import { LonLat } from "../LonLat";
import { Vec3 } from "../math/Vec3";
import {
cloneArray, htmlColorToFloat32Array,
htmlColorToRgba, makeArray, makeArrayTyped

View File

@ -1,6 +1,6 @@
"use strict";
import {Vec3} from "../math/Vec3.js";
import {Vec3} from "../math/Vec3";
import * as utils from "../utils/shared.js";
import {Entity} from "./Entity.js";

View File

@ -1,7 +1,7 @@
"use strict";
import { Line3 } from "../math/Line3.js";
import { Vec3 } from "../math/Vec3.js";
import { Vec3 } from "../math/Vec3";
import * as utils from "../utils/shared.js";
let _tempHigh = new Vec3(),

View File

@ -1,7 +1,7 @@
'use strict';
import * as jd from './astro/jd.js';
import * as math from './math.js';
import * as math from './math';
import * as mercator from './mercator';
import * as utils from './utils/shared.js';

View File

@ -1,8 +1,8 @@
"use strict";
import { Extent } from "../Extent.js";
import { LonLat } from "../LonLat.js";
import * as mercator from "../mercator.js";
import { Extent } from "../Extent";
import { LonLat } from "../LonLat";
import * as mercator from "../mercator";
import { Layer } from "./Layer.js";
import { doubleToTwoFloats2 } from "../math/coder.js";

View File

@ -1,6 +1,6 @@
"use strict";
import { nextHighestPowerOfTwo } from "../math.js";
import { nextHighestPowerOfTwo } from "../math";
import { BaseGeoImage } from "./BaseGeoImage.js";
import { isImageLoaded } from "../utils/shared.js";

View File

@ -1,6 +1,6 @@
'use strict';
import * as math from '../math.js';
import * as math from '../math';
import { BaseGeoImage } from './BaseGeoImage.js';
class GeoTexture2d extends BaseGeoImage {

View File

@ -2,8 +2,8 @@
import { Billboard } from "../entity/Billboard.js";
import { Entity } from "../entity/Entity.js";
import { Extent } from "../Extent.js";
import { LonLat } from "../LonLat.js";
import { Extent } from "../Extent";
import { LonLat } from "../LonLat";
import { Vector } from "./Vector.js";
/**

View File

@ -1,10 +1,10 @@
"use strict";
import { Events } from "../Events.js";
import { Extent } from "../Extent.js";
import { LonLat } from "../LonLat.js";
import { Vec3 } from "../math/Vec3.js";
import * as mercator from "../mercator.js";
import { Extent } from "../Extent";
import { LonLat } from "../LonLat";
import { Vec3 } from "../math/Vec3";
import * as mercator from "../mercator";
import * as utils from "../utils/shared.js";
import { createColorRGB } from "../utils/shared.js";
import { Material } from "./Material.js";

View File

@ -1,12 +1,12 @@
"use strict";
import * as mercator from "../mercator";
import { Entity } from "../entity/Entity.js";
import { EntityCollection } from "../entity/EntityCollection.js";
import { GeometryHandler } from "../entity/GeometryHandler.js";
import { Extent } from "../Extent.js";
import * as math from "../math.js";
import { Vec3 } from "../math/Vec3.js";
import * as mercator from "../mercator.js";
import { Extent } from "../Extent";
import * as math from "../math";
import { Vec3 } from "../math/Vec3";
import {
EntityCollectionNode,
EntityCollectionNodeWGS84

View File

@ -1,8 +1,8 @@
"use strict";
import { Extent } from "../Extent.js";
import { LonLat } from "../LonLat.js";
import * as mercator from "../mercator.js";
import * as mercator from "../mercator";
import { Extent } from "../Extent";
import { LonLat } from "../LonLat";
import { XYZ } from "./XYZ.js";
/**

View File

@ -1,6 +1,6 @@
"use strict";
import * as mercator from "../mercator.js";
import * as mercator from "../mercator";
import { RENDERING } from "../quadTree/quadTree.js";
import { stringTemplate } from "../utils/shared.js";
import { Layer } from "./Layer.js";

View File

@ -1,6 +1,6 @@
"use strict";
import { Vec3 } from "../math/Vec3.js";
import { Vec3 } from "../math/Vec3";
/**
* Represents basic light source.

View File

@ -1,9 +1,7 @@
/**
* @module og/math
*/
"use strict";
import {Vec3} from "./math/Vec3";
/** @const */
export const TWO_PI = 2.0 * Math.PI;
@ -81,7 +79,7 @@ export const EPS20 = 1e-20;
* log(64, 2)
* //returns 6
*/
export function log(n, base) {
export function log(n: number, base: number): number {
return Math.log(n) / Math.log(base);
}
@ -96,7 +94,7 @@ export function log(n, base) {
* clamp(12, 1, 5)
* //returns 5
*/
export function clamp(number, min, max) {
export function clamp(number: number, min: number, max: number): number {
return Math.max(min, Math.min(number, max));
}
@ -106,7 +104,7 @@ export function clamp(number, min, max) {
* @param {number} degrees - Degree value.
* @returns {number} -
*/
export function DEG2RAD(degrees) {
export function DEG2RAD(degrees: number): number {
return degrees * RADIANS;
}
@ -116,7 +114,7 @@ export function DEG2RAD(degrees) {
* @param {number} angle - Degree value.
* @returns {number} -
*/
export function RAD2DEG(angle) {
export function RAD2DEG(angle: number): number {
return angle * DEGREES;
}
@ -126,7 +124,7 @@ export function RAD2DEG(angle) {
* @param {number} x - Input value.
* @returns {boolean} -
*/
export function isPowerOfTwo(x) {
export function isPowerOfTwo(x: number): boolean {
return (x & (x - 1)) === 0;
}
@ -134,9 +132,10 @@ export function isPowerOfTwo(x) {
* Returns next value that is power of two.
* @function
* @param {number} x - Input value.
* @param {number} [maxValue=4096] - Maximal value.
* @returns {number} -
*/
export function nextHighestPowerOfTwo(x, maxValue = 4096) {
export function nextHighestPowerOfTwo(x: number, maxValue: number = 4096): number {
--x;
for (let i = 1; i < 32; i <<= 1) {
x = x | (x >> i);
@ -151,7 +150,7 @@ export function nextHighestPowerOfTwo(x, maxValue = 4096) {
* @param {number} max - Maximal bound.
* @returns {number} -
*/
export function randomi(min = 0, max = 1) {
export function randomi(min: number = 0, max: number = 1): number {
return Math.floor(Math.random() * (max - min)) + min;
}
@ -162,7 +161,7 @@ export function randomi(min = 0, max = 1) {
* @param {number} [max=1] - Maximal bound.
* @returns {number} -
*/
export function random(min = 0, max = 1) {
export function random(min: number = 0, max: number = 1): number {
return Math.random() * (max - min) + min;
}
@ -175,7 +174,7 @@ export function random(min = 0, max = 1) {
* @param {boolean} [p] - Positive flag. False - default.
* @returns {number} -
**/
export function degToDec(d, m, s, p) {
export function degToDec(d: number, m: number, s: number, p: number): number {
if (p) {
return d + m / 60.0 + s / 3600.0;
} else {
@ -190,7 +189,7 @@ export function degToDec(d, m, s, p) {
* @param {number} n - The divisor.
* @returns {number} The remainder.
*/
export function mod(m, n) {
export function mod(m: number, n: number): number {
return ((m % n) + n) % n;
}
@ -200,7 +199,7 @@ export function mod(m, n) {
* @param {number} a - Angle in radians
* @returns {number} -
*/
export function zeroTwoPI(a) {
export function zeroTwoPI(a: number): number {
const res = mod(a, TWO_PI);
if (Math.abs(res) < EPS14 && Math.abs(a) > EPS14) {
return TWO_PI;
@ -215,17 +214,17 @@ export function zeroTwoPI(a) {
* @param {number} x - Value to edge.
* @returns {number} -
*/
export function step(edge, x) {
export function step(edge: number, x: number): number {
return x < edge ? 0.0 : 1.0;
}
/**
* The fract function returns the fractional part of x, i.e. x minus floor(x).
* The frac function returns the fractional part of x, i.e. x minus floor(x).
* @function
* @param {number} x - Input value.
* @returns {number} -
*/
export function frac(x) {
export function frac(x: number): number {
const mx = Math.abs(x)
return mx - Math.floor(mx);
}
@ -236,7 +235,7 @@ export function frac(x) {
* @param {number} x - Input value.
* @returns {number} -
*/
export function log2(x) {
export function log2(x: number): number {
return Math.log(x) / LOG2;
}
@ -246,7 +245,7 @@ export function log2(x) {
* @param {number} n - Power value.
* @returns {number} -
*/
export function exp2(n) {
export function exp2(n: number): number {
return Math.pow(2, n);
}
@ -256,7 +255,7 @@ export function exp2(n) {
* @param {number} n - Integer power value.
* @returns {number} -
*/
export function pow2i(n) {
export function pow2i(n: number): number {
return 2 << (n - 1);
}
@ -267,7 +266,7 @@ export function pow2i(n) {
* @param {number} h0 - Start value.
* @returns {number} -
*/
export function slice(t, h1, h0) {
export function slice(t: number, h1: number, h0: number): number {
return t * (h1 - h0);
}
@ -279,19 +278,19 @@ export function slice(t, h1, h0) {
* @param {number} h0 - Start value.
* @returns {number} -
*/
export function lerp(t, h1, h0) {
export function lerp(t: number, h1: number, h0: number): number {
return h0 + t * (h1 - h0);
}
export function cube(f) {
export function cube(f: number): number {
return f * f * f;
}
export function square(f) {
export function square(f: number): number {
return f * f;
}
export function bezier1v(t, p0, p1, p2, p3) {
export function bezier1v(t: number, p0: number, p1: number, p2: number, p3: number): number {
return (
cube(1 - t) * p0 + 3 * square(1 - t) * t * p1 + 3 * (1 - t) * square(t) * p2 + cube(t) * p3
);
@ -307,15 +306,15 @@ export function bezier1v(t, p0, p1, p2, p3) {
* @param {Vec3} p3 - Fourth control point.
* @returns {Vec3} -
*/
export function bezier3v(t, p0, p1, p2, p3) {
var u = 1 - t;
var tt = t * t;
var uu = u * u;
var uuu = uu * u;
var ttt = tt * t;
export function bezier3v(t: number, p0: Vec3, p1: Vec3, p2: Vec3, p3: Vec3): Vec3 {
return p0
.scaleTo(uuu)
let u = 1 - t;
let tt = t * t;
let uu = u * u;
let uuu = uu * u;
let ttt = tt * t;
return p0.scaleTo(uuu)
.addA(p1.scaleTo(3 * uu * t))
.addA(p2.scaleTo(3 * u * tt))
.addA(p3.scaleTo(ttt));
@ -327,7 +326,7 @@ export function bezier3v(t, p0, p1, p2, p3) {
* @param {number} x - Input angle.
* @returns {number} -
*/
export function rev(x) {
export function rev(x: number): number {
return x - Math.floor(x / 360.0) * 360.0;
}
@ -337,7 +336,7 @@ export function rev(x) {
* @param {number} lon - Longitude.
* @returns {number} -
*/
export function norm_lon(lon) {
export function norm_lon(lon: number): number {
return lon > 180 ? ((lon + 180) % 360) - 180 : lon < -180 ? ((lon - 180) % 360) + 180 : lon;
}
@ -347,21 +346,21 @@ export function norm_lon(lon) {
* @param {number} a - Angle in radians.
* @returns {number} -
*/
export function negativePItoPI(a) {
export function negativePItoPI(a: number): number {
return zeroTwoPI(a + Math.PI) - Math.PI;
}
/**
* Solve using iteration method and a fixed number of steps.
* @function
* @param {equationCallback} f - Equation. Used in Euler's equation(see og.orbit) solving.
* @param {Function} f - Equation. Used in Euler's equation(see og.orbit) solving.
* @param {number} x0 - First approximation.
* @param {number} maxIter - Maximum iterations.
* @returns {number} -
*/
export function solve_iteration_fixed(f, x0, maxIter) {
var x = 0;
var x2 = x0;
export function solve_iteration_fixed(f: Function, x0: number, maxIter: number): number {
let x = 0;
let x2 = x0;
for (let i = 0; i < maxIter; i++) {
x = x2;
x2 = f(x);
@ -373,15 +372,15 @@ export function solve_iteration_fixed(f, x0, maxIter) {
* Solve using iteration; terminate when error is below err or the maximum
* number of iterations is reached. Used in Euler's equation(see og.orbit) solving.
* @function
* @param {equationCallback} f - Equation.
* @param {Function} f - Equation.
* @param {number} x0 - First approximation.
* @param {number} err - Maximal accepted error value.
* @param {number} maxIter - Maximum iterations.
* @returns {number} -
*/
export function solve_iteration(f, x0, err, maxIter = 50) {
var x = 0;
var x2 = x0;
export function solve_iteration(f: Function, x0: number, err: number, maxIter: number = 50): number {
let x = 0;
let x2 = x0;
for (let i = 0; i < maxIter; i++) {
x = x2;
x2 = f(x);
@ -404,7 +403,7 @@ export function solve_iteration(f, x0, err, maxIter = 50) {
* @param b - Second bearing angle
* @returns {number}
*/
function getAngleDirection(a, b) {
function getAngleDirection(a: number, b: number): number {
let a_y = Math.cos(a),
a_x = Math.sin(a),
b_y = Math.cos(b),
@ -423,7 +422,7 @@ function getAngleDirection(a, b) {
* @param {number} b - Second azimuth angle
* @returns {number}
*/
export function getAngleBetweenAzimuths(a, b) {
export function getAngleBetweenAzimuths(a: number, b: number): number {
a = zeroTwoPI(a);
b = zeroTwoPI(b);
return ((((a - b) % 360) + 360 + 180) % 360) - 180;

View File

@ -1,7 +1,7 @@
'use strict';
import { EPS10 } from '../math.js';
import { Vec3 } from './Vec3.js';
import { EPS10 } from '../math';
import { Vec3 } from './Vec3';
export class Line3 {
constructor(p0, p1) {

View File

@ -1,7 +1,7 @@
"use strict";
import { EPS5 } from "../math.js";
import { Vec3 } from "./Vec3.js";
import { EPS5 } from "../math";
import { Vec3 } from "./Vec3";
/**
* Plane class.

View File

@ -1,13 +1,10 @@
"use strict";
import * as math from "../math";
import {Vec3} from "./Vec3";
import {Mat4} from "./Mat4";
import {Mat3} from "./Mat3";
//@ts-ignore
import * as math from "../math.js";
/**
* A set of 4-dimensional coordinates used to represent rotation in 3-dimensional space.
* @constructor

View File

@ -1,7 +1,7 @@
"use strict";
import { EPS10 } from "../math.js";
import { Vec3 } from "./Vec3.js";
import { EPS10 } from "../math";
import { Vec3 } from "./Vec3";
/**
* Represents a ray that extends infinitely from the provided origin in the provided direction.

View File

@ -1,6 +1,6 @@
"use strict";
import { Vec3 } from "./Vec3.js";
import { Vec3 } from "./Vec3";
/**
* Class represents a 3d vector.

View File

@ -1,10 +1,8 @@
"use strict";
import {frac} from "../math";
import {Vec3} from "./Vec3";
//@ts-ignore
import {frac} from "../math.js";
/**
* Class represents a 4d vector.
* @class

View File

@ -4,8 +4,8 @@
"use strict";
import * as math from "../math.js";
import { Vec4 } from "./Vec4.js";
import * as math from "../math";
import { Vec4 } from "./Vec4";
/**
* Encode 32 bit float value to the RGBA vector.

View File

@ -1,13 +1,13 @@
import { Line2 } from './Line2.js';
import { Line3 } from './Line3.js';
import { Mat3 } from './Mat3.js';
import { Mat4 } from './Mat4.js';
import { Mat3 } from './Mat3';
import { Mat4 } from './Mat4';
import { Plane } from './Plane.js';
import { Quat } from './Quat.js';
import { Quat } from './Quat';
import { Ray } from './Ray.js';
import { Vec2 } from './Vec2.js';
import { Vec3 } from './Vec3.js';
import { Vec4 } from './Vec4.js';
import { Vec3 } from './Vec3';
import { Vec4 } from './Vec4';
export {
Line2,

View File

@ -1,6 +1,6 @@
"use strict";
import { Extent } from "../Extent.js";
import { Extent } from "../Extent";
import { EPSG4326 } from "../proj/EPSG4326.js";
import { Node } from "../quadTree/Node.js";
import * as quadTree from "../quadTree/quadTree.js";

View File

@ -1,7 +1,7 @@
"use strict";
import { Extent } from "../Extent.js";
import * as mercator from "../mercator.js";
import * as mercator from "../mercator";
import { Extent } from "../Extent";
import { Node } from "../quadTree/Node.js";
import * as quadTree from "../quadTree/quadTree.js";
import { Segment } from "../segment/Segment.js";

View File

@ -2,10 +2,10 @@
import { Sphere } from '../bv/Sphere.js';
import { EntityCollection } from '../entity/EntityCollection.js';
import { Extent } from '../Extent.js';
import { LonLat } from '../LonLat.js';
import { Vec3 } from '../math/Vec3.js';
import * as mercator from '../mercator.js';
import { Extent } from '../Extent';
import { LonLat } from '../LonLat';
import { Vec3 } from '../math/Vec3';
import * as mercator from '../mercator';
import * as quadTree from './quadTree.js';
class EntityCollectionNode {

View File

@ -1,6 +1,6 @@
"use strict";
import { Extent } from "../Extent.js";
import { Extent } from "../Extent";
import { EPSG4326 } from "../proj/EPSG4326.js";
import { Node } from "../quadTree/Node.js";
import * as quadTree from "../quadTree/quadTree.js";

View File

@ -1,10 +1,10 @@
"use strict";
import { Extent } from "../Extent.js";
import { LonLat } from "../LonLat.js";
import { MAX, MIN } from "../math.js";
import { Vec3 } from "../math/Vec3.js";
import { MAX_LAT } from "../mercator.js";
import { Extent } from "../Extent";
import { LonLat } from "../LonLat";
import { MAX, MIN } from "../math";
import { Vec3 } from "../math/Vec3";
import { MAX_LAT } from "../mercator";
import { EPSG3857 } from "../proj/EPSG3857.js";
import { EPSG4326 } from "../proj/EPSG4326.js";
import { getMatrixSubArray, getMatrixSubArrayBoundsExt } from "../utils/shared.js";

View File

@ -1,6 +1,6 @@
"use strict";
import { Extent } from "../Extent.js";
import { Extent } from "../Extent";
import { EPSG4326 } from "../proj/EPSG4326.js";
import { Node } from "../quadTree/Node.js";
import * as quadTree from "../quadTree/quadTree.js";

View File

@ -6,9 +6,9 @@ import { cons } from "../cons.js";
import { depth } from "../shaders/depth.js";
import { LabelWorker } from "../entity/LabelWorker.js";
import { input } from "../input/input.js";
import { randomi } from "../math.js";
import { randomi } from "../math";
import { Vec2 } from "../math/Vec2.js";
import { Vec3 } from "../math/Vec3.js";
import { Vec3 } from "../math/Vec3";
import { pickingMask } from "../shaders/pickingMask.js";
import { screenFrame } from "../shaders/screenFrame.js";
import { toneMapping } from "../shaders/toneMapping.js";

View File

@ -6,7 +6,7 @@ import { KeyboardHandler } from "../input/KeyboardHandler.js";
import { MouseHandler } from "../input/MouseHandler.js";
import { TouchHandler } from "../input/TouchHandler.js";
import { Vec2 } from "../math/Vec2.js";
import { Vec3 } from "../math/Vec3.js";
import { Vec3 } from "../math/Vec3";
const LB_M = 0b0001;
const RB_M = 0b0010;

View File

@ -3,14 +3,14 @@
import { PlanetCamera } from "../camera/PlanetCamera.js";
import { Atmosphere } from "../control/Atmosphere.js";
import { SimpleSkyBackground } from "../control/SimpleSkyBackground.js";
import { wgs84 } from "../ellipsoid/wgs84.js";
import { Extent } from "../Extent.js";
import { wgs84 } from "../ellipsoid/wgs84";
import { Extent } from "../Extent";
import { Vector } from "../layer/Vector.js";
import { Key, Lock } from "../Lock.js";
import { LonLat } from "../LonLat.js";
import * as math from "../math.js";
import { LonLat } from "../LonLat";
import * as math from "../math";
import { decodeFloatFromRGBAArr } from "../math/coder.js";
import { Quat, Vec3, Vec4 } from "../math/index.js";
import { Quat, Vec3, Vec4 } from "../math/index";
import { EarthQuadTreeStrategy } from "../quadTree/EarthQuadTreeStrategy.js";
import { NIGHT, SPECULAR } from "../res/images.js";
import * as segmentHelper from "../segment/segmentHelper.js";

View File

@ -2,12 +2,12 @@
import { Box } from "../bv/Box.js";
import { Sphere } from "../bv/Sphere.js";
import { Extent } from "../Extent.js";
import { Extent } from "../Extent";
import { Layer } from "../layer/Layer.js";
import { LonLat } from "../LonLat.js";
import { LonLat } from "../LonLat";
import { Ray } from "../math/Ray.js";
import { Vec3 } from "../math/Vec3.js";
import * as mercator from "../mercator.js";
import { Vec3 } from "../math/Vec3";
import * as mercator from "../mercator";
import { EPSG3857 } from "../proj/EPSG3857.js";
import { E, N, NOTRENDERING, OPSIDE, S, W } from "../quadTree/quadTree.js";
import * as segmentHelper from "../segment/segmentHelper.js";

View File

@ -1,10 +1,10 @@
"use strict";
import { Extent } from "../Extent.js";
import { Extent } from "../Extent";
import { Layer } from "../layer/Layer.js";
import { LonLat } from "../LonLat.js";
import { Vec3 } from "../math/Vec3.js";
import * as mercator from "../mercator.js";
import { LonLat } from "../LonLat";
import { Vec3 } from "../math/Vec3";
import * as mercator from "../mercator";
import { EPSG4326 } from "../proj/EPSG4326.js";
import * as quadTree from "../quadTree/quadTree.js";
import { Segment, TILEGROUP_NORTH, TILEGROUP_SOUTH } from "./Segment.js";

View File

@ -2,8 +2,8 @@
import { Layer } from "../layer/Layer.js";
import { WMS } from "../layer/WMS.js";
import { isPowerOfTwo, nextHighestPowerOfTwo } from "../math.js";
import { getTileExtent } from "../mercator.js";
import { isPowerOfTwo, nextHighestPowerOfTwo } from "../math";
import { getTileExtent } from "../mercator";
import { GlobusTerrain } from "./GlobusTerrain.js";
class BilTerrain extends GlobusTerrain {

View File

@ -4,17 +4,17 @@
"use strict";
import { Events } from "../Events.js";
import * as mercator from "../mercator.js";
import * as mercator from "../mercator";
import { EPSG3857 } from "../proj/EPSG3857.js";
import { NOTRENDERING } from "../quadTree/quadTree.js";
import { Loader } from "../utils/Loader.js";
import { EmptyTerrain } from "./EmptyTerrain.js";
// import { QueueArray } from '../QueueArray.js';
import { Extent } from "../Extent.js";
import { Extent } from "../Extent";
import { Layer } from "../layer/Layer.js";
import { LonLat } from "../LonLat.js";
import { LonLat } from "../LonLat";
import { Ray } from "../math/Ray.js";
import { Vec3 } from "../math/Vec3.js";
import { Vec3 } from "../math/Vec3";
import { createExtent, stringTemplate } from "../utils/shared.js";
const EVENT_NAMES = [

View File

@ -1,7 +1,7 @@
import { Layer } from "../layer/Layer.js";
import { isPowerOfTwo } from "../math.js";
import * as mercator from "../mercator.js";
import { getTileExtent } from "../mercator.js";
import { isPowerOfTwo } from "../math";
import * as mercator from "../mercator";
import { getTileExtent } from "../mercator";
import { GlobusTerrain } from "./GlobusTerrain.js";
const KEY =

View File

@ -1,6 +1,6 @@
'use strict';
import { clamp } from '../math.js';
import { clamp } from '../math';
import { stringTemplate } from '../utils/shared.js';
import { View } from './View.js';

View File

@ -1,6 +1,6 @@
'use strict';
import { LonLat } from '../LonLat.js';
import { LonLat } from '../LonLat';
import * as utils from '../utils/shared.js';
import { Framebuffer } from '../webgl/Framebuffer.js';
import { Program } from '../webgl/Program.js';

View File

@ -4,11 +4,11 @@
"use strict";
import { Extent } from "../Extent.js";
import { LonLat } from "../LonLat.js";
import { Extent } from "../Extent";
import { LonLat } from "../LonLat";
import { Vec2 } from "../math/Vec2.js";
import { Vec3 } from "../math/Vec3.js";
import { Vec4 } from "../math/Vec4.js";
import { Vec3 } from "../math/Vec3";
import { Vec4 } from "../math/Vec4";
import { colorTable } from "./colorTable.js";
export function getDefault(param, def) {

View File

@ -60,7 +60,6 @@ describe('LonLat', () => {
describe('forwardMercator', () => {
test('converts degrees to mercator', () => {
const lonlat = LonLat.forwardMercator(0, 0, 30);
console.log(lonlat)
expect(lonlat).toBeInstanceOf(LonLat);
expect(lonlat.lon).toBeCloseTo(0, 5);
expect(lonlat.lat).toBeCloseTo(0, 5);

View File

@ -1,6 +1,6 @@
import { LonLat } from "../../src/og/LonLat";
import { Vec3 } from "../../src/og/math/Vec3";
import { Ellipsoid } from "../../src/og/ellipsoid/Ellipsoid.js";
import { Ellipsoid } from "../../src/og/ellipsoid/Ellipsoid";
import { wgs84 } from "../../src/og/ellipsoid/wgs84";
test('Testing Ellipsoid Vincenty direct to inverse formulas', () => {

View File

@ -11,7 +11,7 @@ import {
randomi,
step,
getAngleBetweenAzimuths
} from "../src/og/math.js";
} from "../src/og/math";
describe('math module', () => {
describe('log', () => {