@openglobus/og 1.0.0-rc25 → 1.0.0-rc27

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 (43) hide show
  1. package/lib/basedecoder-B4-YuM7w.mjs +57 -0
  2. package/lib/basedecoder-B4-YuM7w.mjs.map +1 -0
  3. package/lib/control/Sun.d.ts +30 -0
  4. package/lib/control/timeline/TimelineControl.d.ts +8 -0
  5. package/lib/control/timeline/TimelineView.d.ts +18 -2
  6. package/lib/control/timeline/timelineUtils.d.ts +7 -0
  7. package/lib/deflate-DYCJGL0P.mjs +10 -0
  8. package/lib/deflate-DYCJGL0P.mjs.map +1 -0
  9. package/lib/globals-1MwmSWn-.mjs +579 -0
  10. package/lib/globals-1MwmSWn-.mjs.map +1 -0
  11. package/lib/index.d.ts +2 -0
  12. package/lib/jpeg-Xvwz4hSD.mjs +495 -0
  13. package/lib/jpeg-Xvwz4hSD.mjs.map +1 -0
  14. package/lib/layer/GeoTIFFLayer.d.ts +87 -0
  15. package/lib/layer/Material.d.ts +9 -3
  16. package/lib/layer/geotiff/ColorScale.d.ts +51 -0
  17. package/lib/layer/geotiff/GeoTIFFReader.d.ts +69 -0
  18. package/lib/layer/geotiff/index.d.ts +3 -0
  19. package/lib/layer/geotiff/types.d.ts +114 -0
  20. package/lib/layer/geotiff/utm.d.ts +22 -0
  21. package/lib/layer/index.d.ts +2 -0
  22. package/lib/lerc-Ca1DtViY.mjs +729 -0
  23. package/lib/lerc-Ca1DtViY.mjs.map +1 -0
  24. package/lib/lzw-CCaYoYwZ.mjs +69 -0
  25. package/lib/lzw-CCaYoYwZ.mjs.map +1 -0
  26. package/lib/og.css +1 -1
  27. package/lib/og.es.js +1 -1
  28. package/lib/og.es.js.map +1 -1
  29. package/lib/packbits-Ct8jLmcJ.mjs +22 -0
  30. package/lib/packbits-Ct8jLmcJ.mjs.map +1 -0
  31. package/lib/pako.esm-B35Pbobp.mjs +1410 -0
  32. package/lib/pako.esm-B35Pbobp.mjs.map +1 -0
  33. package/lib/raw-CUzqu_GQ.mjs +9 -0
  34. package/lib/raw-CUzqu_GQ.mjs.map +1 -0
  35. package/lib/res/tz/timezones.geojson +1 -0
  36. package/lib/ui/Dock.d.ts +0 -1
  37. package/lib/utils/tz.d.ts +89 -0
  38. package/lib/webgl/Handler.d.ts +13 -0
  39. package/lib/webimage-BBmqvNtc.mjs +24 -0
  40. package/lib/webimage-BBmqvNtc.mjs.map +1 -0
  41. package/lib/zstd-CdGlEv5B.mjs +47 -0
  42. package/lib/zstd-CdGlEv5B.mjs.map +1 -0
  43. package/package.json +4 -3
