@openglobus/og 0.18.4 → 0.19.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.
Files changed (64) hide show
  1. package/README.md +19 -68
  2. package/css/og.css +308 -45
  3. package/lib/@openglobus/og.css +1 -1
  4. package/lib/@openglobus/og.esm.js +1 -1
  5. package/lib/@openglobus/og.esm.js.map +1 -1
  6. package/lib/@openglobus/og.umd.js +1 -1
  7. package/lib/@openglobus/og.umd.js.map +1 -1
  8. package/lib/js/Globe.d.ts +2 -0
  9. package/lib/js/Globe.js +3 -1
  10. package/lib/js/camera/PlanetCamera.d.ts +2 -2
  11. package/lib/js/camera/PlanetCamera.js +3 -2
  12. package/lib/js/control/DebugInfo.js +5 -0
  13. package/lib/js/control/EarthCoordinates.js +2 -2
  14. package/lib/js/control/LayerSwitcher.d.ts +18 -3
  15. package/lib/js/control/LayerSwitcher.js +111 -11
  16. package/lib/js/control/MouseNavigation.d.ts +2 -0
  17. package/lib/js/control/MouseNavigation.js +15 -15
  18. package/lib/js/control/elevationProfile/ElevationProfile.d.ts +41 -25
  19. package/lib/js/control/elevationProfile/ElevationProfile.js +106 -75
  20. package/lib/js/control/elevationProfile/ElevationProfileButtonsView.d.ts +14 -0
  21. package/lib/js/control/elevationProfile/ElevationProfileButtonsView.js +61 -0
  22. package/lib/js/control/elevationProfile/ElevationProfileControl.d.ts +33 -0
  23. package/lib/js/control/elevationProfile/ElevationProfileControl.js +153 -0
  24. package/lib/js/control/elevationProfile/ElevationProfileLegend.d.ts +20 -0
  25. package/lib/js/control/elevationProfile/ElevationProfileLegend.js +82 -0
  26. package/lib/js/control/elevationProfile/ElevationProfileScene.d.ts +80 -0
  27. package/lib/js/control/elevationProfile/ElevationProfileScene.js +539 -0
  28. package/lib/js/control/elevationProfile/ElevationProfileView.d.ts +63 -0
  29. package/lib/js/control/elevationProfile/ElevationProfileView.js +504 -0
  30. package/lib/js/control/elevationProfile/PointListDialog.d.ts +12 -0
  31. package/lib/js/control/elevationProfile/PointListDialog.js +57 -0
  32. package/lib/js/control/heightRuler/HeightRulerScene.js +1 -1
  33. package/lib/js/control/index.d.ts +2 -1
  34. package/lib/js/control/index.js +2 -1
  35. package/lib/js/control/ruler/RulerScene.js +3 -3
  36. package/lib/js/control/selection/SelectionScene.js +2 -2
  37. package/lib/js/entity/Entity.js +5 -1
  38. package/lib/js/entity/Polyline.js +1 -1
  39. package/lib/js/layer/GeoImage.js +3 -0
  40. package/lib/js/layer/Layer.d.ts +18 -4
  41. package/lib/js/layer/Layer.js +25 -4
  42. package/lib/js/layer/XYZ.d.ts +0 -1
  43. package/lib/js/quadTree/Node.d.ts +21 -3
  44. package/lib/js/quadTree/Node.js +173 -62
  45. package/lib/js/renderer/Renderer.d.ts +0 -1
  46. package/lib/js/renderer/Renderer.js +22 -44
  47. package/lib/js/renderer/RendererEvents.d.ts +1 -0
  48. package/lib/js/renderer/RendererEvents.js +5 -7
  49. package/lib/js/scene/Planet.d.ts +33 -4
  50. package/lib/js/scene/Planet.js +206 -84
  51. package/lib/js/segment/Segment.d.ts +7 -1
  52. package/lib/js/segment/Segment.js +40 -12
  53. package/lib/js/shaders/drawnode.js +21 -2
  54. package/lib/js/shaders/geoObject.js +26 -18
  55. package/lib/js/terrain/GlobusTerrain.d.ts +3 -0
  56. package/lib/js/terrain/GlobusTerrain.js +15 -3
  57. package/lib/js/terrain/MapboxTerrain.js +29 -29
  58. package/lib/js/ui/Dialog.js +1 -1
  59. package/lib/js/utils/TerrainWorker.js +1 -1
  60. package/lib/js/utils/shared.d.ts +3 -1
  61. package/lib/js/utils/shared.js +22 -3
  62. package/package.json +2 -2
  63. package/lib/js/shaders/pickingMask.d.ts +0 -2
  64. package/lib/js/shaders/pickingMask.js +0 -22
