astro-viewer 3.11.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 (72) hide show
  1. package/dist/astroviewer.cjs +561 -149
  2. package/dist/astroviewer.cjs.map +1 -1
  3. package/dist/astroviewer.js +561 -149
  4. package/dist/astroviewer.js.map +1 -1
  5. package/dist/astroviewer.min.js +1 -1
  6. package/dist/astroviewer.min.js.map +1 -1
  7. package/lib-esm/AstroSphere.d.ts +36 -2
  8. package/lib-esm/AstroSphere.d.ts.map +1 -1
  9. package/lib-esm/AstroSphere.js +234 -70
  10. package/lib-esm/AstroSphere.js.map +1 -1
  11. package/lib-esm/AstroViewer.d.ts +14 -1
  12. package/lib-esm/AstroViewer.d.ts.map +1 -1
  13. package/lib-esm/AstroViewer.js +38 -4
  14. package/lib-esm/AstroViewer.js.map +1 -1
  15. package/lib-esm/Camera.d.ts +8 -0
  16. package/lib-esm/Camera.d.ts.map +1 -1
  17. package/lib-esm/Camera.js +16 -0
  18. package/lib-esm/Camera.js.map +1 -1
  19. package/lib-esm/index.d.ts +1 -0
  20. package/lib-esm/index.d.ts.map +1 -1
  21. package/lib-esm/index.js +1 -0
  22. package/lib-esm/index.js.map +1 -1
  23. package/lib-esm/model/Source.js +1 -1
  24. package/lib-esm/model/Source.js.map +1 -1
  25. package/lib-esm/model/catalogues/CatalogueGL.d.ts +13 -4
  26. package/lib-esm/model/catalogues/CatalogueGL.d.ts.map +1 -1
  27. package/lib-esm/model/catalogues/CatalogueGL.js +109 -59
  28. package/lib-esm/model/catalogues/CatalogueGL.js.map +1 -1
  29. package/lib-esm/model/earth/XYZMap.d.ts +4 -1
  30. package/lib-esm/model/earth/XYZMap.d.ts.map +1 -1
  31. package/lib-esm/model/earth/XYZMap.js +35 -2
  32. package/lib-esm/model/earth/XYZMap.js.map +1 -1
  33. package/lib-esm/model/footprints/FootprintSetGL.d.ts +1 -0
  34. package/lib-esm/model/footprints/FootprintSetGL.d.ts.map +1 -1
  35. package/lib-esm/model/footprints/FootprintSetGL.js +13 -3
  36. package/lib-esm/model/footprints/FootprintSetGL.js.map +1 -1
  37. package/lib-esm/model/grid/EquatorialGrid.d.ts +1 -0
  38. package/lib-esm/model/grid/EquatorialGrid.d.ts.map +1 -1
  39. package/lib-esm/model/grid/EquatorialGrid.js +3 -0
  40. package/lib-esm/model/grid/EquatorialGrid.js.map +1 -1
  41. package/lib-esm/model/grid/HealpixGrid.d.ts +1 -0
  42. package/lib-esm/model/grid/HealpixGrid.d.ts.map +1 -1
  43. package/lib-esm/model/grid/HealpixGrid.js +3 -0
  44. package/lib-esm/model/grid/HealpixGrid.js.map +1 -1
  45. package/lib-esm/model/grid/LonLatGrid.d.ts +1 -0
  46. package/lib-esm/model/grid/LonLatGrid.d.ts.map +1 -1
  47. package/lib-esm/model/grid/LonLatGrid.js +3 -0
  48. package/lib-esm/model/grid/LonLatGrid.js.map +1 -1
  49. package/lib-esm/model/meships/MeshHiPS.d.ts +4 -0
  50. package/lib-esm/model/meships/MeshHiPS.d.ts.map +1 -1
  51. package/lib-esm/model/meships/MeshHiPS.js +11 -1
  52. package/lib-esm/model/meships/MeshHiPS.js.map +1 -1
  53. package/lib-esm/model/terra/TerraPointSetGL.d.ts +1 -0
  54. package/lib-esm/model/terra/TerraPointSetGL.d.ts.map +1 -1
  55. package/lib-esm/model/terra/TerraPointSetGL.js +39 -1
  56. package/lib-esm/model/terra/TerraPointSetGL.js.map +1 -1
  57. package/lib-esm/shader/CatalogueShaderProgram.d.ts +4 -0
  58. package/lib-esm/shader/CatalogueShaderProgram.d.ts.map +1 -1
  59. package/lib-esm/shader/CatalogueShaderProgram.js +6 -0
  60. package/lib-esm/shader/CatalogueShaderProgram.js.map +1 -1
  61. package/lib-esm/shader/ShaderManager.d.ts.map +1 -1
  62. package/lib-esm/shader/ShaderManager.js +7 -4
  63. package/lib-esm/shader/ShaderManager.js.map +1 -1
  64. package/lib-esm/shader/XYZShaderProgram.d.ts +3 -0
  65. package/lib-esm/shader/XYZShaderProgram.d.ts.map +1 -1
  66. package/lib-esm/shader/XYZShaderProgram.js +11 -3
  67. package/lib-esm/shader/XYZShaderProgram.js.map +1 -1
  68. package/lib-esm/utils/Utils.d.ts +12 -0
  69. package/lib-esm/utils/Utils.d.ts.map +1 -1
  70. package/lib-esm/utils/Utils.js +26 -0
  71. package/lib-esm/utils/Utils.js.map +1 -1
  72. 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>;