@@ -0,0 +1,57 @@
1
+ function e(e, t) {
2
+ let n = e.length - t, r = 0;
3
+ do {
4
+ for (let n = t; n > 0; n--) e[r + t] += e[r], r++;
5
+ n -= t;
6
+ } while (n > 0);
7
+ }
8
+ function t(e, t, n) {
9
+ let r = 0, i = e.length, a = i / n;
10
+ for (; i > t;) {
11
+ for (let n = t; n > 0; --n) e[r + t] += e[r], ++r;
12
+ i -= t;
13
+ }
14
+ let o = e.slice();
15
+ for (let t = 0; t < a; ++t) for (let r = 0; r < n; ++r) e[n * t + r] = o[(n - r - 1) * a + t];
16
+ }
17
+ var n = class {
18
+ constructor(e) {
19
+ this.parameters = e;
20
+ }
21
+ decodeBlock(e) {
22
+ throw Error("decodeBlock not implemented");
23
+ }
24
+ async decode(n) {
25
+ let r = await this.decodeBlock(n), { tileWidth: i, tileHeight: a, predictor: o, bitsPerSample: s, planarConfiguration: c } = this.parameters;
26
+ return o === 1 ? r : function(n, r, i, a, o, s) {
27
+ if (!r || r === 1) return n;
28
+ for (let e = 0; e < o.length; ++e) {
29
+ if (o[e] % 8 != 0) throw Error("When decoding with predictor, only multiple of 8 bits are supported.");
30
+ if (o[e] !== o[0]) throw Error("When decoding with predictor, all samples must have the same size.");
31
+ }
32
+ let c = o[0] / 8, l = s === 2 ? 1 : o.length;
33
+ for (let s = 0; s < a && !(s * l * i * c >= n.byteLength); ++s) {
34
+ let a;
35
+ if (r === 2) {
36
+ switch (o[0]) {
37
+ case 8:
38
+ a = new Uint8Array(n, s * l * i * c, l * i * c);
39
+ break;
40
+ case 16:
41
+ a = new Uint16Array(n, s * l * i * c, l * i * c / 2);
42
+ break;
43
+ case 32:
44
+ a = new Uint32Array(n, s * l * i * c, l * i * c / 4);
45
+ break;
46
+ default: throw Error(`Predictor 2 not allowed with ${o[0]} bits per sample.`);
47
+ }
48
+ e(a, l);
49
+ } else r === 3 && (a = new Uint8Array(n, s * l * i * c, l * i * c), t(a, l, c));
50
+ }
51
+ return n;
52
+ }(r, o, i, a, Array.isArray(s) || ArrayBuffer.isView(s) ? Array.from(s) : [s], c);
53
+ }
54
+ };
55
+ export { n as t };
56
+
57
+ //# sourceMappingURL=basedecoder-B4-YuM7w.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"basedecoder-B4-YuM7w.mjs","names":[],"sources":["../node_modules/geotiff/dist-module/predictor.js","../node_modules/geotiff/dist-module/compression/basedecoder.js"],"x_google_ignoreList":[0,1],"mappings":"AAIA,SAAS,EAAa,GAAK,GAAA;CACvB,IAAI,IAAS,EAAI,SAAS,GACtB,IAAS;CACb,GAAG;EACC,KAAK,IAAI,IAAI,GAAQ,IAAI,GAAG,KACxB,EAAI,IAAS,MAAW,EAAI,IAC5B;EAEJ,KAAU;CACd,SAAS,IAAS;AACtB;AAMA,SAAS,EAAuB,GAAK,GAAQ,GAAA;CACzC,IAAI,IAAQ,GACR,IAAQ,EAAI,QACV,IAAK,IAAQ;CACnB,OAAO,IAAQ,IAAQ;EACnB,KAAK,IAAI,IAAI,GAAQ,IAAI,GAAA,EAAK,GAC1B,EAAI,IAAQ,MAAW,EAAI,IAAA,EACzB;EAEN,KAAS;CACb;CACA,IAAM,IAAO,EAAI,MAAA;CACjB,KAAK,IAAI,IAAI,GAAG,IAAI,GAAA,EAAM,GACtB,KAAK,IAAI,IAAI,GAAG,IAAI,GAAA,EAAkB,GAClC,EAAK,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uB,AAAd,MAAc,MACnB,IAAM,IAAI,WAAW,GAAO,IAAI,IAAS,IAAQ,GAAgB,IAAS,IAAQ,CAAA,GAClF,EAAuB,GAAK,GAAQ,CAAA;GAE5C;GACA,OAAO;EACX,ECtDkC,GAAS,GAAW,GAAW,GAFxB,MAAM,QAAQ,CAAA,KAAkB,YAAY,OAAO,CAAA,IAC5B,MAAM,KAAK,CAAA,IAAiB,CAAC,CAAA,GACM,CAAA;CAG/F;AAAA;AAAA,SAAA"}
@@ -5,6 +5,17 @@ import type { JulianDate } from "../astro/jd";
5
5
  import { Vec3 } from "../math/Vec3";
6
6
  import type { PlanetCamera } from "../camera/PlanetCamera";
7
7
  import type { LonLat } from "../LonLat";
