astro-viewer 3.10.0 → 3.12.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 (75) hide show
  1. package/README.md +66 -4
  2. package/dist/astroviewer.cjs +911 -154
  3. package/dist/astroviewer.cjs.map +1 -1
  4. package/dist/astroviewer.js +911 -154
  5. package/dist/astroviewer.js.map +1 -1
  6. package/dist/astroviewer.min.js +1 -1
  7. package/dist/astroviewer.min.js.map +1 -1
  8. package/lib-esm/AstroSphere.d.ts +37 -2
  9. package/lib-esm/AstroSphere.d.ts.map +1 -1
  10. package/lib-esm/AstroSphere.js +249 -70
  11. package/lib-esm/AstroSphere.js.map +1 -1
  12. package/lib-esm/AstroViewer.d.ts +15 -1
  13. package/lib-esm/AstroViewer.d.ts.map +1 -1
  14. package/lib-esm/AstroViewer.js +41 -4
  15. package/lib-esm/AstroViewer.js.map +1 -1
  16. package/lib-esm/Camera.d.ts +14 -0
  17. package/lib-esm/Camera.d.ts.map +1 -1
  18. package/lib-esm/Camera.js +118 -8
  19. package/lib-esm/Camera.js.map +1 -1
  20. package/lib-esm/index.d.ts +1 -0
  21. package/lib-esm/index.d.ts.map +1 -1
  22. package/lib-esm/index.js +1 -0
  23. package/lib-esm/index.js.map +1 -1
  24. package/lib-esm/model/Source.d.ts +11 -0
  25. package/lib-esm/model/Source.d.ts.map +1 -1
  26. package/lib-esm/model/Source.js +8 -1
  27. package/lib-esm/model/Source.js.map +1 -1
  28. package/lib-esm/model/catalogues/CatalogueGL.d.ts +36 -5
  29. package/lib-esm/model/catalogues/CatalogueGL.d.ts.map +1 -1
  30. package/lib-esm/model/catalogues/CatalogueGL.js +329 -57
  31. package/lib-esm/model/catalogues/CatalogueGL.js.map +1 -1
  32. package/lib-esm/model/earth/XYZMap.d.ts +4 -1
  33. package/lib-esm/model/earth/XYZMap.d.ts.map +1 -1
  34. package/lib-esm/model/earth/XYZMap.js +35 -2
  35. package/lib-esm/model/earth/XYZMap.js.map +1 -1
  36. package/lib-esm/model/footprints/FootprintSetGL.d.ts +1 -0
  37. package/lib-esm/model/footprints/FootprintSetGL.d.ts.map +1 -1
  38. package/lib-esm/model/footprints/FootprintSetGL.js +13 -3
  39. package/lib-esm/model/footprints/FootprintSetGL.js.map +1 -1
  40. package/lib-esm/model/grid/EquatorialGrid.d.ts +1 -0
  41. package/lib-esm/model/grid/EquatorialGrid.d.ts.map +1 -1
  42. package/lib-esm/model/grid/EquatorialGrid.js +3 -0
  43. package/lib-esm/model/grid/EquatorialGrid.js.map +1 -1
  44. package/lib-esm/model/grid/HealpixGrid.d.ts +1 -0
  45. package/lib-esm/model/grid/HealpixGrid.d.ts.map +1 -1
  46. package/lib-esm/model/grid/HealpixGrid.js +3 -0
  47. package/lib-esm/model/grid/HealpixGrid.js.map +1 -1
  48. package/lib-esm/model/grid/LonLatGrid.d.ts +1 -0
  49. package/lib-esm/model/grid/LonLatGrid.d.ts.map +1 -1
  50. package/lib-esm/model/grid/LonLatGrid.js +3 -0
  51. package/lib-esm/model/grid/LonLatGrid.js.map +1 -1
  52. package/lib-esm/model/meships/MeshHiPS.d.ts +4 -0
  53. package/lib-esm/model/meships/MeshHiPS.d.ts.map +1 -1
  54. package/lib-esm/model/meships/MeshHiPS.js +11 -1
  55. package/lib-esm/model/meships/MeshHiPS.js.map +1 -1
  56. package/lib-esm/model/terra/TerraPointSetGL.d.ts +1 -0
  57. package/lib-esm/model/terra/TerraPointSetGL.d.ts.map +1 -1
  58. package/lib-esm/model/terra/TerraPointSetGL.js +39 -1
  59. package/lib-esm/model/terra/TerraPointSetGL.js.map +1 -1
  60. package/lib-esm/shader/CatalogueShaderProgram.d.ts +4 -0
  61. package/lib-esm/shader/CatalogueShaderProgram.d.ts.map +1 -1
  62. package/lib-esm/shader/CatalogueShaderProgram.js +6 -0
  63. package/lib-esm/shader/CatalogueShaderProgram.js.map +1 -1
  64. package/lib-esm/shader/ShaderManager.d.ts.map +1 -1
  65. package/lib-esm/shader/ShaderManager.js +7 -4
  66. package/lib-esm/shader/ShaderManager.js.map +1 -1
  67. package/lib-esm/shader/XYZShaderProgram.d.ts +3 -0
  68. package/lib-esm/shader/XYZShaderProgram.d.ts.map +1 -1
  69. package/lib-esm/shader/XYZShaderProgram.js +11 -3
  70. package/lib-esm/shader/XYZShaderProgram.js.map +1 -1
  71. package/lib-esm/utils/Utils.d.ts +12 -0
  72. package/lib-esm/utils/Utils.d.ts.map +1 -1
  73. package/lib-esm/utils/Utils.js +26 -0
  74. package/lib-esm/utils/Utils.js.map +1 -1
  75. package/package.json +2 -2