@@ -178,6 +211,7 @@ declare class AstroSphere {
178
211
  getHiPSDebugStats(): HiPSDebugStats | null;
179
212
  getMeshHiPSDebugStats(): MeshHiPSDebugStats | null;
180
213
  draw(canvas: HTMLCanvasElement): void;
214
+ private getActiveDomainModelMatrix;
181
215
  private emitHoveredSourceIfChanged;
182
216
  }
183
217
  export default AstroSphere;
@@ -1 +1 @@
1
- {"version":3,"file":"AstroSphere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AG,IAAI;IAyCrD,cAAc,CAAC,EAAE,EAAE,QAAQ;IAO3B,OAAO,CAAC,OAAO,CAAa;IAC5B,OAAO,CAAC,gBAAgB,CAAuB;IAC/C,OAAO,CAAC,iBAAiB,CAAuB;IAEhD,IAAI,UAAU,IAAI,IAAI,GAAG,IAAI,CAE5B;IAED,IAAI,gBAAgB,IAAI,SAAS,IAAI,EAAE,CAEtC;IAED,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAS/B,IAAI,SAAS,IAAI,MAAM,GAAG,IAAI,CAE7B;IAED,IAAI,cAAc,IAAI,QAAQ,GAAG,IAAI,CAEpC;IAED,mBAAmB,IAAI,OAAO;IAI9B,gBAAgB,IAAI,OAAO;IAI3B,yBAAyB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;IAQhD,wBAAwB,IAAI,OAAO;IAInC,2BAA2B,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;IAQlD,0BAA0B,IAAI,OAAO;IAIrC,gBAAgB,IAAI,aAAa;IAQjC,iBAAiB,IAAI,cAAc,GAAG,IAAI;IAK1C,qBAAqB,IAAI,kBAAkB,GAAG,IAAI;IAKlD,IAAI,CAAC,MAAM,EAAE,iBAAiB;IAmV9B,OAAO,CAAC,0BAA0B;IAgBlC,OAAO,CAAC,0BAA0B;CA4BnC;AACD,eAAe,WAAW,CAAC"}
@@ -54,12 +54,18 @@ class AstroSphere {
54
54
  _activeHiPS = null;
55
55
  _activeHiPSLayers = [];
56
56
  _activeXYZ2 = null;
57
+ _earthRasterOverlays = [];
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();
@@ -359,8 +363,11 @@ class AstroSphere {
359
363
  if (mousePoint && mousePoint.length > 0) {
360
364
  this.mouseHelper.update(mousePoint);
361
365
  this.updateLastMousePoint();
362
- for (const cat of this.activeCatalogues) {
363
- 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);
364
371
  if (!clickResult?.sources.length)
365
372
  continue;
366
373
  this._webgl.canvas.dispatchEvent(new CustomEvent("source-clicked", {
@@ -373,7 +380,7 @@ class AstroSphere {
373
380
  composed: true,
374
381
  }));
375
382
  }
376
- for (const fset of this.activeFootprintSets) {
383
+ for (const fset of this.getActiveFootprintSets()) {
377
384
  const clickResult = fset.selectPrimaryFootprintFromClick(this.mouseHelper);
378
385
  if (!clickResult?.footprints.length)
379
386
  continue;
@@ -470,8 +477,11 @@ class AstroSphere {
470
477
  }
471
478
  this.mouseHelper.update(mousePoint);
472
479
  this.updateLastMousePoint();
473
- for (const cat of this.activeCatalogues) {
474
- 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);
475
485
  if (!pickResult?.sources.length)
476
486
  continue;
477
487
  this._webgl.canvas.dispatchEvent(new CustomEvent("source-contextmenu", {
@@ -486,7 +496,7 @@ class AstroSphere {
486
496
  }));
487
497
  break;
488
498
  }
489
- for (const fset of this.activeFootprintSets) {
499
+ for (const fset of this.getActiveFootprintSets()) {
490
500
  const pickResult = fset.getFootprintsFromPointer(this.mouseHelper);
491
501
  if (!pickResult?.footprints.length)
492
502
  continue;
@@ -576,19 +586,22 @@ class AstroSphere {
576
586
  return new HiPS(1, [0.0, 0.0, 0.0], 0, 0, hipsDescriptor, this._webgl, this._healpixGrid);
577
587
  }
578
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
+ }
579
592
  const tileBuffer = this._healpixGrid.visibleTilesManager.tileBuffer;
580
- for (const hips of this._activeHiPSLayers) {
581
- tileBuffer.removeHiPS(hips);
593
+ if (this._activeHiPS) {
594
+ tileBuffer.removeHiPS(this._activeHiPS);
582
595
  }
583
- this._activeHiPSLayers = [];
584
596
  const hips = this.createHiPS(hipsDescriptor);
585
- this._activeHiPSLayers.push(hips);
586
597
  this._activeHiPS = hips;
598
+ this._activeDomain = "astronomy";
587
599
  this._activeBaseLayer = "hips";
588
600
  return hips;
589
601
  }
590
602
  setHiPSOpacity(hips, opacity) {
591
- if (!this._activeHiPSLayers.includes(hips)) {
603
+ const isBaseLayer = this._activeHiPSLayers.length === 0 && this._activeHiPS === hips;
604
+ if (!isBaseLayer && !this._activeHiPSLayers.includes(hips)) {
592
605
  throw new Error("HiPS layer is not active in this AstroSphere.");
593
606
  }
594
607
  hips.setOpacity(opacity);
@@ -596,6 +609,13 @@ class AstroSphere {
596
609
  addHiPS(hipsDescriptor) {
597
610
  const normalizeURL = (url) => String(url).replace(/\/+$/, "");
598
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
+ }
599
619
  const existing = this._activeHiPSLayers.find((hips) => normalizeURL(hips.baseURL) === descriptorURL);
600
620
  if (existing) {
601
621
  throw new Error(`HiPS already active: ${String(hipsDescriptor.url)}`);
@@ -603,6 +623,7 @@ class AstroSphere {
603
623
  const hips = this.createHiPS(hipsDescriptor);
604
624
  this._activeHiPSLayers.push(hips);
605
625
  this._activeHiPS = hips;
626
+ this._activeDomain = "astronomy";
606
627
  this._activeBaseLayer = "hips";
607
628
  return hips;
608
629
  }
@@ -627,8 +648,13 @@ class AstroSphere {
627
648
  }
628
649
  removeAllHiPS() {
629
650
  const tileBuffer = this._healpixGrid.visibleTilesManager.tileBuffer;
630
- for (const hips of this._activeHiPSLayers) {
631
- 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
+ }
632
658
  }
633
659
  this._activeHiPSLayers = [];
634
660
  this._activeHiPS = null;
@@ -641,39 +667,169 @@ class AstroSphere {
641
667
  this._activeBaseLayer = "xyz";
642
668
  }
643
669
  activateXYZ2(config) {
670
+ this._activeDomain = "earth";
644
671
  this._activeXYZ2 = new XYZMap(1, [0.0, 0.0, 0.0], 0, 0, config, this._webgl, this.gridLabelContainers);
645
672
  this._activeBaseLayer = "xyz";
646
673
  }
647
674
  activateMeshHiPS(descriptor) {
675
+ this._activeDomain = "mesh";
648
676
  this._activeMeshHiPS = new MeshHiPS(descriptor.meshRadius, [0.0, 0.0, 0.0], 0, 0, descriptor, this._webgl, this._healpixGrid);
649
677
  this._activeBaseLayer = "meships";
650
678
  }
679
+ setMeshHiPSColor(color) {
680
+ this._activeMeshHiPS?.setColor(color);
681
+ }
682
+ setMeshHiPSWireframe(wireframe) {
683
+ this._activeMeshHiPS?.setWireframe(wireframe);
684
+ }
651
685
  activateWMTS(config) {
686
+ this._activeDomain = "earth";
652
687
  const adapter = new WMTSAdapter(config);
653
688
  const xyzConfig = adapter.toXYZLayerConfig();
654
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);
655
690
  this._activeBaseLayer = "xyz";
656
691
  }
657
- // 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
658
793
  async showCatalogue(cat) {
659
- // console.log(cat)
660
- if (cat)
661
- this.activeCatalogues.push(cat);
794
+ if (cat && !this.astronomyCatalogues.includes(cat)) {
795
+ this.astronomyCatalogues.push(cat);
796
+ }
662
797
  return cat;
663
798
  }
664
799
  deleteCatalogue(catalogue) {
665
- this.activeCatalogues = this.activeCatalogues.filter((c) => c !== catalogue);
800
+ this.astronomyCatalogues = this.astronomyCatalogues.filter((c) => c !== catalogue);
666
801
  }
667
- // End Catalogue section
668
- // Footprint section
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);
812
+ }
813
+ // Astronomy footprint ownership
669
814
  async showFootprintSet(fset) {
670
- // console.log(fset)
671
- if (fset)
672
- this.activeFootprintSets.push(fset);
815
+ if (fset && !this.astronomyFootprintSets.includes(fset)) {
816
+ this.astronomyFootprintSets.push(fset);
817
+ }
673
818
  return fset;
674
819
  }
675
820
  deleteFootprintSet(footprintSet) {
676
- 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);
677
833
  }
678
834
  async showPolylineSet(polylineSet) {
679
835
  if (polylineSet)
@@ -703,8 +859,8 @@ class AstroSphere {
703
859
  satelliteObject.dispose();
704
860
  }
705
861
  getHoveredFootprints() {
706
- let footprintsHovered = [];
707
- this.activeFootprintSets.forEach((fset) => {
862
+ const footprintsHovered = [];
863
+ this.getActiveFootprintSets().forEach((fset) => {
708
864
  footprintsHovered.push(fset.hoveredFootprints);
709
865
  });
710
866
  return footprintsHovered;
@@ -936,8 +1092,6 @@ class AstroSphere {
936
1092
  return;
937
1093
  if (!this._webgl)
938
1094
  return;
939
- if (!this._activeHiPS && !this._activeXYZ2 && !this._activeMeshHiPS)
940
- return;
941
1095
  if (!this._healpixGrid || Object.keys(this._healpixGrid).length === 0)
942
1096
  return;
943
1097
  if (this._healpixGrid.fovObj === undefined)
@@ -1049,8 +1203,10 @@ class AstroSphere {
1049
1203
  this._webgl.enable(this._webgl.CULL_FACE);
1050
1204
  this._webgl.cullFace(global.insideSphere ? this._webgl.FRONT : this._webgl.BACK);
1051
1205
  this._webgl.blendFunc(this._webgl.SRC_ALPHA, this._webgl.ONE_MINUS_SRC_ALPHA);
1052
- if (this._activeBaseLayer === "hips" && this._activeHiPSLayers.length > 0) {
1053
- 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;
1054
1210
  const visibleOrder = Math.min(this._healpixGrid.visibleorder, maxHiPSOrder);
1055
1211
  this._healpixGrid.visibleTilesManager.computeVisiblePixels(visibleOrder, this._webgl, this._camera, this._perspectiveMatrixManager.pMatrix);
1056
1212
  }
@@ -1085,12 +1241,19 @@ class AstroSphere {
1085
1241
  }
1086
1242
  if (this._activeBaseLayer === "xyz") {
1087
1243
  this._activeXYZ2?.draw(skyEntityDrawInput);
1244
+ for (const overlay of this._earthRasterOverlays) {
1245
+ if (overlay.visible) {
1246
+ overlay.map.draw(skyEntityDrawInput, true);
1247
+ }
1248
+ }
1088
1249
  }
1089
1250
  if (this._activeBaseLayer === "meships") {
1090
1251
  this._activeMeshHiPS?.draw(skyEntityDrawInput);
1091
1252
  }
1092
- this._healpixGrid.draw(skyEntityDrawInput);
1093
- this._equatorialGrid.draw(skyEntityDrawInput);
1253
+ if (this._activeDomain === "astronomy") {
1254
+ this._healpixGrid.draw(skyEntityDrawInput);
1255
+ this._equatorialGrid.draw(skyEntityDrawInput);
1256
+ }
1094
1257
  this._webgl.enable(this._webgl.DEPTH_TEST);
1095
1258
  this._webgl.disable(this._webgl.CULL_FACE);
1096
1259
  if (this.startup) {
@@ -1109,52 +1272,53 @@ class AstroSphere {
1109
1272
  decDMS,
1110
1273
  });
1111
1274
  }
1112
- this.activeCatalogues.forEach((cat) => {
1113
- const activeModelMatrix = this._activeHiPS?.getModelMatrix() ??
1114
- this._activeXYZ2?.getModelMatrix() ??
1115
- this._activeMeshHiPS?.getModelMatrix();
1275
+ this.getActivePointSets().forEach((cat) => {
1276
+ const activeModelMatrix = this.getActiveDomainModelMatrix();
1116
1277
  if (activeModelMatrix) {
1117
1278
  cat.draw(activeModelMatrix, this.mouseHelper, this._camera.getCameraMatrix(), this._perspectiveMatrixManager.pMatrix);
1118
1279
  }
1119
1280
  });
1120
1281
  this.emitHoveredSourceIfChanged();
1121
- this.activeFootprintSets.forEach((fst) => {
1122
- const activeModelMatrix = this._activeHiPS?.getModelMatrix() ??
1123
- this._activeXYZ2?.getModelMatrix() ??
1124
- this._activeMeshHiPS?.getModelMatrix();
1282
+ this.getActiveFootprintSets().forEach((fst) => {
1283
+ const activeModelMatrix = this.getActiveDomainModelMatrix();
1125
1284
  if (activeModelMatrix) {
1126
1285
  fst.draw(activeModelMatrix, this.mouseHelper, this._camera.getCameraMatrix(), this._perspectiveMatrixManager.pMatrix);
1127
1286
  }
1128
1287
  });
1129
- this.activePolylineSets.forEach((polylineSet) => {
1130
- const activeModelMatrix = this._activeHiPS?.getModelMatrix() ??
1131
- this._activeXYZ2?.getModelMatrix() ??
1132
- this._activeMeshHiPS?.getModelMatrix();
1133
- if (activeModelMatrix) {
1134
- polylineSet.draw(activeModelMatrix, this.mouseHelper, this._camera.getCameraMatrix(), this._perspectiveMatrixManager.pMatrix);
1135
- }
1136
- });
1137
- this.activeSensorCones.forEach((sensorCone) => {
1138
- const activeModelMatrix = this._activeHiPS?.getModelMatrix() ??
1139
- this._activeXYZ2?.getModelMatrix() ??
1140
- this._activeMeshHiPS?.getModelMatrix();
1141
- if (activeModelMatrix) {
1142
- sensorCone.draw(this._perspectiveMatrixManager.pMatrix, this._camera.getCameraMatrix(), activeModelMatrix);
1143
- }
1144
- });
1145
- this.activeSatelliteObjects.forEach((satelliteObject) => {
1146
- const activeModelMatrix = this._activeHiPS?.getModelMatrix() ??
1147
- this._activeXYZ2?.getModelMatrix() ??
1148
- this._activeMeshHiPS?.getModelMatrix();
1149
- if (activeModelMatrix) {
1150
- satelliteObject.draw(this._perspectiveMatrixManager.pMatrix, this._camera.getCameraMatrix(), activeModelMatrix);
1151
- }
1152
- });
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());
1153
1317
  }
1154
1318
  emitHoveredSourceIfChanged() {
1155
1319
  let nextHoveredSource = null;
1156
1320
  let nextHoveredCatalogue = null;
1157
- for (const cat of this.activeCatalogues) {
1321
+ for (const cat of this.getActivePointSets()) {
1158
1322
  const hovered = cat.getPrimaryHoveredSource();
1159
1323
  if (!hovered)
1160
1324
  continue;