8
+ /** Returns an IANA time zone name for the point, or null for the solar reading. */
9
+ export type TimeZoneProviderFn = (lonLat: LonLat) => string | null;
10
+ /**
11
+ * Object form of the provider, e.g. a TimeZoneProvider instance: lookup by the point,
12
+ * with an optional lazy load the Sun kicks off on first use.
13
+ */
14
+ export interface ITimeZoneLookup {
15
+ lookup(lon: number, lat: number): string | null;
16
+ load?: () => Promise<unknown>;
17
+ }
18
+ export type TimeZoneProviderLike = TimeZoneProviderFn | ITimeZoneLookup;
8
19
  interface ISunParams extends IControlParams {
9
20
  activationHeight?: number;
10
21
  offsetVertical?: number;
@@ -13,6 +24,7 @@ interface ISunParams extends IControlParams {
13
24
  localDateTime?: Date | null;
14
25
  dateTime?: Date | null;
15
26
  useTimeZones?: boolean;
27
+ timeZoneProvider?: TimeZoneProviderLike | null;
16
28
  }
17
29
  /**
18
30
  * Real Sun geocentric position control that place the Sun on the right place by the Earth.
@@ -31,6 +43,9 @@ interface ISunParams extends IControlParams {
31
43
  * @param {Date} [options.dateTime] - Instant in time the Sun takes its real position at.
32
44
  * @param {boolean} [options.useTimeZones=false] - Reads localDateTime by the time zone of the point.
33
45
  * Leave off on bodies without civil time.
46
+ * @param {TimeZoneProviderLike} [options.timeZoneProvider] - Time zone source for the point under
47
+ * the camera: a function, or an object like TimeZoneProvider — its lazy load is kicked off on
48
+ * first use, and the built-in lookup answers until the data arrives.
34
49
  */
35
50
  export declare class Sun extends Control {
36
51
  activationHeight: number;
@@ -51,6 +66,9 @@ export declare class Sun extends Control {
51
66
  */
52
67
  dateTime: Date | null;
53
68
  protected _useTimeZones: boolean;
69
+ protected _timeZoneProvider: TimeZoneProviderLike | null;
70
+ protected _timeZoneProviderReady: boolean;
71
+ protected _timeZoneProviderLoading: boolean;
54
72
  protected _currDate: number;
55
73
  protected _prevDate: number;
56
74
  protected _redrawDate: number;
@@ -78,6 +96,18 @@ export declare class Sun extends Control {
78
96
  */
79
97
  get useTimeZones(): boolean;
80
98
  set useTimeZones(useTimeZones: boolean);
99
+ /**
100
+ * Time zone source for the point under the camera: a function, or an object like
101
+ * TimeZoneProvider — its lazy load is kicked off on first use, and the built-in
102
+ * lookup answers until the data arrives. The built-in lookup when null.
103
+ * @public
104
+ * @type {TimeZoneProviderLike | null}
105
+ */
106
+ get timeZoneProvider(): TimeZoneProviderLike | null;
107
+ set timeZoneProvider(provider: TimeZoneProviderLike | null);
108
+ protected _resetTimeZoneProviderState(): void;
109
+ protected _lookupTimeZone(lonLat: LonLat): string | null;
110
+ protected _loadTimeZoneProvider(p: ITimeZoneLookup): void;
81
111
  /**
82
112
  * Sets the local clock time under the camera, read by its UTC clock.
83
113
  * @public
@@ -26,6 +26,7 @@ interface ITimelineControlParams extends IControlParams {
26
26
  rangeStart?: Date;
27
27
  rangeEnd?: Date;
28
28
  use24HourClock?: boolean;
29
+ template?: string;
29
30
  }
30
31
  declare class TimelineControl extends Control {
31
32
  protected _timelineView: TimelineView;
@@ -42,6 +43,13 @@ declare class TimelineControl extends Control {
42
43
  /** Date the Sun marker stands on. Setting it moves the marker without dispatching. */
43
44
  get localDateTime(): Date;
44
45
  set localDateTime(date: Date);
46
+ /**
47
+ * Marker label date format, e.g. "MM/dd/yyyy" or "hh:mm:ss.ms". Tokens: yyyy/yy, MMM,
48
+ * MM/M, dd/d, hh/h, mm/m, ss/s, ms, a/A; case matters for M/m only. An empty template
49
+ * keeps the adaptive scale format. am/pm follows {@link TimelineControl.use24HourClock}.
50
+ */
51
+ get template(): string;
52
+ set template(template: string);
45
53
  /** Scale time notation: 24-hour, or 12-hour with am/pm. */
46
54
  get use24HourClock(): boolean;
47
55
  set use24HourClock(use24HourClock: boolean);
@@ -13,6 +13,7 @@ interface ITimelineViewParams extends IViewParams {
13
13
  maxDate?: Date;
14
14
  fillStyle?: string;
15
15
  use24HourClock?: boolean;
16
+ dateTemplate?: string;
16
17
  }
17
18
  declare const TOUCH_MODE_NONE = 0;
18
19
  declare const TOUCH_MODE_CURRENT = 1;
@@ -46,6 +47,13 @@ declare class TimelineView extends View<TimelineModel> {
46
47
  protected _frameEl: HTMLElement | null;
47
48
  protected _currentEl: HTMLElement | null;
48
49
  protected _sunEl: HTMLElement | null;
50
+ protected _currentLabelEl: HTMLElement | null;
51
+ protected _sunLabelEl: HTMLElement | null;
52
+ protected _currentLabelText: string;
53
+ protected _sunLabelText: string;
54
+ protected _dateTemplate: string;
55
+ protected _scaleShowTime: boolean;
56
+ protected _scaleShowMilliseconds: boolean;
49
57
  protected _canvasEl: HTMLCanvasElement;
50
58
  protected _ctx: CanvasRenderingContext2D;
51
59
  protected _spansCanvasEl: HTMLCanvasElement;
@@ -96,6 +104,13 @@ declare class TimelineView extends View<TimelineModel> {
96
104
  get use24HourClock(): boolean;
97
105
  set use24HourClock(use24HourClock: boolean);
98
106
  protected _notchColor(time: number): string;
107
+ /**
108
+ * Marker label date format, e.g. "MM/dd/yyyy" or "hh:mm:ss.ms".
109
+ * An empty template keeps the adaptive scale format.
110
+ */
111
+ get dateTemplate(): string;
112
+ set dateTemplate(dateTemplate: string);
113
+ protected _formatMarkerDate(date: Date): string;
99
114
  get localTime(): boolean;
100
115
  set localTime(localTime: boolean);
101
116
  /**
@@ -144,9 +159,9 @@ declare class TimelineView extends View<TimelineModel> {
144
159
  protected _onMouseEnter: () => void;
145
160
  protected _onMouseOut: () => void;
146
161
  protected _onCurrentMouseEnter: () => void;
147
- protected _onCurrentMouseOut: () => void;
162
+ protected _onCurrentMouseLeave: () => void;
148
163
  protected _onSunMouseEnter: () => void;
149
- protected _onSunMouseOut: () => void;
164
+ protected _onSunMouseLeave: () => void;
150
165
  protected _onScalePointerDown: (e: PointerEvent) => void;
151
166
  protected _onCurrentPointerDown: (e: PointerEvent) => void;
152
167
  protected _onSunPointerDown: (e: PointerEvent) => void;
@@ -163,6 +178,7 @@ declare class TimelineView extends View<TimelineModel> {
163
178
  protected _applyScaleBackground(): void;
164
179
  protected _drawSpans: () => void;
165
180
  protected _drawCurrent(): void;
181
+ protected _updateLabel(el: HTMLElement | null, date: Date, textField: "_currentLabelText" | "_sunLabelText", posX: number): void;
166
182
  protected _drawSun(): void;
167
183
  draw(): void;
168
184
  }
@@ -2,6 +2,13 @@ type BaselineType = "alphabetic" | "bottom" | "hanging" | "ideographic" | "middl
2
2
  type AlignType = "center" | "end" | "left" | "right" | "start";
3
3
  export declare function addSeconds(date: Date, seconds: number): Date;
4
4
  export declare function dateToStr(date: Date, showTime?: boolean, showMilliseconds?: boolean, use24HourClock?: boolean): string;
5
+ /**
6
+ * Formats a date by a template, e.g. "MM/dd/yyyy", "hh:mm:ss.ms". Tokens: yyyy/yy year,
7
+ * MMM month name, MM/M month, dd/d day, hh/h hours, mm/m minutes, ss/s seconds,
8
+ * ms milliseconds, a/A am/pm. Case matters for M/m only. On a 12-hour clock
9
+ * am/pm is appended after the time unless the template places it with "a".
10
+ */
11
+ export declare function formatDate(date: Date, template: string, use24HourClock?: boolean): string;
5
12
  export declare function createCanvasHTML(): HTMLCanvasElement;
6
13
  export declare function getNearestTimeLeft(t: number, div: number): number;
7
14
  export declare function drawNotch(ctx: CanvasRenderingContext2D, xOffset?: number, size?: number, thickness?: number, color?: string): void;
@@ -0,0 +1,10 @@
1
+ import { t as e } from "./basedecoder-B4-YuM7w.mjs";
2
+ import { t } from "./pako.esm-B35Pbobp.mjs";
3
+ var n = class extends e {
4
+ decodeBlock(e) {
5
+ return t(new Uint8Array(e)).buffer;
6
+ }
7
+ };
8
+ export { n as default };
9
+
10
+ //# sourceMappingURL=deflate-DYCJGL0P.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deflate-DYCJGL0P.mjs","names":["inflate"],"sources":["../node_modules/geotiff/dist-module/compression/deflate.js"],"x_google_ignoreList":[0],"mappings":";;AAEA,IAAqB,IAArB,cAA4C,EAAA;CAExC,YAAY,GAAA;EACR,OAAOA,EAAQ,IAAI,WAAW,CAAA,CAAA,CAAA,CAAS;CAC3C;AAAA;AAAA,SAAA,KAAA"}