@@ -42,9 +42,17 @@ export type CameraChangedDetail = {
42
42
  mouseHoverPoint: PointCoordinates | undefined;
43
43
  getFoVPolygon: Point[];
44
44
  };
45
+ export type ViewerDomain = "astronomy" | "earth" | "mesh";
45
46
  export type AstroSphereOptions = {
46
47
  gridLabelContainers?: GridLabelContainers;
47
48
  };
49
+ export type EarthRasterOverlayInfo = {
50
+ id: string;
51
+ name: string;
52
+ sourceType: "xyz" | "wmts";
53
+ visible: boolean;
54
+ opacity: number;
55
+ };
48
56
  /**
49
57
  * AstroSphere — main WebGL scene controller (TS port)
50
58
  */
@@ -71,12 +79,18 @@ declare class AstroSphere {
71
79
  private _activeHiPS;
72
80
  private _activeHiPSLayers;
73
81
  private _activeXYZ2;
82
+ private _earthRasterOverlays;
83
+ private _earthRasterOverlaySequence;
74
84
  private _activeMeshHiPS;
75
85
  private _activeBaseLayer;
86
+ private _activeDomain;
87
+ private domainCameraStates;
76
88
  private startup;
77
89
  private fov;
78
- private activeCatalogues;
79
- private activeFootprintSets;
90
+ private astronomyCatalogues;
91
+ private earthPointSets;
92
+ private astronomyFootprintSets;
93
+ private earthFootprintSets;
80
94
  private activePolylineSets;
81
95
  private activeSensorCones;
82
96
  private activeSatelliteObjects;
@@ -129,11 +143,30 @@ declare class AstroSphere {
129
143
  activateXYZ(config: XYZLayerConfig): void;
130
144
  activateXYZ2(config: XYZMapDescriptor): void;
131
145
  activateMeshHiPS(descriptor: MeshHiPSDescriptor): void;
146
+ setMeshHiPSColor(color: [number, number, number, number]): void;
147
+ setMeshHiPSWireframe(wireframe: boolean): void;
132
148
  activateWMTS(config: WMTSLayerConfig): void;
149
+ addXYZRasterOverlay(config: XYZMapDescriptor): EarthRasterOverlayInfo;
150
+ addWMTSRasterOverlay(config: WMTSLayerConfig): EarthRasterOverlayInfo;
151
+ getEarthRasterOverlays(): EarthRasterOverlayInfo[];
152
+ setEarthRasterOverlayOpacity(id: string, opacity: number): void;
153
+ setEarthRasterOverlayVisible(id: string, visible: boolean): void;
154
+ removeEarthRasterOverlay(id: string): void;
155
+ removeAllEarthRasterOverlays(): void;
156
+ private addEarthRasterOverlay;
157
+ setActiveDomain(domain: ViewerDomain): void;
158
+ private clearGridLabelsForDomain;
159
+ get activeDomain(): ViewerDomain;
160
+ private getActivePointSets;
161
+ private getActiveFootprintSets;
133
162
  showCatalogue(cat: CatalogueGL): Promise<CatalogueGL>;
134
163
  deleteCatalogue(catalogue: CatalogueGL): void;
164
+ showTerraPointSet(pointSet: CatalogueGL): Promise<CatalogueGL>;
165
+ deleteTerraPointSet(pointSet: CatalogueGL): void;
135
166
  showFootprintSet(fset: FootprintSetGL): Promise<FootprintSetGL>;
136
167
  deleteFootprintSet(footprintSet: FootprintSetGL): void;
168
+ showTerraFootprintSet(footprintSet: FootprintSetGL): Promise<FootprintSetGL>;
169
+ deleteTerraFootprintSet(footprintSet: FootprintSetGL): void;
137
170
  showPolylineSet(polylineSet: TerraPolylineSetGL): Promise<TerraPolylineSetGL>;
138
171
  deletePolylineSet(polylineSet: TerraPolylineSetGL): void;
139
172
  showSensorCone(sensorCone: SensorConeGL): Promise<SensorConeGL>;
@@ -142,6 +175,7 @@ declare class AstroSphere {
142
175
  deleteSatelliteObject(satelliteObject: SatelliteObjectGL): void;
143
176
  getHoveredFootprints(): HoveredFootprintDetail[];
144
177
  goTo(raDeg: number, decDeg: number): void;
178
+ flyTo(raDeg: number, decDeg: number, durationMs?: number): void;
145
179
  getActiveCoordinateMode(): "equatorial" | "galactic" | "lonlat";
146
180
  resetAxesOrientation(): void;
147
181
  setKeepCameraNorthUp(enabled: boolean): void;
@@ -177,6 +211,7 @@ declare class AstroSphere {
177
211
  getHiPSDebugStats(): HiPSDebugStats | null;
178
212
  getMeshHiPSDebugStats(): MeshHiPSDebugStats | null;
179
213
  draw(canvas: HTMLCanvasElement): void;
214
+ private getActiveDomainModelMatrix;
180
215
  private emitHoveredSourceIfChanged;
181
216
  }
182
217
  export default AstroSphere;
@@ -1 +1 @@
1
- {"version":3,"file":"AstroSphere.d.ts","sourceRoot":"","sources":["../src/AstroSphere.ts"],"names":[],"mappings":"AAYA,OAAO,MAAM,MAAM,aAAa,CAAC;AAKjC,OAAO,EAKL,WAAW,EACX,GAAG,EACH,eAAe,EACf,GAAG,EACJ,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEhE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EACL,cAAc,EACd,sBAAsB,EACvB,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAG1E,OAAkB,EAAgB,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EACb,cAAc,EACf,MAAM,4BA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asterOverlays = [];
58
+ _earthRasterOverlaySequence = 0;
57
59
  _activeMeshHiPS = null;
58
60
  _activeBaseLayer = null;
61
+ _activeDomain = "astronomy";
62
+ domainCameraStates = {};
59
63
  startup = true;
60
64
  fov;
61
- activeCatalogues = [];
62
- activeFootprintSets = [];
65
+ astronomyCatalogues = [];
66
+ earthPointSets = [];
67
+ astronomyFootprintSets = [];
68
+ earthFootprintSets = [];
63
69
  activePolylineSets = [];
64
70
  activeSensorCones = [];
65
71
  activeSatelliteObjects = [];
@@ -292,9 +298,7 @@ class AstroSphere {
292
298
  return true;
293
299
  }
294
300
  emitCameraChanged(reason) {
295
- // avoid dispatch before scene is ready
296
- if (!this._activeHiPS && !this._activeXYZ2 && !this._activeMeshHiPS)
297
- return;
301
+ // Camera interaction remains meaningful even when no base layer is active.
298
302
  if (!this._healpixGrid?.fovObj)
299
303
  return;
300
304
  const detail = this.getCurrentStatus();
@@ -320,6 +324,7 @@ class AstroSphere {
320
324
  const handleMouseDown = (event) => {
321
325
  canvas.setPointerCapture(event.pointerId);
322
326
  this.mouseDown = true;
327
+ this._camera.cancelFlyTo();
323
328
  const rect = canvas.getBoundingClientRect();
324
329
  this.lastMouseX = event.clientX - rect.left; // locale al canvas
325
330
  this.lastMouseY = event.clientY - rect.top; // locale al canvas
@@ -358,8 +363,11 @@ class AstroSphere {
358
363
  if (mousePoint && mousePoint.length > 0) {
359
364
  this.mouseHelper.update(mousePoint);
360
365
  this.updateLastMousePoint();
361
- for (const cat of this.activeCatalogues) {
362
- const clickResult = cat.selectPrimarySourceFromClick(this.mouseHelper);
366
+ for (const cat of this.getActivePointSets()) {
367
+ const activeModelMatrix = this.getActiveDomainModelMatrix();
368
+ if (!activeModelMatrix)
369
+ continue;
370
+ const clickResult = cat.selectPrimarySourceFromClick(this.mouseHelper, activeModelMatrix, this._camera.getCameraMatrix(), this._perspectiveMatrixManager.pMatrix);
363
371
  if (!clickResult?.sources.length)
364
372
  continue;
365
373
  this._webgl.canvas.dispatchEvent(new CustomEvent("source-clicked", {
@@ -372,7 +380,7 @@ class AstroSphere {
372
380
  composed: true,
373
381
  }));
374
382
  }
375
- for (const fset of this.activeFootprintSets) {
383
+ for (const fset of this.getActiveFootprintSets()) {
376
384
  const clickResult = fset.selectPrimaryFootprintFromClick(this.mouseHelper);
377
385
  if (!clickResult?.footprints.length)
378
386
  continue;
@@ -446,6 +454,7 @@ class AstroSphere {
446
454
  const handleMouseWheel = (event) => {
447
455
  const currentFov = this._healpixGrid.getMinFoV();
448
456
  const zoomStep = this.computeZoomStep(currentFov, event.deltaY);
457
+ this._camera.cancelFlyTo();
449
458
  // Apply wheel zoom immediately and discard any queued inertia so reversing
450
459
  // direction feels responsive instead of "buffered".
451
460
  this.zoomInertia = 0;
@@ -468,8 +477,11 @@ class AstroSphere {
468
477
  }
469
478
  this.mouseHelper.update(mousePoint);
470
479
  this.updateLastMousePoint();
471
- for (const cat of this.activeCatalogues) {
472
- const pickResult = cat.getSourcesFromPointer(this.mouseHelper);
480
+ for (const cat of this.getActivePointSets()) {
481
+ const activeModelMatrix = this.getActiveDomainModelMatrix();
482
+ if (!activeModelMatrix)
483
+ continue;
484
+ const pickResult = cat.getSourcesFromPointer(this.mouseHelper, activeModelMatrix, this._camera.getCameraMatrix(), this._perspectiveMatrixManager.pMatrix);
473
485
  if (!pickResult?.sources.length)
474
486
  continue;
475
487
  this._webgl.canvas.dispatchEvent(new CustomEvent("source-contextmenu", {
@@ -484,7 +496,7 @@ class AstroSphere {
484
496
  }));
485
497
  break;
486
498
  }
487
- for (const fset of this.activeFootprintSets) {
499
+ for (const fset of this.getActiveFootprintSets()) {
488
500
  const pickResult = fset.getFootprintsFromPointer(this.mouseHelper);
489
501
  if (!pickResult?.footprints.length)
490
502
  continue;
@@ -574,19 +586,22 @@ class AstroSphere {
574
586
  return new HiPS(1, [0.0, 0.0, 0.0], 0, 0, hipsDescriptor, this._webgl, this._healpixGrid);
575
587
  }
576
588
  activateHiPS(hipsDescriptor) {
589
+ if (this._activeHiPSLayers.length > 0) {
590
+ throw new Error("Cannot load a HiPS base layer while stacked layers are active.");
591
+ }
577
592
  const tileBuffer = this._healpixGrid.visibleTilesManager.tileBuffer;
578
- for (const hips of this._activeHiPSLayers) {
579
- tileBuffer.removeHiPS(hips);
593
+ if (this._activeHiPS) {
594
+ tileBuffer.removeHiPS(this._activeHiPS);
580
595
  }
581
- this._activeHiPSLayers = [];
582
596
  const hips = this.createHiPS(hipsDescriptor);
583
- this._activeHiPSLayers.push(hips);
584
597
  this._activeHiPS = hips;
598
+ this._activeDomain = "astronomy";
585
599
  this._activeBaseLayer = "hips";
586
600
  return hips;
587
601
  }
588
602
  setHiPSOpacity(hips, opacity) {
589
- if (!this._activeHiPSLayers.includes(hips)) {
603
+ const isBaseLayer = this._activeHiPSLayers.length === 0 && this._activeHiPS === hips;
604
+ if (!isBaseLayer && !this._activeHiPSLayers.includes(hips)) {
590
605
  throw new Error("HiPS layer is not active in this AstroSphere.");
591
606
  }
592
607
  hips.setOpacity(opacity);
@@ -594,6 +609,13 @@ class AstroSphere {
594
609
  addHiPS(hipsDescriptor) {
595
610
  const normalizeURL = (url) => String(url).replace(/\/+$/, "");
596
611
  const descriptorURL = normalizeURL(hipsDescriptor.url);
612
+ // Entering stack mode discards the standalone base HiPS. Base mode and
613
+ // stack mode are intentionally mutually exclusive.
614
+ if (this._activeHiPSLayers.length === 0 && this._activeHiPS) {
615
+ const tileBuffer = this._healpixGrid.visibleTilesManager.tileBuffer;
616
+ tileBuffer.removeHiPS(this._activeHiPS);
617
+ this._activeHiPS = null;
618
+ }
597
619
  const existing = this._activeHiPSLayers.find((hips) => normalizeURL(hips.baseURL) === descriptorURL);
598
620
  if (existing) {
599
621
  throw new Error(`HiPS already active: ${String(hipsDescriptor.url)}`);
@@ -601,6 +623,7 @@ class AstroSphere {
601
623
  const hips = this.createHiPS(hipsDescriptor);
602
624
  this._activeHiPSLayers.push(hips);
603
625
  this._activeHiPS = hips;
626
+ this._activeDomain = "astronomy";
604
627
  this._activeBaseLayer = "hips";
605
628
  return hips;
606
629
  }
@@ -625,8 +648,13 @@ class AstroSphere {
625
648
  }
626
649
  removeAllHiPS() {
627
650
  const tileBuffer = this._healpixGrid.visibleTilesManager.tileBuffer;
628
- for (const hips of this._activeHiPSLayers) {
629
- tileBuffer.removeHiPS(hips);
651
+ if (this._activeHiPSLayers.length === 0 && this._activeHiPS) {
652
+ tileBuffer.removeHiPS(this._activeHiPS);
653
+ }
654
+ else {
655
+ for (const hips of this._activeHiPSLayers) {
656
+ tileBuffer.removeHiPS(hips);
657
+ }
630
658
  }
631
659
  this._activeHiPSLayers = [];
632
660
  this._activeHiPS = null;
@@ -639,39 +667,169 @@ class AstroSphere {
639
667
  this._activeBaseLayer = "xyz";
640
668
  }
641
669
  activateXYZ2(config) {
670
+ this._activeDomain = "earth";
642
671
  this._activeXYZ2 = new XYZMap(1, [0.0, 0.0, 0.0], 0, 0, config, this._webgl, this.gridLabelContainers);
643
672
  this._activeBaseLayer = "xyz";
644
673
  }
645
674
  activateMeshHiPS(descriptor) {
675
+ this._activeDomain = "mesh";
646
676
  this._activeMeshHiPS = new MeshHiPS(descriptor.meshRadius, [0.0, 0.0, 0.0], 0, 0, descriptor, this._webgl, this._healpixGrid);
647
677
  this._activeBaseLayer = "meships";
648
678
  }
679
+ setMeshHiPSColor(color) {
680
+ this._activeMeshHiPS?.setColor(color);
681
+ }
682
+ setMeshHiPSWireframe(wireframe) {
683
+ this._activeMeshHiPS?.setWireframe(wireframe);
684
+ }
649
685
  activateWMTS(config) {
686
+ this._activeDomain = "earth";
650
687
  const adapter = new WMTSAdapter(config);
651
688
  const xyzConfig = adapter.toXYZLayerConfig();
652
689
  this._activeXYZ2 = new XYZMap(1, [0.0, 0.0, 0.0], 0, 0, new XYZMapDescriptor(config.layer ? `WMTS ${config.layer}` : "WMTS Earth2 Layer", xyzConfig.urlTemplate, xyzConfig.minZoom ?? 0, xyzConfig.maxZoom ?? 8, xyzConfig.segmentsPerSide ?? 48, xyzConfig.maxCachedTiles ?? 384, 8, xyzConfig.urlResolver), this._webgl, this.gridLabelContainers);
653
690
  this._activeBaseLayer = "xyz";
654
691
  }
655
- // Catalogue section
692
+ addXYZRasterOverlay(config) {
693
+ const map = new XYZMap(1, [0.0, 0.0, 0.0], 0, 0, config, this._webgl, this.gridLabelContainers);
694
+ return this.addEarthRasterOverlay(config.name, "xyz", map);
695
+ }
696
+ addWMTSRasterOverlay(config) {
697
+ const adapter = new WMTSAdapter(config);
698
+ const xyzConfig = adapter.toXYZLayerConfig();
699
+ const name = config.layer ? `WMTS ${config.layer}` : "WMTS Earth Raster Overlay";
700
+ const map = new XYZMap(1, [0.0, 0.0, 0.0], 0, 0, new XYZMapDescriptor(name, xyzConfig.urlTemplate, xyzConfig.minZoom ?? 0, xyzConfig.maxZoom ?? 8, xyzConfig.segmentsPerSide ?? 48, xyzConfig.maxCachedTiles ?? 384, 8, xyzConfig.urlResolver), this._webgl, this.gridLabelContainers);
701
+ return this.addEarthRasterOverlay(name, "wmts", map);
702
+ }
703
+ getEarthRasterOverlays() {
704
+ return this._earthRasterOverlays.map(({ map: _map, ...overlay }) => ({ ...overlay }));
705
+ }
706
+ setEarthRasterOverlayOpacity(id, opacity) {
707
+ const overlay = this._earthRasterOverlays.find((entry) => entry.id === id);
708
+ if (!overlay)
709
+ return;
710
+ overlay.opacity = Math.min(1, Math.max(0, opacity));
711
+ overlay.map.setOpacity(overlay.opacity);
712
+ }
713
+ setEarthRasterOverlayVisible(id, visible) {
714
+ const overlay = this._earthRasterOverlays.find((entry) => entry.id === id);
715
+ if (overlay)
716
+ overlay.visible = visible;
717
+ }
718
+ removeEarthRasterOverlay(id) {
719
+ this._earthRasterOverlays = this._earthRasterOverlays.filter((entry) => entry.id !== id);
720
+ }
721
+ removeAllEarthRasterOverlays() {
722
+ this._earthRasterOverlays = [];
723
+ }
724
+ addEarthRasterOverlay(name, sourceType, map) {
725
+ const overlay = {
726
+ id: `earth-raster-${++this._earthRasterOverlaySequence}`,
727
+ name,
728
+ sourceType,
729
+ visible: true,
730
+ opacity: 0.65,
731
+ map,
732
+ };
733
+ map.setOpacity(overlay.opacity);
734
+ this._earthRasterOverlays.push(overlay);
735
+ const { map: _map, ...info } = overlay;
736
+ return { ...info };
737
+ }
738
+ setActiveDomain(domain) {
739
+ if (domain !== this._activeDomain) {
740
+ this.clearGridLabelsForDomain(this._activeDomain);
741
+ this.domainCameraStates[this._activeDomain] = this._camera.getViewState();
742
+ const targetCameraState = this.domainCameraStates[domain];
743
+ if (targetCameraState) {
744
+ this._camera.restoreViewState(targetCameraState);
745
+ }
746
+ this.inertiaX = 0;
747
+ this.inertiaY = 0;
748
+ this.zoomInertia = 0;
749
+ this._cameraStatusChanged = true;
750
+ }
751
+ this._activeDomain = domain;
752
+ if (domain === "astronomy") {
753
+ this._activeBaseLayer = this._activeHiPS ? "hips" : null;
754
+ }
755
+ else if (domain === "earth") {
756
+ this._activeBaseLayer = this._activeXYZ2 ? "xyz" : null;
757
+ }
758
+ else {
759
+ this._activeBaseLayer = this._activeMeshHiPS ? "meships" : null;
760
+ }
761
+ // A hover from the previous vertical must not leak into the new one.
762
+ this.lastHoveredSource = null;
763
+ this.lastHoveredCatalogue = null;
764
+ }
765
+ clearGridLabelsForDomain(domain) {
766
+ if (domain === "astronomy") {
767
+ this._healpixGrid?.clearLabels();
768
+ this._equatorialGrid?.clearLabels();
769
+ return;
770
+ }
771
+ if (domain === "earth") {
772
+ this._activeXYZ2?.clearLonLatGridLabels?.();
773
+ }
774
+ }
775
+ get activeDomain() {
776
+ return this._activeDomain;
777
+ }
778
+ getActivePointSets() {
779
+ if (this._activeDomain === "astronomy")
780
+ return this.astronomyCatalogues;
781
+ if (this._activeDomain === "earth")
782
+ return this.earthPointSets;
783
+ return [];
784
+ }
785
+ getActiveFootprintSets() {
786
+ if (this._activeDomain === "astronomy")
787
+ return this.astronomyFootprintSets;
788
+ if (this._activeDomain === "earth")
789
+ return this.earthFootprintSets;
790
+ return [];
791
+ }
792
+ // Astronomy catalogue ownership
656
793
  async showCatalogue(cat) {
657
- // console.log(cat)
658
- if (cat)
659
- this.activeCatalogues.push(cat);
794
+ if (cat && !this.astronomyCatalogues.includes(cat)) {
795
+ this.astronomyCatalogues.push(cat);
796
+ }
660
797
  return cat;
661
798
  }
662
799
  deleteCatalogue(catalogue) {
663
- this.activeCatalogues = this.activeCatalogues.filter((c) => c !== catalogue);
800
+ this.astronomyCatalogues = this.astronomyCatalogues.filter((c) => c !== catalogue);
801
+ }
802
+ // Earth point-set ownership. TerraPointSetGL still extends CatalogueGL in
803
+ // 3.12, but it no longer shares the Astronomy lifecycle collection.
804
+ async showTerraPointSet(pointSet) {
805
+ if (pointSet && !this.earthPointSets.includes(pointSet)) {
806
+ this.earthPointSets.push(pointSet);
807
+ }
808
+ return pointSet;
809
+ }
810
+ deleteTerraPointSet(pointSet) {
811
+ this.earthPointSets = this.earthPointSets.filter((set) => set !== pointSet);
664
812
  }
665
- // End Catalogue section
666
- // Footprint section
813
+ // Astronomy footprint ownership
667
814
  async showFootprintSet(fset) {
668
- // console.log(fset)
669
- if (fset)
670
- this.activeFootprintSets.push(fset);
815
+ if (fset && !this.astronomyFootprintSets.includes(fset)) {
816
+ this.astronomyFootprintSets.push(fset);
817
+ }
671
818
  return fset;
672
819
  }
673
820
  deleteFootprintSet(footprintSet) {
674
- this.activeFootprintSets = this.activeFootprintSets.filter((fst) => fst !== footprintSet);
821
+ this.astronomyFootprintSets = this.astronomyFootprintSets.filter((fst) => fst !== footprintSet);
822
+ }
823
+ // Earth footprint ownership. TerraFootprintSetGL still reuses the common
824
+ // FootprintSetGL rendering implementation, but has an independent lifecycle.
825
+ async showTerraFootprintSet(footprintSet) {
826
+ if (footprintSet && !this.earthFootprintSets.includes(footprintSet)) {
827
+ this.earthFootprintSets.push(footprintSet);
828
+ }
829
+ return footprintSet;
830
+ }
831
+ deleteTerraFootprintSet(footprintSet) {
832
+ this.earthFootprintSets = this.earthFootprintSets.filter((fst) => fst !== footprintSet);
675
833
  }
676
834
  async showPolylineSet(polylineSet) {
677
835
  if (polylineSet)
@@ -701,8 +859,8 @@ class AstroSphere {
701
859
  satelliteObject.dispose();
702
860
  }
703
861
  getHoveredFootprints() {
704
- let footprintsHovered = [];
705
- this.activeFootprintSets.forEach((fset) => {
862
+ const footprintsHovered = [];
863
+ this.getActiveFootprintSets().forEach((fset) => {
706
864
  footprintsHovered.push(fset.hoveredFootprints);
707
865
  });
708
866
  return footprintsHovered;
@@ -711,6 +869,9 @@ class AstroSphere {
711
869
  goTo(raDeg, decDeg) {
712
870
  this._camera.goTo(raDeg, decDeg);
713
871
  }
872
+ flyTo(raDeg, decDeg, durationMs = 1200) {
873
+ this._camera.flyTo(raDeg, decDeg, durationMs);
874
+ }
714
875
  getActiveCoordinateMode() {
715
876
  if (this._activeBaseLayer === "xyz") {
716
877
  return "lonlat";
@@ -931,8 +1092,6 @@ class AstroSphere {
931
1092
  return;
932
1093
  if (!this._webgl)
933
1094
  return;
934
- if (!this._activeHiPS && !this._activeXYZ2 && !this._activeMeshHiPS)
935
- return;
936
1095
  if (!this._healpixGrid || Object.keys(this._healpixGrid).length === 0)
937
1096
  return;
938
1097
  if (this._healpixGrid.fovObj === undefined)
@@ -946,6 +1105,16 @@ class AstroSphere {
946
1105
  let PHI = 0;
947
1106
  this._webgl.viewport(0, 0, this._webgl.drawingBufferWidth, this._webgl.drawingBufferHeight);
948
1107
  this._webgl.clear(this._webgl.COLOR_BUFFER_BIT | this._webgl.DEPTH_BUFFER_BIT);
1108
+ const now = performance.now();
1109
+ const cameraFlying = this._camera.updateFlyTo(now);
1110
+ if (cameraFlying) {
1111
+ this.inertiaX = 0;
1112
+ this.inertiaY = 0;
1113
+ this.lastCameraMotionAt = now;
1114
+ this._cameraStatusChanged = true;
1115
+ this.updateCentralPoint();
1116
+ this._perspectiveMatrixManager.computePerspectiveMatrix(canvas, this._camera, bootSetup.camera_fov_deg, bootSetup.camera_near_plane, global.insideSphere);
1117
+ }
949
1118
  // Zoom inertia
950
1119
  if (this.zoomInertia !== 0) {
951
1120
  if (Math.abs(this.zoomInertia) > 0.0001) {
@@ -1034,8 +1203,10 @@ class AstroSphere {
1034
1203
  this._webgl.enable(this._webgl.CULL_FACE);
1035
1204
  this._webgl.cullFace(global.insideSphere ? this._webgl.FRONT : this._webgl.BACK);
1036
1205
  this._webgl.blendFunc(this._webgl.SRC_ALPHA, this._webgl.ONE_MINUS_SRC_ALPHA);
1037
- if (this._activeBaseLayer === "hips" && this._activeHiPSLayers.length > 0) {
1038
- const maxHiPSOrder = Math.max(...this._activeHiPSLayers.map((hips) => hips.maxOrder));
1206
+ if (this._activeBaseLayer === "hips" && this._activeHiPS) {
1207
+ const maxHiPSOrder = this._activeHiPSLayers.length > 0
1208
+ ? Math.max(...this._activeHiPSLayers.map((hips) => hips.maxOrder))
1209
+ : this._activeHiPS.maxOrder;
1039
1210
  const visibleOrder = Math.min(this._healpixGrid.visibleorder, maxHiPSOrder);
1040
1211
  this._healpixGrid.visibleTilesManager.computeVisiblePixels(visibleOrder, this._webgl, this._camera, this._perspectiveMatrixManager.pMatrix);
1041
1212
  }
@@ -1070,12 +1241,19 @@ class AstroSphere {
1070
1241
  }
1071
1242
  if (this._activeBaseLayer === "xyz") {
1072
1243
  this._activeXYZ2?.draw(skyEntityDrawInput);
1244
+ for (const overlay of this._earthRasterOverlays) {
1245
+ if (overlay.visible) {
1246
+ overlay.map.draw(skyEntityDrawInput, true);
1247
+ }
1248
+ }
1073
1249
  }
1074
1250
  if (this._activeBaseLayer === "meships") {
1075
1251
  this._activeMeshHiPS?.draw(skyEntityDrawInput);
1076
1252
  }
1077
- this._healpixGrid.draw(skyEntityDrawInput);
1078
- this._equatorialGrid.draw(skyEntityDrawInput);
1253
+ if (this._activeDomain === "astronomy") {
1254
+ this._healpixGrid.draw(skyEntityDrawInput);
1255
+ this._equatorialGrid.draw(skyEntityDrawInput);
1256
+ }
1079
1257
  this._webgl.enable(this._webgl.DEPTH_TEST);
1080
1258
  this._webgl.disable(this._webgl.CULL_FACE);
1081
1259
  if (this.startup) {
@@ -1094,52 +1272,53 @@ class AstroSphere {
1094
1272
  decDMS,
1095
1273
  });
1096
1274
  }
1097
- this.activeCatalogues.forEach((cat) => {
1098
- const activeModelMatrix = this._activeHiPS?.getModelMatrix() ??
1099
- this._activeXYZ2?.getModelMatrix() ??
1100
- this._activeMeshHiPS?.getModelMatrix();
1275
+ this.getActivePointSets().forEach((cat) => {
1276
+ const activeModelMatrix = this.getActiveDomainModelMatrix();
1101
1277
  if (activeModelMatrix) {
1102
1278
  cat.draw(activeModelMatrix, this.mouseHelper, this._camera.getCameraMatrix(), this._perspectiveMatrixManager.pMatrix);
1103
1279
  }
1104
1280
  });
1105
1281
  this.emitHoveredSourceIfChanged();
1106
- this.activeFootprintSets.forEach((fst) => {
1107
- const activeModelMatrix = this._activeHiPS?.getModelMatrix() ??
1108
- this._activeXYZ2?.getModelMatrix() ??
1109
- this._activeMeshHiPS?.getModelMatrix();
1282
+ this.getActiveFootprintSets().forEach((fst) => {
1283
+ const activeModelMatrix = this.getActiveDomainModelMatrix();
1110
1284
  if (activeModelMatrix) {
1111
1285
  fst.draw(activeModelMatrix, this.mouseHelper, this._camera.getCameraMatrix(), this._perspectiveMatrixManager.pMatrix);
1112
1286
  }
1113
1287
  });
1114
- this.activePolylineSets.forEach((polylineSet) => {
1115
- const activeModelMatrix = this._activeHiPS?.getModelMatrix() ??
1116
- this._activeXYZ2?.getModelMatrix() ??
1117
- this._activeMeshHiPS?.getModelMatrix();
1118
- if (activeModelMatrix) {
1119
- polylineSet.draw(activeModelMatrix, this.mouseHelper, this._camera.getCameraMatrix(), this._perspectiveMatrixManager.pMatrix);
1120
- }
1121
- });
1122
- this.activeSensorCones.forEach((sensorCone) => {
1123
- const activeModelMatrix = this._activeHiPS?.getModelMatrix() ??
1124
- this._activeXYZ2?.getModelMatrix() ??
1125
- this._activeMeshHiPS?.getModelMatrix();
1126
- if (activeModelMatrix) {
1127
- sensorCone.draw(this._perspectiveMatrixManager.pMatrix, this._camera.getCameraMatrix(), activeModelMatrix);
1128
- }
1129
- });
1130
- this.activeSatelliteObjects.forEach((satelliteObject) => {
1131
- const activeModelMatrix = this._activeHiPS?.getModelMatrix() ??
1132
- this._activeXYZ2?.getModelMatrix() ??
1133
- this._activeMeshHiPS?.getModelMatrix();
1134
- if (activeModelMatrix) {
1135
- satelliteObject.draw(this._perspectiveMatrixManager.pMatrix, this._camera.getCameraMatrix(), activeModelMatrix);
1136
- }
1137
- });
1288
+ if (this._activeDomain === "earth") {
1289
+ this.activePolylineSets.forEach((polylineSet) => {
1290
+ const activeModelMatrix = this.getActiveDomainModelMatrix();
1291
+ if (activeModelMatrix) {
1292
+ polylineSet.draw(activeModelMatrix, this.mouseHelper, this._camera.getCameraMatrix(), this._perspectiveMatrixManager.pMatrix);
1293
+ }
1294
+ });
1295
+ this.activeSensorCones.forEach((sensorCone) => {
1296
+ const activeModelMatrix = this.getActiveDomainModelMatrix();
1297
+ if (activeModelMatrix) {
1298
+ sensorCone.draw(this._perspectiveMatrixManager.pMatrix, this._camera.getCameraMatrix(), activeModelMatrix);
1299
+ }
1300
+ });
1301
+ this.activeSatelliteObjects.forEach((satelliteObject) => {
1302
+ const activeModelMatrix = this.getActiveDomainModelMatrix();
1303
+ if (activeModelMatrix) {
1304
+ satelliteObject.draw(this._perspectiveMatrixManager.pMatrix, this._camera.getCameraMatrix(), activeModelMatrix);
1305
+ }
1306
+ });
1307
+ }
1308
+ }
1309
+ getActiveDomainModelMatrix() {
1310
+ if (this._activeDomain === "astronomy") {
1311
+ return (this._activeHiPS?.getModelMatrix() ?? this._healpixGrid.getModelMatrix());
1312
+ }
1313
+ if (this._activeDomain === "earth") {
1314
+ return (this._activeXYZ2?.getModelMatrix() ?? this._healpixGrid.getModelMatrix());
1315
+ }
1316
+ return (this._activeMeshHiPS?.getModelMatrix() ?? this._healpixGrid.getModelMatrix());
1138
1317
  }
1139
1318
  emitHoveredSourceIfChanged() {
1140
1319
  let nextHoveredSource = null;
1141
1320
  let nextHoveredCatalogue = null;
1142
- for (const cat of this.activeCatalogues) {
1321
+ for (const cat of this.getActivePointSets()) {
1143
1322
  const hovered = cat.getPrimaryHoveredSource();
1144
1323
  if (!hovered)
1145
1324
  continue;