@@ -0,0 +1,82 @@
1
+ import { View } from '../../ui/View';
2
+ import { distanceFormatExt } from "../../utils/shared";
3
+ const TEMPLATE = `<div class="og-elevationprofile-legend">
4
+ <div class="og-elevationprofile-legend__row og-elevationprofile-legend__track">
5
+ <div class="og-elevationprofile-square"></div>
6
+ <div class="og-elevationprofile-value">0</div>
7
+ <div class="og-elevationprofile-units">m</div>
8
+ </div>
9
+ <div class="og-elevationprofile-legend__row og-elevationprofile-legend__ground">
10
+ <div class="og-elevationprofile-square"></div>
11
+ <div class="og-elevationprofile-value">0</div>
12
+ <div class="og-elevationprofile-units">m</div>
13
+ </div>
14
+ <div class="og-elevationprofile-legend__row og-elevationprofile-legend__warning">
15
+ <div class="og-elevationprofile-square"></div>
16
+ <div class="og-elevationprofile-value">0</div>
17
+ <div class="og-elevationprofile-units">m</div>
18
+ </div>
19
+ <div class="og-elevationprofile-legend__row og-elevationprofile-legend__collision">
20
+ <div class="og-elevationprofile-square"></div>
21
+ <div class="og-elevationprofile-value">0</div>
22
+ <div class="og-elevationprofile-units">m</div>
23
+ </div>
24
+ </div>`;
25
+ export class ElevationProfileLegend extends View {
26
+ constructor(params = {}) {
27
+ super({
28
+ ...params,
29
+ template: TEMPLATE
30
+ });
31
+ this.$groundValue = null;
32
+ this.$trackValue = null;
33
+ this.$warningValue = null;
34
+ this.$collisionValue = null;
35
+ this.$trackUnits = null;
36
+ this.$groundUnits = null;
37
+ this.$warningUnits = null;
38
+ this.$collisionUnits = null;
39
+ }
40
+ render(params) {
41
+ super.render(params);
42
+ this.$trackValue = this.select(".og-elevationprofile-legend__track .og-elevationprofile-value");
43
+ this.$groundValue = this.select(".og-elevationprofile-legend__ground .og-elevationprofile-value");
44
+ this.$warningValue = this.select(".og-elevationprofile-legend__warning .og-elevationprofile-value");
45
+ this.$collisionValue = this.select(".og-elevationprofile-legend__collision .og-elevationprofile-value");
46
+ this.$trackUnits = this.select(".og-elevationprofile-legend__track .og-elevationprofile-units");
47
+ this.$groundUnits = this.select(".og-elevationprofile-legend__ground .og-elevationprofile-units");
48
+ this.$warningUnits = this.select(".og-elevationprofile-legend__warning .og-elevationprofile-units");
49
+ this.$collisionUnits = this.select(".og-elevationprofile-legend__collision .og-elevationprofile-units");
50
+ return this;
51
+ }
52
+ clear() {
53
+ this.$trackValue && (this.$trackValue.innerText = "0");
54
+ this.$trackUnits && (this.$trackUnits.innerText = "m");
55
+ this.$groundValue && (this.$groundValue.innerText = "0");
56
+ this.$groundUnits && (this.$groundUnits.innerText = "m");
57
+ this.$warningValue && (this.$warningValue.innerText = "0");
58
+ this.$warningUnits && (this.$warningUnits.innerText = "m");
59
+ this.$collisionValue && (this.$collisionValue.innerText = "0");
60
+ this.$collisionUnits && (this.$collisionUnits.innerText = "m");
61
+ }
62
+ setTrackLength(trackLength) {
63
+ let dist = distanceFormatExt(trackLength);
64
+ this.$trackValue.innerText = dist[0];
65
+ this.$trackUnits.innerText = dist[1];
66
+ }
67
+ setGroundLength(groundLength) {
68
+ let dist = distanceFormatExt(groundLength);
69
+ this.$groundValue.innerText = dist[0];
70
+ this.$groundUnits.innerText = dist[1];
71
+ }
72
+ setWarningLength(warningLength) {
73
+ let warningDist = distanceFormatExt(warningLength);
74
+ this.$warningValue.innerText = warningDist[0];
75
+ this.$warningUnits.innerText = warningDist[1];
76
+ }
77
+ setCollisionLength(collisionLength) {
78
+ let collisionDist = distanceFormatExt(collisionLength);
79
+ this.$collisionValue.innerText = collisionDist[0];
80
+ this.$collisionUnits.innerText = collisionDist[1];
81
+ }
82
+ }
@@ -0,0 +1,80 @@
1
+ import { Entity } from '../../entity/Entity';
2
+ import { EventsHandler } from '../../Events';
3
+ import { LonLat } from "../../LonLat";
4
+ import { Planet } from "../../scene/Planet";
5
+ import { RenderNode } from '../../scene/RenderNode';
6
+ import { Vector } from '../../layer/Vector';
7
+ import { Vec2 } from '../../math/Vec2';
8
+ import { Vec3 } from '../../math/Vec3';
9
+ import { IMouseState } from "../../renderer/RendererEvents";
10
+ import { Ellipsoid } from "../../ellipsoid/Ellipsoid";
11
+ export interface IElevationProfileSceneParams {
12
+ name?: string;
13
+ planet?: Planet;
14
+ }
15
+ declare class ElevationProfileScene extends RenderNode {
16
+ events: EventsHandler<ElevationProfileSceneEventsList>;
17
+ protected _planet: Planet | null;
18
+ protected _trackLayer: Vector;
19
+ protected _groundPointersLayer: Vector;
20
+ protected _columnPointersLayer: Vector;
21
+ protected _headPointersLayer: Vector;
22
+ protected _heightsLayer: Vector;
23
+ protected _trackEntity: Entity;
24
+ protected _pickedGroundEntity: Entity | null;
25
+ protected _pickedHeadEntity: Entity | null;
26
+ protected _pointerLayer: Vector;
27
+ protected _pointerHeadEntity: Entity;
28
+ protected _pointerLabelEntity: Entity;
29
+ protected _pointerRayEntity: Entity;
30
+ protected _startClickPos: Vec2;
31
+ protected _startEntityPos: Vec2;
32
+ protected _clampToGround: boolean;
33
+ constructor(options?: IElevationProfileSceneParams);
34
+ flyExtent(): void;
35
+ get planet(): Planet | null;
36
+ protected _createGroundPointer(groundCart: Vec3, altitude?: number): {
37
+ headEntity: Entity;
38
+ groundEntity: Entity;
39
+ columnEntity: Entity;
40
+ heightLabelEntity: Entity;
41
+ };
42
+ setPointerCartesian3v(p: Vec3, height: number): void;
43
+ bindPlanet(planet: Planet): void;
44
+ init(): void;
45
+ onremove(): void;
46
+ _activate(): void;
47
+ getPointLonLat(index: number): LonLat | undefined;
48
+ getPointsLonLat(): LonLat[];
49
+ getHeightMSL(lonLat: LonLat): number;
50
+ getHeightELLAsync(lonLat: LonLat): Promise<number>;
51
+ addPointLonLatArrayAsync(lonLatArr: LonLat[], stopPropagation?: boolean): Promise<Entity>[];
52
+ addPointLonLatAsync(lonLat: LonLat, stopPropagation?: boolean): Promise<Entity>;
53
+ addGroundPointLonLatAsync(lonLat: LonLat, altitude?: number, stopPropagation?: boolean): Promise<Entity>;
54
+ addGroundPoint3vAsync(groundPos: Vec3, altitude?: number, stopPropagation?: boolean): Promise<Entity>;
55
+ protected _addPoint(groundPos: Vec3, lonLat: LonLat, altitude: number, stopPropagation?: boolean): Promise<Entity>;
56
+ protected _onLClick: (e: IMouseState) => void;
57
+ protected _onMouseMove: (e: IMouseState) => void;
58
+ setHeadPointCartesian3v(entityIndex: number, headPos: Vec3): void;
59
+ setGroundPointCartesian3v(entityIndex: number, groundPos: Vec3): void;
60
+ protected _onLUp: (e: IMouseState) => void;
61
+ protected _onGroundPointerEnter: (e: IMouseState) => void;
62
+ protected _onGroundPointerLeave: (e: IMouseState) => void;
63
+ protected _onGroundPointerLDown: (e: IMouseState) => void;
64
+ protected _onGroundPointerLUp: (e: IMouseState) => void;
65
+ protected _onHeadPointerEnter: (e: IMouseState) => void;
66
+ protected _onHeadPointerLeave: (e: IMouseState) => void;
67
+ protected _onHeadPointerLDown: (e: IMouseState) => void;
68
+ protected _onHeadPointerLUp: (e: IMouseState) => void;
69
+ protected _deactivate(): void;
70
+ setPointerVisibility(visibility: boolean): void;
71
+ setVisibility(visibility: boolean): void;
72
+ clear(): void;
73
+ frame(): void;
74
+ get ellipsoid(): Ellipsoid | null;
75
+ }
76
+ type ElevationProfileSceneEventsList = [
77
+ "change",
78
+ "addpoint"
79
+ ];
80
+ export { ElevationProfileScene };