astro-viewer 3.1.0 → 3.2.1

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 (50) hide show
  1. package/dist/astroviewer.cjs +713 -204
  2. package/dist/astroviewer.js +1 -1
  3. package/dist/astroviewer.min.js +1 -1
  4. package/lib-esm/AstroSphere.d.ts +19 -15
  5. package/lib-esm/AstroSphere.js +170 -94
  6. package/lib-esm/AstroViewer.d.ts +2 -0
  7. package/lib-esm/AstroViewer.js +3 -0
  8. package/lib-esm/Camera.js +4 -6
  9. package/lib-esm/Config.d.ts +2 -0
  10. package/lib-esm/Config.js +3 -1
  11. package/lib-esm/index.d.ts +2 -0
  12. package/lib-esm/index.js +1 -0
  13. package/lib-esm/model/AbstractSkyEntity.d.ts +1 -0
  14. package/lib-esm/model/MetadataManager.d.ts +1 -0
  15. package/lib-esm/model/MetadataManager.js +4 -1
  16. package/lib-esm/model/Point.d.ts +9 -1
  17. package/lib-esm/model/Point.js +18 -0
  18. package/lib-esm/model/SphereFoV.js +4 -3
  19. package/lib-esm/model/earth/XYZConfig.d.ts +4 -0
  20. package/lib-esm/model/earth/XYZFoVHelper.d.ts +5 -2
  21. package/lib-esm/model/earth/XYZFoVHelper.js +40 -3
  22. package/lib-esm/model/footprints/Footprint.d.ts +4 -1
  23. package/lib-esm/model/footprints/Footprint.js +18 -2
  24. package/lib-esm/model/footprints/FootprintSetGL.d.ts +4 -2
  25. package/lib-esm/model/footprints/FootprintSetGL.js +9 -6
  26. package/lib-esm/model/grid/EquatorialGrid.d.ts +2 -1
  27. package/lib-esm/model/grid/EquatorialGrid.js +10 -6
  28. package/lib-esm/model/grid/HealpixGrid.js +5 -2
  29. package/lib-esm/model/grid/LonLatGrid.d.ts +3 -0
  30. package/lib-esm/model/grid/LonLatGrid.js +61 -10
  31. package/lib-esm/model/hips/FoVHelper.d.ts +5 -2
  32. package/lib-esm/model/hips/FoVHelper.js +40 -3
  33. package/lib-esm/model/hips/HiPS.d.ts +2 -0
  34. package/lib-esm/model/hips/HiPS.js +26 -5
  35. package/lib-esm/model/hips/HiPSConfig.d.ts +13 -0
  36. package/lib-esm/model/hips/HiPSConfig.js +1 -0
  37. package/lib-esm/model/hips/Tile.d.ts +1 -0
  38. package/lib-esm/model/hips/Tile.js +3 -0
  39. package/lib-esm/model/hips/TileBuffer.d.ts +5 -0
  40. package/lib-esm/model/hips/TileBuffer.js +49 -0
  41. package/lib-esm/model/terra/TerraFootprintSetGL.d.ts +6 -0
  42. package/lib-esm/model/terra/TerraFootprintSetGL.js +42 -0
  43. package/lib-esm/utils/CoordsType.d.ts +2 -1
  44. package/lib-esm/utils/CoordsType.js +1 -0
  45. package/lib-esm/utils/GeoJSONParser.d.ts +19 -0
  46. package/lib-esm/utils/GeoJSONParser.js +112 -0
  47. package/lib-esm/utils/PerspectiveMatrixManager.js +4 -1
  48. package/lib-esm/utils/STCSParser.d.ts +7 -3
  49. package/lib-esm/utils/STCSParser.js +15 -9
  50. package/package.json +3 -2
@@ -333,7 +333,40 @@ exports.XYZShaderProgram = XYZShaderProgram;
333
333
  Object.defineProperty(exports, "__esModule", ({ value: true }));
334
334
  exports.fovHelper = void 0;
335
335
  class FoVHelper {
336
- getHiPSNorder(fov) {
336
+ static LEVEL_HYSTERESIS = 0.12;
337
+ static HIPS_ORDER_MIN_FOV = {
338
+ 0: 179,
339
+ 1: 90,
340
+ 2: 30,
341
+ 3: 20,
342
+ 4: 6,
343
+ 5: 3.2,
344
+ 6: 1.6,
345
+ 7: 0.85,
346
+ 8: 0.42,
347
+ 9: 0.21,
348
+ 10: 0.12,
349
+ 11: 0.06,
350
+ 12: 0.015,
351
+ 13: 0,
352
+ };
353
+ getHiPSNorder(fov, currentOrder) {
354
+ const rawOrder = this.getRawHiPSNorder(fov);
355
+ if (currentOrder === undefined || currentOrder === rawOrder)
356
+ return rawOrder;
357
+ if (rawOrder > currentOrder) {
358
+ const boundary = FoVHelper.HIPS_ORDER_MIN_FOV[currentOrder];
359
+ if (boundary > 0 && fov > boundary * (1 - FoVHelper.LEVEL_HYSTERESIS))
360
+ return currentOrder;
361
+ }
362
+ else {
363
+ const boundary = FoVHelper.HIPS_ORDER_MIN_FOV[rawOrder];
364
+ if (boundary > 0 && fov < boundary * (1 + FoVHelper.LEVEL_HYSTERESIS))
365
+ return currentOrder;
366
+ }
367
+ return rawOrder;
368
+ }
369
+ getRawHiPSNorder(fov) {
337
370
  if (fov >= 179)
338
371
  return 0;
339
372
  if (fov >= 90)
@@ -362,10 +395,14 @@ class FoVHelper {
362
395
  return 12;
363
396
  return 13;
364
397
  }
365
- getRADegSteps(fov) {
398
+ getRADegSteps(fov, coarse = false) {
366
399
  let raStep;
367
400
  let decStep;
368
- if (fov >= 179) {
401
+ if (coarse && fov < 0.21) {
402
+ raStep = 10;
403
+ decStep = 10;
404
+ }
405
+ else if (fov >= 179) {
369
406
  raStep = 10;
370
407
  decStep = 10;
371
408
  }
@@ -509,6 +546,7 @@ class FootprintSetGL {
509
546
  totSelectedPoints;
510
547
  nSlectedPrimitiveFlags = 0;
511
548
  _shapeColor = "#00fff2ff";
549
+ _coordsType = CoordsType_js_1.CoordsType.ASTRO;
512
550
  _bufferInitialised = false;
513
551
  _webgl;
514
552
  _isVisible = true;
@@ -590,7 +628,7 @@ class FootprintSetGL {
590
628
  }
591
629
  for (let j = 0; j < in_data.length; j++) {
592
630
  if (in_data[j][geomDataIndex] !== null) {
593
- const footprint = new Footprint_js_1.Footprint(in_data[j][geomDataIndex], in_data[j]);
631
+ const footprint = new Footprint_js_1.Footprint(in_data[j][geomDataIndex], in_data[j], undefined, this._coordsType);
594
632
  if (footprint._valid) {
595
633
  this.addFootprint(footprint);
596
634
  this.totPoints += footprint.totPoints;
@@ -644,6 +682,11 @@ class FootprintSetGL {
644
682
  }
645
683
  }
646
684
  this.indexes[this.indexes.length - 1] = MAX_UNSIGNED_INT;
685
+ this._webgl.bindBuffer(this._webgl.ARRAY_BUFFER, this.vertexCataloguePositionBuffer);
686
+ this._webgl.bufferData(this._webgl.ARRAY_BUFFER, this.vertexCataloguePosition, this._webgl.STATIC_DRAW);
687
+ this._webgl.bindBuffer(this._webgl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
688
+ this._webgl.bufferData(this._webgl.ELEMENT_ARRAY_BUFFER, this.indexes, this._webgl.STATIC_DRAW);
689
+ this._bufferInitialised = true;
647
690
  console.log("Buffer initialized");
648
691
  }
649
692
  checkSelection(mouseHelper) {
@@ -663,9 +706,8 @@ class FootprintSetGL {
663
706
  const details = [...footprint.details];
664
707
  // const geomDataIndex = this.footprintsetProps.geomColumn?.index
665
708
  const geomDataIndex = this._metadataManager.selectedOutlineColumn?.index ?? -1;
666
- if (geomDataIndex < 0)
667
- continue;
668
- details.splice(geomDataIndex, 1);
709
+ if (geomDataIndex >= 0)
710
+ details.splice(geomDataIndex, 1);
669
711
  this._hoveredFootprints.push(footprint);
670
712
  this.totHoveredPoints += footprint.totPoints;
671
713
  }
@@ -1037,11 +1079,9 @@ class FootprintSetGL {
1037
1079
  this._webgl.drawElements(this._webgl.LINE_LOOP, this.selectedVertexPosition.length / 3 + this.nSlectedPrimitiveFlags, this._webgl.UNSIGNED_INT, 0);
1038
1080
  }
1039
1081
  this._webgl.bindBuffer(this._webgl.ARRAY_BUFFER, this.vertexCataloguePositionBuffer);
1040
- this._webgl.bufferData(this._webgl.ARRAY_BUFFER, this.vertexCataloguePosition, this._webgl.STATIC_DRAW);
1041
1082
  this._webgl.vertexAttribPointer(this._footprintShaderProgram.locations.position, FootprintSetGL.ELEM_SIZE, this._webgl.FLOAT, false, FootprintSetGL.BYTES_X_ELEM * FootprintSetGL.ELEM_SIZE, 0);
1042
1083
  this._webgl.enableVertexAttribArray(this._footprintShaderProgram.locations.position);
1043
1084
  this._webgl.bindBuffer(this._webgl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
1044
- this._webgl.bufferData(this._webgl.ELEMENT_ARRAY_BUFFER, this.indexes, this._webgl.STATIC_DRAW);
1045
1085
  // const shapeColor = [...colorHex2RGB(this.footprintsetProps.shapeColor), 1.0] as [number, number, number, number]
1046
1086
  const shapeColor = [...(0, Utils_js_1.colorHex2RGB)(this._shapeColor), 1.0];
1047
1087
  this._webgl.uniform4f(this._footprintShaderProgram.locations.color, ...shapeColor);
@@ -2523,6 +2563,9 @@ class AstroViewer {
2523
2563
  getXYZDebugStats() {
2524
2564
  return this.astroSphere.getXYZDebugStats();
2525
2565
  }
2566
+ getHiPSDebugStats() {
2567
+ return this.astroSphere.getHiPSDebugStats();
2568
+ }
2526
2569
  async loadHiPS(baseUrl) {
2527
2570
  const hipsUrl = baseUrl.endsWith('/') ? baseUrl : baseUrl + '/';
2528
2571
  const resp = await fetch(hipsUrl + 'properties');
@@ -4371,6 +4414,81 @@ class Healpix {
4371
4414
 
4372
4415
  //# sourceMappingURL=index.js.map
4373
4416
 
4417
+ /***/ }),
4418
+
4419
+ /***/ 1229:
4420
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
4421
+
4422
+
4423
+ /*
4424
+ * AstroViewer
4425
+ * Copyright (C) Fabrizio Giordano
4426
+ * SPDX-License-Identifier: LicenseRef-AstroViewer-Dual-License
4427
+ *
4428
+ * This file is part of AstroViewer.
4429
+ * AstroViewer is distributed under a dual-license model.
4430
+ * Commercial use requires a separate commercial license.
4431
+ * Non-commercial use is governed by LICENSE-NONCOMMERCIAL.md.
4432
+ *
4433
+ * See LICENSE.md, LICENSE-COMMERCIAL.md, and LICENSE-NONCOMMERCIAL.md for details.
4434
+ */
4435
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4436
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4437
+ };
4438
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
4439
+ exports.Footprint = exports.Source = exports.WMTSAdapter = exports.XYZMap = exports.HiPS = exports.createColorMapFromSamples = exports.COLOR_MAP_SAMPLE_COUNT = exports.ColorMaps = exports.GeoJSONParser = exports.CoordsType = exports.FoVUtils = exports.CartesianOpts = exports.PointInitOpts = exports.AstroOpts = exports.SphericalOpts = exports.Point = exports.ColumnType = exports.MetadataInit = exports.MetadataColumn = exports.MetadataManager = exports.TerraFootprintSetGL = exports.TerraPointSetGL = exports.CatalogueGL = exports.FootprintSetGL = exports.HoveredFootprintDetail = exports.SphereFoV = exports.FoV = exports.HiPSDescriptor = exports.AstroViewer = void 0;
4440
+ var AstroViewer_js_1 = __webpack_require__(772);
4441
+ Object.defineProperty(exports, "AstroViewer", ({ enumerable: true, get: function () { return AstroViewer_js_1.AstroViewer; } }));
4442
+ var HiPSDescriptor_js_1 = __webpack_require__(5087);
4443
+ Object.defineProperty(exports, "HiPSDescriptor", ({ enumerable: true, get: function () { return HiPSDescriptor_js_1.HiPSDescriptor; } }));
4444
+ var SphereFoV_js_1 = __webpack_require__(5803);
4445
+ Object.defineProperty(exports, "FoV", ({ enumerable: true, get: function () { return SphereFoV_js_1.SphereFoV; } }));
4446
+ var SphereFoV_js_2 = __webpack_require__(5803);
4447
+ Object.defineProperty(exports, "SphereFoV", ({ enumerable: true, get: function () { return SphereFoV_js_2.SphereFoV; } }));
4448
+ var FootprintSetGL_js_1 = __webpack_require__(592);
4449
+ Object.defineProperty(exports, "HoveredFootprintDetail", ({ enumerable: true, get: function () { return FootprintSetGL_js_1.HoveredFootprintDetail; } }));
4450
+ Object.defineProperty(exports, "FootprintSetGL", ({ enumerable: true, get: function () { return FootprintSetGL_js_1.FootprintSetGL; } }));
4451
+ var CatalogueGL_js_1 = __webpack_require__(1232);
4452
+ Object.defineProperty(exports, "CatalogueGL", ({ enumerable: true, get: function () { return CatalogueGL_js_1.CatalogueGL; } }));
4453
+ var TerraPointSetGL_js_1 = __webpack_require__(5781);
4454
+ Object.defineProperty(exports, "TerraPointSetGL", ({ enumerable: true, get: function () { return TerraPointSetGL_js_1.TerraPointSetGL; } }));
4455
+ var TerraFootprintSetGL_js_1 = __webpack_require__(9022);
4456
+ Object.defineProperty(exports, "TerraFootprintSetGL", ({ enumerable: true, get: function () { return TerraFootprintSetGL_js_1.TerraFootprintSetGL; } }));
4457
+ var MetadataManager_js_1 = __webpack_require__(5403);
4458
+ Object.defineProperty(exports, "MetadataManager", ({ enumerable: true, get: function () { return MetadataManager_js_1.MetadataManager; } }));
4459
+ var MetadataColumn_js_1 = __webpack_require__(1072);
4460
+ Object.defineProperty(exports, "MetadataColumn", ({ enumerable: true, get: function () { return MetadataColumn_js_1.MetadataColumn; } }));
4461
+ Object.defineProperty(exports, "MetadataInit", ({ enumerable: true, get: function () { return MetadataColumn_js_1.MetadataInit; } }));
4462
+ Object.defineProperty(exports, "ColumnType", ({ enumerable: true, get: function () { return MetadataColumn_js_1.ColumnType; } }));
4463
+ var Point_js_1 = __webpack_require__(6553);
4464
+ Object.defineProperty(exports, "Point", ({ enumerable: true, get: function () { return Point_js_1.Point; } }));
4465
+ Object.defineProperty(exports, "SphericalOpts", ({ enumerable: true, get: function () { return Point_js_1.SphericalOpts; } }));
4466
+ Object.defineProperty(exports, "AstroOpts", ({ enumerable: true, get: function () { return Point_js_1.AstroOpts; } }));
4467
+ Object.defineProperty(exports, "PointInitOpts", ({ enumerable: true, get: function () { return Point_js_1.PointInitOpts; } }));
4468
+ Object.defineProperty(exports, "CartesianOpts", ({ enumerable: true, get: function () { return Point_js_1.CartesianOpts; } }));
4469
+ var FoVUtils_js_1 = __webpack_require__(8083);
4470
+ Object.defineProperty(exports, "FoVUtils", ({ enumerable: true, get: function () { return FoVUtils_js_1.FoVUtils; } }));
4471
+ var CoordsType_js_1 = __webpack_require__(8145);
4472
+ Object.defineProperty(exports, "CoordsType", ({ enumerable: true, get: function () { return CoordsType_js_1.CoordsType; } }));
4473
+ var GeoJSONParser_js_1 = __webpack_require__(8755);
4474
+ Object.defineProperty(exports, "GeoJSONParser", ({ enumerable: true, get: function () { return __importDefault(GeoJSONParser_js_1).default; } }));
4475
+ var ColorMaps_js_1 = __webpack_require__(619);
4476
+ Object.defineProperty(exports, "ColorMaps", ({ enumerable: true, get: function () { return ColorMaps_js_1.ColorMaps; } }));
4477
+ Object.defineProperty(exports, "COLOR_MAP_SAMPLE_COUNT", ({ enumerable: true, get: function () { return ColorMaps_js_1.COLOR_MAP_SAMPLE_COUNT; } }));
4478
+ Object.defineProperty(exports, "createColorMapFromSamples", ({ enumerable: true, get: function () { return ColorMaps_js_1.createColorMapFromSamples; } }));
4479
+ var HiPS_js_1 = __webpack_require__(3726);
4480
+ Object.defineProperty(exports, "HiPS", ({ enumerable: true, get: function () { return HiPS_js_1.HiPS; } }));
4481
+ var XYZMap_js_1 = __webpack_require__(1741);
4482
+ Object.defineProperty(exports, "XYZMap", ({ enumerable: true, get: function () { return XYZMap_js_1.XYZMap; } }));
4483
+ var WMTSAdapter_js_1 = __webpack_require__(3956);
4484
+ Object.defineProperty(exports, "WMTSAdapter", ({ enumerable: true, get: function () { return WMTSAdapter_js_1.WMTSAdapter; } }));
4485
+ var Source_js_1 = __webpack_require__(146);
4486
+ Object.defineProperty(exports, "Source", ({ enumerable: true, get: function () { return Source_js_1.Source; } }));
4487
+ var Footprint_js_1 = __webpack_require__(2475);
4488
+ Object.defineProperty(exports, "Footprint", ({ enumerable: true, get: function () { return Footprint_js_1.Footprint; } }));
4489
+ console.log('astroviewer UMD loaded');
4490
+
4491
+
4374
4492
  /***/ }),
4375
4493
 
4376
4494
  /***/ 1232:
@@ -13939,6 +14057,7 @@ exports.Footprint = void 0;
13939
14057
  const GeomUtils_js_1 = __importDefault(__webpack_require__(2930));
13940
14058
  // import global from '../../Global.js';
13941
14059
  const STCSParser_js_1 = __importDefault(__webpack_require__(9665));
14060
+ const CoordsType_js_1 = __webpack_require__(8145);
13942
14061
  // export interface ParsedSTCS {
13943
14062
  // polygons: Point[][]; // array of polygons (each polygon is array of Point objects)
13944
14063
  // totpoints: number;
@@ -13953,6 +14072,7 @@ class Footprint {
13953
14072
  _totConvexPoints = 0;
13954
14073
  _npix256;
13955
14074
  _footprintsPointsOrder;
14075
+ _coordsType;
13956
14076
  _selectionObj;
13957
14077
  _identifier;
13958
14078
  _center; // could be typed if you have a Point type
@@ -13961,7 +14081,8 @@ class Footprint {
13961
14081
  * @param in_details optional metadata
13962
14082
  * @param footprintsPointsOrder 1-> clockwise, -1 counter clockwise
13963
14083
  */
13964
- constructor(in_stcs, in_details = [], footprintsPointsOrder) {
14084
+ constructor(in_stcs, in_details = [], footprintsPointsOrder, coordsType = CoordsType_js_1.CoordsType.ASTRO) {
14085
+ this._coordsType = coordsType;
13965
14086
  if (in_stcs) {
13966
14087
  this._stcs = in_stcs.toUpperCase();
13967
14088
  this._details = in_details;
@@ -13976,6 +14097,17 @@ class Footprint {
13976
14097
  this._details = [];
13977
14098
  }
13978
14099
  }
14100
+ static fromPolygons(polygons, details = [], coordsType = CoordsType_js_1.CoordsType.ASTRO) {
14101
+ const footprint = new Footprint(undefined, [], undefined, coordsType);
14102
+ footprint._polygons = polygons;
14103
+ footprint._details = details;
14104
+ footprint._totPoints = polygons.reduce((total, polygon) => total + polygon.length, 0);
14105
+ footprint._totConvexPoints = 0;
14106
+ footprint._coordsType = coordsType;
14107
+ footprint._selectionObj = footprint.computeSelectionObject();
14108
+ footprint._valid = footprint._totPoints > 0;
14109
+ return footprint;
14110
+ }
13979
14111
  computeSelectionObject() {
13980
14112
  return GeomUtils_js_1.default.computeSelectionObject(this._polygons);
13981
14113
  }
@@ -13998,7 +14130,9 @@ class Footprint {
13998
14130
  // return Array.from(rangeSet.r);
13999
14131
  // }
14000
14132
  computePoints() {
14001
- const res = STCSParser_js_1.default.parseSTCS(this._stcs);
14133
+ const res = STCSParser_js_1.default.parseSTCS(this._stcs, {
14134
+ coordsType: this._coordsType,
14135
+ });
14002
14136
  this._polygons = res.polygons;
14003
14137
  this._totPoints = res.totpoints;
14004
14138
  }
@@ -14495,6 +14629,8 @@ exports.bootSetup = {
14495
14629
  defaultHips: "",
14496
14630
  camera_fov_deg: 34,
14497
14631
  camera_fov_rad: 34 * Math.PI / 180.0,
14632
+ inside_camera_fov_deg: 60,
14633
+ inside_camera_fov_rad: 60 * Math.PI / 180.0,
14498
14634
  camera_near_plane: 0.00001,
14499
14635
  camera_far_plane: 2.5,
14500
14636
  corsProxyUrl: "http://localhost:4000/",
@@ -14505,7 +14641,7 @@ exports.bootSetup = {
14505
14641
  version: "Astrobrowser v1.0.0",
14506
14642
  debug: false,
14507
14643
  insideView: false,
14508
- showViewfinder: false,
14644
+ showViewfinder: true,
14509
14645
  };
14510
14646
 
14511
14647
 
@@ -15208,10 +15344,31 @@ class HiPS extends AbstractSkyEntity_js_1.AbstractSkyEntity {
15208
15344
  getCurrentHealpixOrder() {
15209
15345
  return this._visibleorder;
15210
15346
  }
15211
- refresh() {
15212
- // const fov = healpixGridSingleton.getMinFoV()
15213
- const fov = this._healpixGrid.getMinFoV();
15214
- this._visibleorder = Math.min(FoVHelper_js_1.fovHelper.getHiPSNorder(fov), this._maxorder);
15347
+ getDebugStats() {
15348
+ const tileBuffer = this._healpixGrid.visibleTilesManager.tileBuffer;
15349
+ const visibleTiles = this.isGalacticHips
15350
+ ? this._healpixGrid.visibleTilesManager.galVisibleTilesByOrder
15351
+ : this._healpixGrid.visibleTilesManager.visibleTilesByOrder;
15352
+ return {
15353
+ activeBaseLayer: 'hips',
15354
+ hipsName: this._descriptor.surveyName,
15355
+ hipsUrl: this._baseurl,
15356
+ isGalactic: this.isGalacticHips,
15357
+ currentOrder: visibleTiles.order,
15358
+ visibleTileCount: visibleTiles.pixels.length,
15359
+ activeTileCount: tileBuffer.activeTileCount,
15360
+ cachedTileCount: tileBuffer.cachedTileCount,
15361
+ cacheSize: tileBuffer.size,
15362
+ readyTileCount: tileBuffer.readyTileCount,
15363
+ loadingTileCount: tileBuffer.loadingTileCount,
15364
+ };
15365
+ }
15366
+ refresh(input) {
15367
+ // const fov = this._healpixGrid.getMinFoV()
15368
+ // this._visibleorder = Math.min(fovHelper.getHiPSNorder(fov), this._maxorder)
15369
+ const rawFov = input.fovDeg ?? this._healpixGrid.getMinFoV();
15370
+ const fov = Number.isFinite(rawFov) && rawFov > 0 ? rawFov : 1e-6;
15371
+ this._visibleorder = Math.min(FoVHelper_js_1.fovHelper.getHiPSNorder(fov, this._visibleorder), this._maxorder);
15215
15372
  }
15216
15373
  draw(input) {
15217
15374
  const vMatrix = input.camera.getCameraMatrix();
@@ -15220,7 +15377,7 @@ class HiPS extends AbstractSkyEntity_js_1.AbstractSkyEntity {
15220
15377
  const pMatrix = input.pMatrix;
15221
15378
  if (!pMatrix)
15222
15379
  return;
15223
- this.refresh();
15380
+ this.refresh(input);
15224
15381
  const mMatrix = this.getModelMatrix();
15225
15382
  super.hipsShaderProgram.setRuntimeColorMap(this.colorMap);
15226
15383
  if (this._allSky && this._allSkyTile) {
@@ -15528,6 +15685,55 @@ class TileBuffer {
15528
15685
  dispose() {
15529
15686
  window.clearInterval(this._cleanerId);
15530
15687
  }
15688
+ get size() {
15689
+ return this._tiles.size + this._cachedTiles.size + this._galTiles.size + this._galCachedTiles.size;
15690
+ }
15691
+ get activeTileCount() {
15692
+ return this._tiles.size + this._galTiles.size;
15693
+ }
15694
+ get cachedTileCount() {
15695
+ return this._cachedTiles.size + this._galCachedTiles.size;
15696
+ }
15697
+ get readyTileCount() {
15698
+ let count = 0;
15699
+ for (const tile of this._tiles.values()) {
15700
+ if (tile.getReadyState())
15701
+ count++;
15702
+ }
15703
+ for (const tile of this._galTiles.values()) {
15704
+ if (tile.getReadyState())
15705
+ count++;
15706
+ }
15707
+ for (const tile of this._cachedTiles.values()) {
15708
+ if (tile.getReadyState())
15709
+ count++;
15710
+ }
15711
+ for (const tile of this._galCachedTiles.values()) {
15712
+ if (tile.getReadyState())
15713
+ count++;
15714
+ }
15715
+ return count;
15716
+ }
15717
+ get loadingTileCount() {
15718
+ let count = 0;
15719
+ for (const tile of this._tiles.values()) {
15720
+ if (tile.isLoading())
15721
+ count++;
15722
+ }
15723
+ for (const tile of this._galTiles.values()) {
15724
+ if (tile.isLoading())
15725
+ count++;
15726
+ }
15727
+ for (const tile of this._cachedTiles.values()) {
15728
+ if (tile.isLoading())
15729
+ count++;
15730
+ }
15731
+ for (const tile of this._galCachedTiles.values()) {
15732
+ if (tile.isLoading())
15733
+ count++;
15734
+ }
15735
+ return count;
15736
+ }
15531
15737
  }
15532
15738
  exports.TileBuffer = TileBuffer;
15533
15739
  // Singleton (kept for compatibility with your original export)
@@ -15945,7 +16151,7 @@ class HealpixGrid extends AbstractSkyEntity_js_1.AbstractSkyEntity {
15945
16151
  // (global as any).hipsFoV = fov;
15946
16152
  // global.order = fovHelper.getHiPSNorder(fov);
15947
16153
  // this._visibleorder = global.order;
15948
- this._visibleorder = FoVHelper_js_1.fovHelper.getHiPSNorder(fov);
16154
+ this._visibleorder = FoVHelper_js_1.fovHelper.getHiPSNorder(fov, this._visibleorder);
15949
16155
  }
15950
16156
  enableShader(in_mMatrix, pMatrix, vMatrix) {
15951
16157
  const gl = super.webgl;
@@ -15989,7 +16195,10 @@ class HealpixGrid extends AbstractSkyEntity_js_1.AbstractSkyEntity {
15989
16195
  const pMatrix = input.pMatrix;
15990
16196
  if (!pMatrix)
15991
16197
  return;
15992
- this.refresh(camera, pMatrix);
16198
+ // this.refresh(camera, pMatrix);
16199
+ const rawFov = input.fovDeg ?? this.getMinFoV();
16200
+ const fov = Number.isFinite(rawFov) && rawFov > 0 ? rawFov : 1e-6;
16201
+ this._visibleorder = FoVHelper_js_1.fovHelper.getHiPSNorder(fov, this._visibleorder);
15993
16202
  if (!this.showGrid) {
15994
16203
  // gridTextHelper.resetDivSets();
15995
16204
  this.gridText.resetDivSets();
@@ -16306,19 +16515,21 @@ class AstroSphere {
16306
16515
  _webgl;
16307
16516
  _selectedColorMap;
16308
16517
  _cameraStatusChanged = false;
16518
+ lastCameraChangedAt = 0;
16519
+ lastCameraMotionAt = 0;
16309
16520
  lastHoveredSource = null;
16310
16521
  lastHoveredCatalogue = null;
16311
16522
  zoomSensitivity = 1.0;
16312
16523
  lockedEastWestRaDeg = null;
16313
16524
  lockedNorthSouthDecDeg = null;
16314
- keepCameraNorthUp = false;
16525
+ keepCameraNorthUp = true;
16315
16526
  constructor(canvas, webgl) {
16316
- console.log('[AstroSphere] new instance for canvas', canvas.id);
16527
+ console.log("[AstroSphere] new instance for canvas", canvas.id);
16317
16528
  // Keep global GL context (as in original JS)
16318
16529
  this._webgl = webgl;
16319
16530
  this.mouseHelper = new MouseHelper_js_1.default();
16320
16531
  this.canvas = canvas;
16321
- const nativeColorMap = 'native';
16532
+ const nativeColorMap = "native";
16322
16533
  this._selectedColorMap = ColorMaps_js_1.default[nativeColorMap];
16323
16534
  Global_js_1.default.insideSphere = Config_js_1.bootSetup.insideSphere;
16324
16535
  this.initCamera();
@@ -16366,20 +16577,26 @@ class AstroSphere {
16366
16577
  astroDeg: astroCoords,
16367
16578
  sphericalDeg: sphericalCoords,
16368
16579
  raHMS: raHMS,
16369
- decDMS: decDMS
16580
+ decDMS: decDMS,
16370
16581
  };
16371
16582
  return this.centralPoinCoords;
16372
16583
  }
16373
16584
  updateLastMousePoint() {
16374
- const sphericalCoords = { phi: this.mouseHelper.phi, theta: this.mouseHelper.theta };
16375
- const astroCoords = { ra: this.mouseHelper.ra, dec: this.mouseHelper.dec };
16585
+ const sphericalCoords = {
16586
+ phi: this.mouseHelper.phi,
16587
+ theta: this.mouseHelper.theta,
16588
+ };
16589
+ const astroCoords = {
16590
+ ra: this.mouseHelper.ra,
16591
+ dec: this.mouseHelper.dec,
16592
+ };
16376
16593
  const raHMS = this.mouseHelper.raHMS;
16377
16594
  const decDMS = this.mouseHelper.decDMS;
16378
16595
  this.mousePointCoords = {
16379
16596
  astroDeg: astroCoords,
16380
16597
  sphericalDeg: sphericalCoords,
16381
16598
  raHMS: raHMS,
16382
- decDMS: decDMS
16599
+ decDMS: decDMS,
16383
16600
  };
16384
16601
  return this.mousePointCoords;
16385
16602
  }
@@ -16399,9 +16616,6 @@ class AstroSphere {
16399
16616
  computeZoomStep(currentFov, deltaY) {
16400
16617
  const direction = deltaY < 0 ? -1 : 1;
16401
16618
  const wheelScale = this.clamp(Math.abs(deltaY) / 120, AstroSphere.MIN_WHEEL_SCALE, AstroSphere.MAX_WHEEL_SCALE);
16402
- // Continuous wheel response:
16403
- // - broad FoV stays responsive without large jumps
16404
- // - narrow FoV keeps a usable floor to avoid the 0.1 -> 0.02 deg stall
16405
16619
  const baseMagnitude = this.clamp(0.0012 + 0.0025 * Math.sqrt(Math.max(currentFov, 0)), 0.0012, 0.04);
16406
16620
  return direction * baseMagnitude * wheelScale * this.zoomSensitivity;
16407
16621
  }
@@ -16491,7 +16705,8 @@ class AstroSphere {
16491
16705
  };
16492
16706
  }
16493
16707
  enforceAstronomicalRotationLocks() {
16494
- if (this.lockedEastWestRaDeg == null && this.lockedNorthSouthDecDeg == null) {
16708
+ if (this.lockedEastWestRaDeg == null &&
16709
+ this.lockedNorthSouthDecDeg == null) {
16495
16710
  return false;
16496
16711
  }
16497
16712
  const center = this.updateCentralPoint();
@@ -16534,7 +16749,7 @@ class AstroSphere {
16534
16749
  return;
16535
16750
  // optional debug
16536
16751
  // console.log('[AstroSphere] emit camera-changed:', reason);
16537
- this.canvas.dispatchEvent(new CustomEvent('camera-changed', {
16752
+ this.canvas.dispatchEvent(new CustomEvent("camera-changed", {
16538
16753
  detail,
16539
16754
  bubbles: true,
16540
16755
  composed: true,
@@ -16542,7 +16757,7 @@ class AstroSphere {
16542
16757
  }
16543
16758
  addEventListeners(canvas) {
16544
16759
  if (Global_js_1.default.debug) {
16545
- console.log('[AstroSphere::addEventListeners]');
16760
+ console.log("[AstroSphere::addEventListeners]");
16546
16761
  }
16547
16762
  const CLICK_MAX_DISTANCE_PX = 4;
16548
16763
  const CLICK_MAX_DURATION_MS = 250;
@@ -16572,7 +16787,7 @@ class AstroSphere {
16572
16787
  const handleMouseUp = (event) => {
16573
16788
  canvas.releasePointerCapture(event.pointerId);
16574
16789
  this.mouseDown = false;
16575
- document.body.style.cursor = 'auto';
16790
+ document.body.style.cursor = "auto";
16576
16791
  if (event.button !== 0) {
16577
16792
  event.preventDefault();
16578
16793
  return false;
@@ -16594,7 +16809,7 @@ class AstroSphere {
16594
16809
  const clickResult = cat.selectPrimarySourceFromClick(this.mouseHelper);
16595
16810
  if (!clickResult?.sources.length)
16596
16811
  continue;
16597
- this._webgl.canvas.dispatchEvent(new CustomEvent('source-clicked', {
16812
+ this._webgl.canvas.dispatchEvent(new CustomEvent("source-clicked", {
16598
16813
  detail: {
16599
16814
  source: clickResult.sources,
16600
16815
  selectionState: clickResult.selectionState,
@@ -16608,7 +16823,7 @@ class AstroSphere {
16608
16823
  const clickResult = fset.selectPrimaryFootprintFromClick(this.mouseHelper);
16609
16824
  if (!clickResult?.footprints.length)
16610
16825
  continue;
16611
- this._webgl.canvas.dispatchEvent(new CustomEvent('footprint-clicked', {
16826
+ this._webgl.canvas.dispatchEvent(new CustomEvent("footprint-clicked", {
16612
16827
  detail: {
16613
16828
  footprint: clickResult.footprints,
16614
16829
  selectionState: clickResult.selectionState,
@@ -16635,10 +16850,13 @@ class AstroSphere {
16635
16850
  if (!this._healpixGrid)
16636
16851
  return;
16637
16852
  if (this.mouseDown) {
16638
- document.body.style.cursor = 'grab';
16639
- // Rotation deltas either use client-space or local-space, but be consistent
16640
- const deltaX = ((newX - (this.lastMouseX ?? newX)) * Math.PI) / canvas.width;
16641
- const deltaY = ((newY - (this.lastMouseY ?? newY)) * Math.PI) / canvas.height;
16853
+ document.body.style.cursor = "grab";
16854
+ const dragDirection = Global_js_1.default.insideSphere ? -1 : 1;
16855
+ const dragSpeed = Global_js_1.default.insideSphere ? 10.0 : 1;
16856
+ const deltaX = (dragDirection * dragSpeed * (newX - (this.lastMouseX ?? newX)) * Math.PI) /
16857
+ canvas.width;
16858
+ const deltaY = (dragDirection * dragSpeed * (newY - (this.lastMouseY ?? newY)) * Math.PI) /
16859
+ canvas.height;
16642
16860
  const filteredDelta = this.filterRotationDeltaByAstroLocks(deltaX, deltaY);
16643
16861
  this.inertiaX += 0.1 * filteredDelta.deltaX;
16644
16862
  this.inertiaY += 0.1 * filteredDelta.deltaY;
@@ -16673,10 +16891,11 @@ class AstroSphere {
16673
16891
  // direction feels responsive instead of "buffered".
16674
16892
  this.zoomInertia = 0;
16675
16893
  this._camera.zoom(zoomStep);
16894
+ this.lastCameraMotionAt = performance.now();
16676
16895
  this.fov = this._healpixGrid.refreshFoV(this._camera, this._perspectiveMatrixManager.pMatrix);
16677
16896
  this._camera.refreshFoV(this.fov.minFoV);
16678
16897
  this._cameraStatusChanged = true;
16679
- this.emitCameraChanged('wheel');
16898
+ this.emitCameraChanged("wheel");
16680
16899
  event.preventDefault();
16681
16900
  };
16682
16901
  const handleContextMenu = (event) => {
@@ -16694,7 +16913,7 @@ class AstroSphere {
16694
16913
  const pickResult = cat.getSourcesFromPointer(this.mouseHelper);
16695
16914
  if (!pickResult?.sources.length)
16696
16915
  continue;
16697
- this._webgl.canvas.dispatchEvent(new CustomEvent('source-contextmenu', {
16916
+ this._webgl.canvas.dispatchEvent(new CustomEvent("source-contextmenu", {
16698
16917
  detail: {
16699
16918
  source: pickResult.sources,
16700
16919
  catalogue: cat,
@@ -16710,7 +16929,7 @@ class AstroSphere {
16710
16929
  const pickResult = fset.getFootprintsFromPointer(this.mouseHelper);
16711
16930
  if (!pickResult?.footprints.length)
16712
16931
  continue;
16713
- this._webgl.canvas.dispatchEvent(new CustomEvent('footprint-contextmenu', {
16932
+ this._webgl.canvas.dispatchEvent(new CustomEvent("footprint-contextmenu", {
16714
16933
  detail: {
16715
16934
  footprint: pickResult.footprints,
16716
16935
  footprintSet: fset,
@@ -16730,40 +16949,40 @@ class AstroSphere {
16730
16949
  }
16731
16950
  // console.log('[AstroSphere::onKeyDown] key=', evt.key)
16732
16951
  switch (evt.key) {
16733
- case '1':
16952
+ case "1":
16734
16953
  // Free camera
16735
16954
  this._camera.clearRotationLock();
16736
16955
  break;
16737
- case '2':
16956
+ case "2":
16738
16957
  // Lock X axis rotation
16739
16958
  this._camera.setRotationLock({ x: true, y: false, z: false });
16740
16959
  break;
16741
- case '3':
16960
+ case "3":
16742
16961
  // Lock Y axis rotation
16743
16962
  this._camera.setRotationLock({ x: false, y: true, z: false });
16744
16963
  break;
16745
- case '4':
16964
+ case "4":
16746
16965
  // Lock Z axis rotation
16747
16966
  this._camera.setRotationLock({ x: false, y: false, z: true });
16748
16967
  break;
16749
16968
  }
16750
16969
  };
16751
- console.log('[AstroSphere] registering pointer and wheel listeners on canvas');
16970
+ console.log("[AstroSphere] registering pointer and wheel listeners on canvas");
16752
16971
  canvas.onpointerdown = handleMouseDown;
16753
16972
  canvas.onpointerup = handleMouseUp;
16754
16973
  canvas.onpointermove = handleMouseMove;
16755
16974
  canvas.onpointerleave = () => {
16756
16975
  this.clearLastMousePoint();
16757
16976
  this._cameraStatusChanged = true;
16758
- this.emitCameraChanged('pointerleave');
16977
+ this.emitCameraChanged("pointerleave");
16759
16978
  };
16760
- console.log('[AstroSphere] adding wheel event listener with passive: false');
16761
- canvas.addEventListener('wheel', handleMouseWheel, { passive: false });
16762
- canvas.addEventListener('contextmenu', handleContextMenu);
16763
- console.log('[AstroSphere] registering global keydown listener on document');
16764
- document.addEventListener('keydown', onKeyDown, { capture: true });
16979
+ console.log("[AstroSphere] adding wheel event listener with passive: false");
16980
+ canvas.addEventListener("wheel", handleMouseWheel, { passive: false });
16981
+ canvas.addEventListener("contextmenu", handleContextMenu);
16982
+ console.log("[AstroSphere] registering global keydown listener on document");
16983
+ document.addEventListener("keydown", onKeyDown, { capture: true });
16765
16984
  }
16766
- // REVIEW THIS METHOD AND MOVE IT
16985
+ // REVIEW THIS METHOD AND MOVE IT
16767
16986
  getPhiThetaDeg(canvas) {
16768
16987
  const rect = canvas.getBoundingClientRect();
16769
16988
  const maxX = rect.width;
@@ -16790,21 +17009,21 @@ class AstroSphere {
16790
17009
  }
16791
17010
  activateHiPS(hipsDescriptor) {
16792
17011
  this._activeHiPS = new HiPS_js_1.HiPS(1, [0.0, 0.0, 0.0], 0, 0, hipsDescriptor, this._webgl, this._healpixGrid);
16793
- this._activeBaseLayer = 'hips';
17012
+ this._activeBaseLayer = "hips";
16794
17013
  }
16795
17014
  activateXYZ(config) {
16796
- this.activateXYZ2(new XYZMapDescriptor_js_1.XYZMapDescriptor(config.name ?? 'XYZ Earth2 Layer', config.urlTemplate, config.minZoom ?? 0, config.maxZoom ?? 8, config.segmentsPerSide ?? 48, config.maxCachedTiles ?? 384, 8, config.urlResolver));
16797
- this._activeBaseLayer = 'xyz';
17015
+ this.activateXYZ2(new XYZMapDescriptor_js_1.XYZMapDescriptor(config.name ?? "XYZ Earth2 Layer", config.urlTemplate, config.minZoom ?? 0, config.maxZoom ?? 8, config.segmentsPerSide ?? 48, config.maxCachedTiles ?? 384, 8, config.urlResolver));
17016
+ this._activeBaseLayer = "xyz";
16798
17017
  }
16799
17018
  activateXYZ2(config) {
16800
17019
  this._activeXYZ2 = new XYZMap_js_1.XYZMap(1, [0.0, 0.0, 0.0], 0, 0, config, this._webgl);
16801
- this._activeBaseLayer = 'xyz';
17020
+ this._activeBaseLayer = "xyz";
16802
17021
  }
16803
17022
  activateWMTS(config) {
16804
17023
  const adapter = new WMTSAdapter_js_1.WMTSAdapter(config);
16805
17024
  const xyzConfig = adapter.toXYZLayerConfig();
16806
- this._activeXYZ2 = new XYZMap_js_1.XYZMap(1, [0.0, 0.0, 0.0], 0, 0, new XYZMapDescriptor_js_1.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);
16807
- this._activeBaseLayer = 'xyz';
17025
+ this._activeXYZ2 = new XYZMap_js_1.XYZMap(1, [0.0, 0.0, 0.0], 0, 0, new XYZMapDescriptor_js_1.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);
17026
+ this._activeBaseLayer = "xyz";
16808
17027
  }
16809
17028
  // Catalogue section
16810
17029
  async showCatalogue(cat) {
@@ -16814,7 +17033,7 @@ class AstroSphere {
16814
17033
  return cat;
16815
17034
  }
16816
17035
  deleteCatalogue(catalogue) {
16817
- this.activeCatalogues = this.activeCatalogues.filter(c => c !== catalogue);
17036
+ this.activeCatalogues = this.activeCatalogues.filter((c) => c !== catalogue);
16818
17037
  }
16819
17038
  // End Catalogue section
16820
17039
  // Footprint section
@@ -16825,11 +17044,11 @@ class AstroSphere {
16825
17044
  return fset;
16826
17045
  }
16827
17046
  deleteFootprintSet(footprintSet) {
16828
- this.activeFootprintSets = this.activeFootprintSets.filter(fst => fst !== footprintSet);
17047
+ this.activeFootprintSets = this.activeFootprintSets.filter((fst) => fst !== footprintSet);
16829
17048
  }
16830
17049
  getHoveredFootprints() {
16831
17050
  let footprintsHovered = [];
16832
- this.activeFootprintSets.forEach(fset => {
17051
+ this.activeFootprintSets.forEach((fset) => {
16833
17052
  footprintsHovered.push(fset.hoveredFootprints);
16834
17053
  });
16835
17054
  return footprintsHovered;
@@ -16839,13 +17058,13 @@ class AstroSphere {
16839
17058
  this._camera.goTo(raDeg, decDeg);
16840
17059
  }
16841
17060
  getActiveCoordinateMode() {
16842
- if (this._activeBaseLayer === 'xyz') {
16843
- return 'lonlat';
17061
+ if (this._activeBaseLayer === "xyz") {
17062
+ return "lonlat";
16844
17063
  }
16845
- if (this._activeBaseLayer === 'hips' && this._activeHiPS?.isGalacticHips) {
16846
- return 'galactic';
17064
+ if (this._activeBaseLayer === "hips" && this._activeHiPS?.isGalacticHips) {
17065
+ return "galactic";
16847
17066
  }
16848
- return 'equatorial';
17067
+ return "equatorial";
16849
17068
  }
16850
17069
  resetAxesOrientation() {
16851
17070
  const center = this.updateCentralPoint();
@@ -16868,7 +17087,7 @@ class AstroSphere {
16868
17087
  return this.keepCameraNorthUp;
16869
17088
  }
16870
17089
  getFoV() {
16871
- if (this._activeBaseLayer === 'xyz' && this._activeXYZ2) {
17090
+ if (this._activeBaseLayer === "xyz" && this._activeXYZ2) {
16872
17091
  return this._activeXYZ2.getFoV();
16873
17092
  }
16874
17093
  return this.fov;
@@ -16885,11 +17104,15 @@ class AstroSphere {
16885
17104
  this._camera.refreshFoV(this.fov.minFoV);
16886
17105
  }
16887
17106
  changeFoV2(deg) {
16888
- const newCameraPos = this._healpixGrid.getFoV().computeCameraPositionForFoV(deg);
17107
+ const newCameraPos = this._healpixGrid
17108
+ .getFoV()
17109
+ .computeCameraPositionForFoV(deg);
16889
17110
  this._camera.setCameraPosition(newCameraPos);
16890
17111
  }
16891
17112
  changeFoV3(deg) {
16892
- const newPos = this._healpixGrid.getFoV().computeCameraPositionForAngularDiameter(deg);
17113
+ const newPos = this._healpixGrid
17114
+ .getFoV()
17115
+ .computeCameraPositionForAngularDiameter(deg);
16893
17116
  this._camera.setCameraPosition(newPos);
16894
17117
  // Recompute projection after moving the camera
16895
17118
  this._perspectiveMatrixManager.computePerspectiveMatrix(this.canvas, this._camera, Config_js_1.bootSetup.camera_fov_deg, Config_js_1.bootSetup.camera_near_plane, false);
@@ -16898,9 +17121,22 @@ class AstroSphere {
16898
17121
  return Global_js_1.default.insideSphere;
16899
17122
  }
16900
17123
  toggleInsideSphere() {
17124
+ const centerBeforeToggle = this.updateCentralPoint();
17125
+ this.inertiaX = 0;
17126
+ this.inertiaY = 0;
17127
+ this.zoomInertia = 0;
16901
17128
  Global_js_1.default.insideSphere = !Global_js_1.default.insideSphere;
16902
17129
  // console.log(global.insideSphere)
16903
17130
  this._camera.toggleInsideSphere();
17131
+ this._camera.goTo(centerBeforeToggle.astroDeg.ra, centerBeforeToggle.astroDeg.dec);
17132
+ this._perspectiveMatrixManager.computePerspectiveMatrix(this.canvas, this._camera, Config_js_1.bootSetup.camera_fov_deg, Config_js_1.bootSetup.camera_near_plane, Global_js_1.default.insideSphere);
17133
+ this.fov = this._healpixGrid.refreshFoV(this._camera, this._perspectiveMatrixManager.pMatrix);
17134
+ this._camera.refreshFoV(this.fov.minFoV);
17135
+ this.updateCentralPoint();
17136
+ this.lastCameraMotionAt = performance.now();
17137
+ this._cameraStatusChanged = true;
17138
+ this.emitCameraChanged("inside-sphere-toggle");
17139
+ requestAnimationFrame(() => this.draw(this.canvas));
16904
17140
  }
16905
17141
  // imposta posizione camera
16906
17142
  setCameraPosition(pos) {
@@ -16935,6 +17171,13 @@ class AstroSphere {
16935
17171
  if (centralradeg == null || centraldecdeg == null) {
16936
17172
  return null;
16937
17173
  }
17174
+ let fovPolygon = [];
17175
+ try {
17176
+ fovPolygon = this.getFoVPolygon();
17177
+ }
17178
+ catch (error) {
17179
+ console.warn("[AstroSphere] getCurrentStatus: FoV polygon is not available.", error);
17180
+ }
16938
17181
  // if (this._rotating && centraldecdeg && centralradeg) {
16939
17182
  const detail = {
16940
17183
  fovDeg: this.fov.minFoV,
@@ -16949,7 +17192,7 @@ class AstroSphere {
16949
17192
  centralPoint: new Point_js_1.Point({ raDeg: centralradeg, decDeg: centraldecdeg }, CoordsType_js_1.CoordsType.ASTRO),
16950
17193
  mouseHoverPoint: this.mousePointCoords,
16951
17194
  colorMap: this._selectedColorMap,
16952
- getFoVPolygon: this.getFoVPolygon(),
17195
+ getFoVPolygon: fovPolygon,
16953
17196
  };
16954
17197
  return detail;
16955
17198
  // }
@@ -16981,7 +17224,9 @@ class AstroSphere {
16981
17224
  this._camera.setRotationLock({ y: locked });
16982
17225
  if (locked)
16983
17226
  this.inertiaX = 0;
16984
- this.lockedEastWestRaDeg = locked ? this.updateCentralPoint()?.astroDeg.ra ?? null : null;
17227
+ this.lockedEastWestRaDeg = locked
17228
+ ? (this.updateCentralPoint()?.astroDeg.ra ?? null)
17229
+ : null;
16985
17230
  }
16986
17231
  isEastWestRotationLocked() {
16987
17232
  return this._camera.isRotationLockedY();
@@ -16990,7 +17235,9 @@ class AstroSphere {
16990
17235
  this._camera.setRotationLock({ x: locked });
16991
17236
  if (locked)
16992
17237
  this.inertiaY = 0;
16993
- this.lockedNorthSouthDecDeg = locked ? this.updateCentralPoint()?.astroDeg.dec ?? null : null;
17238
+ this.lockedNorthSouthDecDeg = locked
17239
+ ? (this.updateCentralPoint()?.astroDeg.dec ?? null)
17240
+ : null;
16994
17241
  }
16995
17242
  isNorthSouthRotationLocked() {
16996
17243
  return this._camera.isRotationLockedX();
@@ -17002,6 +17249,11 @@ class AstroSphere {
17002
17249
  requests: XYZTileRequestScheduler_js_1.xyzTileRequestScheduler.getDebugStats(),
17003
17250
  };
17004
17251
  }
17252
+ getHiPSDebugStats() {
17253
+ if (!this._activeHiPS)
17254
+ return null;
17255
+ return this._activeHiPS.getDebugStats();
17256
+ }
17005
17257
  draw(canvas) {
17006
17258
  if (this._refreshingStatus)
17007
17259
  return;
@@ -17027,6 +17279,7 @@ class AstroSphere {
17027
17279
  if (Math.abs(this.zoomInertia) > 0.0001) {
17028
17280
  this._camera.zoom(this.zoomInertia);
17029
17281
  this.zoomInertia *= 0.95;
17282
+ this.lastCameraMotionAt = performance.now();
17030
17283
  this.fov = this._healpixGrid.refreshFoV(this._camera, this._perspectiveMatrixManager.pMatrix);
17031
17284
  this._camera.refreshFoV(this.fov.minFoV);
17032
17285
  if (this.prevFov !== this.fov.minFoV) {
@@ -17042,7 +17295,9 @@ class AstroSphere {
17042
17295
  this._cameraStatusChanged = true;
17043
17296
  }
17044
17297
  // Rotation inertia
17045
- if (this.mouseDown || Math.abs(this.inertiaX) > 0.02 || Math.abs(this.inertiaY) > 0.02) {
17298
+ if (this.mouseDown ||
17299
+ Math.abs(this.inertiaX) > 0.02 ||
17300
+ Math.abs(this.inertiaY) > 0.02) {
17046
17301
  cameraRotated = true;
17047
17302
  const filteredInertia = this.filterRotationDeltaByAstroLocks(this.inertiaX, this.inertiaY);
17048
17303
  PHI = filteredInertia.deltaX;
@@ -17050,6 +17305,7 @@ class AstroSphere {
17050
17305
  this.inertiaX = filteredInertia.deltaX * 0.95;
17051
17306
  this.inertiaY = filteredInertia.deltaY * 0.95;
17052
17307
  this._camera.rotate(PHI, THETA);
17308
+ this.lastCameraMotionAt = performance.now();
17053
17309
  this._perspectiveMatrixManager.computePerspectiveMatrix(canvas, this._camera, Config_js_1.bootSetup.camera_fov_deg, Config_js_1.bootSetup.camera_near_plane, Global_js_1.default.insideSphere);
17054
17310
  const lockCorrected = this.enforceAstronomicalRotationLocks();
17055
17311
  if (!lockCorrected) {
@@ -17060,6 +17316,12 @@ class AstroSphere {
17060
17316
  this.inertiaY = 0;
17061
17317
  this.inertiaX = 0;
17062
17318
  }
17319
+ const nextFoV = this._healpixGrid.refreshFoV(this._camera, this._perspectiveMatrixManager.pMatrix);
17320
+ if (Number.isFinite(nextFoV.minFoV) && nextFoV.minFoV > 0) {
17321
+ this.fov = nextFoV;
17322
+ this._camera.refreshFoV(this.fov.minFoV);
17323
+ this.prevFov = this.fov.minFoV;
17324
+ }
17063
17325
  // Se la camera è ruotata (anche solo per inerzia), aggiorna punto centrale + emetti cameraChanged
17064
17326
  if (cameraRotated) {
17065
17327
  // Ricalcola il punto centrale
@@ -17077,16 +17339,20 @@ class AstroSphere {
17077
17339
  }
17078
17340
  }
17079
17341
  if (this._cameraStatusChanged) {
17080
- const detail = this.getCurrentStatus();
17342
+ const now = performance.now();
17343
+ const shouldEmitCameraChanged = !this.mouseDown || now - this.lastCameraChangedAt > 100;
17344
+ const detail = shouldEmitCameraChanged ? this.getCurrentStatus() : null;
17081
17345
  if (detail) {
17082
17346
  // console.log('[AstroSphere::draw] emitting camera-changed event due to camera status change', detail)
17083
17347
  // console.log('[AstroSphere::draw] inertia', this.zoomInertia, this.inertiaX, this.inertiaY)
17084
- this.canvas.dispatchEvent(new CustomEvent('camera-changed', {
17348
+ this.canvas.dispatchEvent(new CustomEvent("camera-changed", {
17085
17349
  detail,
17086
- bubbles: true, composed: true,
17350
+ bubbles: true,
17351
+ composed: true,
17087
17352
  }));
17353
+ this.lastCameraChangedAt = now;
17088
17354
  }
17089
- if (!this.startup) {
17355
+ if (!this.startup && shouldEmitCameraChanged) {
17090
17356
  this._cameraStatusChanged = false;
17091
17357
  }
17092
17358
  }
@@ -17096,23 +17362,39 @@ class AstroSphere {
17096
17362
  this._webgl.enable(this._webgl.CULL_FACE);
17097
17363
  this._webgl.cullFace(Global_js_1.default.insideSphere ? this._webgl.FRONT : this._webgl.BACK);
17098
17364
  this._webgl.blendFunc(this._webgl.SRC_ALPHA, this._webgl.ONE_MINUS_SRC_ALPHA);
17099
- if (this._activeBaseLayer === 'hips' && this._activeHiPS) {
17365
+ if (this._activeBaseLayer === "hips" && this._activeHiPS) {
17100
17366
  const visibleOrder = Math.min(this._healpixGrid.visibleorder, this._activeHiPS.maxOrder);
17101
17367
  this._healpixGrid.visibleTilesManager.computeVisiblePixels(visibleOrder, this._webgl, this._camera, this._perspectiveMatrixManager.pMatrix);
17102
17368
  }
17103
17369
  // DRAW HiPS
17370
+ const stableFovDeg = this.fov?.minFoV ?? this._healpixGrid.getMinFoV();
17371
+ const nowForGrid = performance.now();
17372
+ const cameraMovingForGrid = this.mouseDown ||
17373
+ Math.abs(this.zoomInertia) > 0.0001 ||
17374
+ Math.abs(this.inertiaX) > 0.02 ||
17375
+ Math.abs(this.inertiaY) > 0.02 ||
17376
+ nowForGrid - this.lastCameraMotionAt < 220;
17377
+ // const skyEntityDrawInput: SkyEntityDrawInput = {
17378
+ // fovDeg: this._healpixGrid.getMinFoV(),
17379
+ // camera: this._camera,
17380
+ // pMatrix: this._perspectiveMatrixManager.pMatrix,
17381
+ // centerSphericalDeg: this.updateCentralPoint().sphericalDeg,
17382
+ // fovPolygon: this._activeBaseLayer === 'xyz' ? this.getFoVPolygon() : undefined,
17383
+ // viewportSphericalSamples: this._activeBaseLayer === 'xyz' ? this.collectViewportSphericalSamples(7) : undefined,
17384
+ // }
17104
17385
  const skyEntityDrawInput = {
17105
- fovDeg: this._healpixGrid.getMinFoV(),
17386
+ fovDeg: stableFovDeg,
17106
17387
  camera: this._camera,
17107
17388
  pMatrix: this._perspectiveMatrixManager.pMatrix,
17108
17389
  centerSphericalDeg: this.updateCentralPoint().sphericalDeg,
17109
- fovPolygon: this._activeBaseLayer === 'xyz' ? this.getFoVPolygon() : undefined,
17110
- viewportSphericalSamples: this._activeBaseLayer === 'xyz' ? this.collectViewportSphericalSamples(7) : undefined,
17390
+ fovPolygon: undefined,
17391
+ viewportSphericalSamples: undefined,
17392
+ cameraMoving: cameraMovingForGrid,
17111
17393
  };
17112
- if (this._activeBaseLayer === 'hips') {
17394
+ if (this._activeBaseLayer === "hips") {
17113
17395
  this._activeHiPS?.draw(skyEntityDrawInput);
17114
17396
  }
17115
- if (this._activeBaseLayer === 'xyz') {
17397
+ if (this._activeBaseLayer === "xyz") {
17116
17398
  this._activeXYZ2?.draw(skyEntityDrawInput);
17117
17399
  }
17118
17400
  this._healpixGrid.draw(skyEntityDrawInput);
@@ -17125,24 +17407,27 @@ class AstroSphere {
17125
17407
  const raDecDeg = (0, Utils_js_1.sphericalToAstroDeg)(phiTheta.phi, phiTheta.theta);
17126
17408
  const raHMS = (0, Utils_js_1.raDegToHMS)(raDecDeg.ra);
17127
17409
  const decDMS = (0, Utils_js_1.decDegToDMS)(raDecDeg.dec);
17128
- this.prevFov = this._healpixGrid.getMinFoV();
17410
+ // this.prevFov = this._healpixGrid.getMinFoV();
17411
+ this.prevFov = this.fov?.minFoV ?? this._healpixGrid.getMinFoV();
17129
17412
  this._cameraStatusChanged = true;
17130
- console.log('(startup coords)', {
17413
+ console.log("(startup coords)", {
17131
17414
  raDeg: raDecDeg.ra,
17132
17415
  decDeg: raDecDeg.dec,
17133
17416
  raHMS,
17134
17417
  decDMS,
17135
17418
  });
17136
17419
  }
17137
- this.activeCatalogues.forEach(cat => {
17138
- const activeModelMatrix = this._activeHiPS?.getModelMatrix() ?? this._activeXYZ2?.getModelMatrix();
17420
+ this.activeCatalogues.forEach((cat) => {
17421
+ const activeModelMatrix = this._activeHiPS?.getModelMatrix() ??
17422
+ this._activeXYZ2?.getModelMatrix();
17139
17423
  if (activeModelMatrix) {
17140
17424
  cat.draw(activeModelMatrix, this.mouseHelper, this._camera.getCameraMatrix(), this._perspectiveMatrixManager.pMatrix);
17141
17425
  }
17142
17426
  });
17143
17427
  this.emitHoveredSourceIfChanged();
17144
- this.activeFootprintSets.forEach(fst => {
17145
- const activeModelMatrix = this._activeHiPS?.getModelMatrix() ?? this._activeXYZ2?.getModelMatrix();
17428
+ this.activeFootprintSets.forEach((fst) => {
17429
+ const activeModelMatrix = this._activeHiPS?.getModelMatrix() ??
17430
+ this._activeXYZ2?.getModelMatrix();
17146
17431
  if (activeModelMatrix) {
17147
17432
  fst.draw(activeModelMatrix, this.mouseHelper, this._camera.getCameraMatrix(), this._perspectiveMatrixManager.pMatrix);
17148
17433
  }
@@ -17159,13 +17444,13 @@ class AstroSphere {
17159
17444
  nextHoveredCatalogue = cat;
17160
17445
  break;
17161
17446
  }
17162
- const unchanged = nextHoveredSource === this.lastHoveredSource
17163
- && nextHoveredCatalogue === this.lastHoveredCatalogue;
17447
+ const unchanged = nextHoveredSource === this.lastHoveredSource &&
17448
+ nextHoveredCatalogue === this.lastHoveredCatalogue;
17164
17449
  if (unchanged)
17165
17450
  return;
17166
17451
  this.lastHoveredSource = nextHoveredSource;
17167
17452
  this.lastHoveredCatalogue = nextHoveredCatalogue;
17168
- this._webgl.canvas.dispatchEvent(new CustomEvent('source-hovered', {
17453
+ this._webgl.canvas.dispatchEvent(new CustomEvent("source-hovered", {
17169
17454
  detail: { source: nextHoveredSource, catalogue: nextHoveredCatalogue },
17170
17455
  bubbles: true,
17171
17456
  composed: true,
@@ -17718,6 +18003,9 @@ class MetadataManager {
17718
18003
  set selectedDecColumn(columnName) {
17719
18004
  this._selectedDecColumn = this._decColumnList.find(c => c.name === columnName) || this._selectedDecColumn;
17720
18005
  }
18006
+ set selectedOutlineColumn(columnName) {
18007
+ this._selectedOutlineColumn = this._outlineColumnList.find(c => c.name === columnName) || this._selectedOutlineColumn;
18008
+ }
17721
18009
  set selectedHueColumn(columnName) {
17722
18010
  this._selectedHueColumn = this._hueColumnList.find(c => c.name === columnName);
17723
18011
  }
@@ -17725,7 +18013,7 @@ class MetadataManager {
17725
18013
  this._selectedShapeColumn = this._shapeColumnList.find(c => c.name === columnName);
17726
18014
  }
17727
18015
  set selectedNameColumn(columnName) {
17728
- this._selectedNameColumn = this._shapeColumnList.find(c => c.name === columnName);
18016
+ this._selectedNameColumn = this._columns.find(c => c.name === columnName);
17729
18017
  }
17730
18018
  resetShapeColumn() {
17731
18019
  this._selectedShapeColumn = undefined;
@@ -18073,7 +18361,7 @@ class SphereFoV {
18073
18361
  }
18074
18362
  const angleDeg = 2 * this.computeAngularDistanceDeg(centerHit.point, edgeHit.point);
18075
18363
  return {
18076
- angleDeg: insideSphere ? 360 - angleDeg : angleDeg,
18364
+ angleDeg,
18077
18365
  distance: edgeHit.distance,
18078
18366
  };
18079
18367
  }
@@ -18081,8 +18369,9 @@ class SphereFoV {
18081
18369
  const aNorm = gl_matrix_1.vec3.normalize(gl_matrix_1.vec3.create(), a);
18082
18370
  const bNorm = gl_matrix_1.vec3.normalize(gl_matrix_1.vec3.create(), b);
18083
18371
  const dot = gl_matrix_1.vec3.dot(aNorm, bNorm);
18084
- const clamped = Math.min(1, Math.max(-1, dot));
18085
- return (0, Utils_js_1.radToDeg)(Math.acos(clamped));
18372
+ const cross = gl_matrix_1.vec3.cross(gl_matrix_1.vec3.create(), aNorm, bNorm);
18373
+ const angleRad = Math.atan2(gl_matrix_1.vec3.length(cross), Math.min(1, Math.max(-1, dot)));
18374
+ return (0, Utils_js_1.radToDeg)(angleRad);
18086
18375
  }
18087
18376
  getIntersectionPointWithModel(mouseX, mouseY, model, camera, pMatrix) {
18088
18377
  const rayWorld = this.getRayFromMouse(mouseX, mouseY, pMatrix, camera.getCameraMatrix());
@@ -18558,6 +18847,7 @@ class Point {
18558
18847
  _raRad;
18559
18848
  _decRad;
18560
18849
  _raDecDeg;
18850
+ _lonLatDeg;
18561
18851
  constructor(in_options, in_type) {
18562
18852
  this._xyz = [0, 0, 0];
18563
18853
  this._raDecDeg = [0, 0];
@@ -18589,6 +18879,20 @@ class Point {
18589
18879
  this._z = Number(z.toFixed(MAX_DECIMALS));
18590
18880
  this._xyz = [this._x, this._y, this._z];
18591
18881
  }
18882
+ else if (in_type === CoordsType_js_1.CoordsType.GEOGRAPHIC) {
18883
+ const { lonDeg, latDeg } = in_options;
18884
+ this._lonLatDeg = [Number(lonDeg), Number(latDeg)];
18885
+ this._raDeg = this._lonLatDeg[0];
18886
+ this._decDeg = this._lonLatDeg[1];
18887
+ this._raDecDeg = [this._raDeg, this._decDeg];
18888
+ this._raRad = (this._raDeg * Math.PI) / 180;
18889
+ this._decRad = (this._decDeg * Math.PI) / 180;
18890
+ const [x, y, z] = this.computeCartesianCoords();
18891
+ this._x = Number(x.toFixed(MAX_DECIMALS));
18892
+ this._y = Number(y.toFixed(MAX_DECIMALS));
18893
+ this._z = Number(z.toFixed(MAX_DECIMALS));
18894
+ this._xyz = [this._x, this._y, this._z];
18895
+ }
18592
18896
  else if (in_type === CoordsType_js_1.CoordsType.SPHERICAL) {
18593
18897
  // Not implemented in original; keep behavior
18594
18898
  console.log(`${CoordsType_js_1.CoordsType.SPHERICAL} not implemented yet`);
@@ -18665,6 +18969,9 @@ class Point {
18665
18969
  get raDeg() { return this._raDeg; }
18666
18970
  get decDeg() { return this._decDeg; }
18667
18971
  get raDecDeg() { return this._raDecDeg; }
18972
+ get lonDeg() { return this._lonLatDeg?.[0] ?? this._raDeg; }
18973
+ get latDeg() { return this._lonLatDeg?.[1] ?? this._decDeg; }
18974
+ get lonLatDeg() { return this._lonLatDeg ?? [this._raDeg, this._decDeg]; }
18668
18975
  toADQL() {
18669
18976
  return `${this._raDecDeg[0]},${this._raDecDeg[1]}`;
18670
18977
  }
@@ -18898,13 +19205,11 @@ class Camera {
18898
19205
  toggleInsideSphere() {
18899
19206
  // if (inside !== global.insideSphere) {
18900
19207
  // global.insideSphere = inside;
19208
+ this.insideSphere = Global_js_1.default.insideSphere;
18901
19209
  if (Global_js_1.default.insideSphere) {
18902
- if (this.cam_pos[2] <= 2) {
18903
- this.cam_pos[2] = -2 + this.cam_pos[2];
18904
- }
18905
- else {
18906
- this.cam_pos[2] = -0.005;
18907
- }
19210
+ this.cam_pos[0] = 0;
19211
+ this.cam_pos[1] = 0;
19212
+ this.cam_pos[2] = -0.005;
18908
19213
  }
18909
19214
  else {
18910
19215
  this.cam_pos[2] = 2.0 + this.cam_pos[2];
@@ -19841,6 +20146,7 @@ class LatLonGrid extends AbstractSkyEntity_js_1.AbstractSkyEntity {
19841
20146
  _showGrid = true;
19842
20147
  _lonArray = [];
19843
20148
  _latArray = [];
20149
+ _bufferKey = '';
19844
20150
  defaultColor = '#41d4d4';
19845
20151
  gridText = new GridTextHelper_js_1.default('lonlat');
19846
20152
  constructor(radius, position, xrad, yrad, name, webgl) {
@@ -19887,28 +20193,67 @@ class LatLonGrid extends AbstractSkyEntity_js_1.AbstractSkyEntity {
19887
20193
  }
19888
20194
  gl.useProgram(this._shaderProgram);
19889
20195
  }
19890
- initBuffers(fovDeg) {
19891
- const steps = XYZFoVHelper_js_1.xyzFovHelper.getLonLatSteps(fovDeg);
20196
+ initBuffers(fovDeg, centerSphericalDeg, coarse = false) {
20197
+ const steps = XYZFoVHelper_js_1.xyzFovHelper.getLonLatSteps(fovDeg, coarse);
19892
20198
  this._lonStep = steps.lonStep;
19893
20199
  this._latStep = steps.latStep;
19894
20200
  this._segmentStep = Math.max(Math.min(this._lonStep, this._latStep), 0.25);
19895
20201
  this._lonArray = [];
19896
20202
  this._latArray = [];
19897
- for (let lon = -180; lon < 180; lon += this._lonStep) {
20203
+ const center = centerSphericalDeg
20204
+ ? {
20205
+ lon: this.normalizeLon(centerSphericalDeg.phi > 180 ? centerSphericalDeg.phi - 360 : centerSphericalDeg.phi),
20206
+ lat: 90 - centerSphericalDeg.theta,
20207
+ }
20208
+ : null;
20209
+ const localGrid = !!center && !coarse && fovDeg < 2;
20210
+ const lonValues = localGrid
20211
+ ? this.buildLonRange(center.lon, Math.max(fovDeg * 4, this._lonStep * 3), this._lonStep)
20212
+ : this.buildLonRange(0, 180, this._lonStep);
20213
+ const latValues = localGrid
20214
+ ? this.buildLatRange(center.lat, Math.max(fovDeg * 4, this._latStep * 3), this._latStep)
20215
+ : this.buildLatRange(0, 90, this._latStep);
20216
+ const latSegmentRange = localGrid && center
20217
+ ? this.buildLatRange(center.lat, Math.max(fovDeg * 4, this._latStep * 3), this._segmentStep)
20218
+ : this.buildLatRange(0, 90, this._segmentStep);
20219
+ const lonSegmentRange = localGrid && center
20220
+ ? this.buildLonRange(center.lon, Math.max(fovDeg * 4, this._lonStep * 3), this._segmentStep)
20221
+ : this.buildLonRange(0, 180, this._segmentStep);
20222
+ for (const lon of lonValues) {
19898
20223
  const vertices = [];
19899
- for (let lat = -90; lat <= 90; lat += this._segmentStep) {
20224
+ for (const lat of latSegmentRange) {
19900
20225
  vertices.push(...this.lonLatToCartesian(lon, Math.min(lat, 90)));
19901
20226
  }
19902
20227
  this._lonArray.push(new Float32Array(vertices));
19903
20228
  }
19904
- for (let lat = -90 + this._latStep; lat < 90; lat += this._latStep) {
20229
+ for (const lat of latValues) {
19905
20230
  const vertices = [];
19906
- for (let lon = -180; lon <= 180; lon += this._segmentStep) {
20231
+ if (lat <= -90 || lat >= 90)
20232
+ continue;
20233
+ for (const lon of lonSegmentRange) {
19907
20234
  vertices.push(...this.lonLatToCartesian(Math.min(lon, 180), lat));
19908
20235
  }
19909
20236
  this._latArray.push(new Float32Array(vertices));
19910
20237
  }
19911
20238
  }
20239
+ buildLonRange(centerLon, halfSpan, step) {
20240
+ const values = [];
20241
+ const start = Math.floor((centerLon - halfSpan) / step) * step;
20242
+ const end = Math.ceil((centerLon + halfSpan) / step) * step;
20243
+ for (let lon = start; lon <= end; lon += step) {
20244
+ values.push(this.normalizeLon(lon));
20245
+ }
20246
+ return values;
20247
+ }
20248
+ buildLatRange(centerLat, halfSpan, step) {
20249
+ const values = [];
20250
+ const start = Math.max(-90, Math.floor((centerLat - halfSpan) / step) * step);
20251
+ const end = Math.min(90, Math.ceil((centerLat + halfSpan) / step) * step);
20252
+ for (let lat = start; lat <= end; lat += step) {
20253
+ values.push(lat);
20254
+ }
20255
+ return values;
20256
+ }
19912
20257
  lonLatToCartesian(lonDeg, latDeg) {
19913
20258
  const lonRad = (0, Utils_js_1.degToRad)(lonDeg);
19914
20259
  const latRad = (0, Utils_js_1.degToRad)(latDeg);
@@ -19919,17 +20264,28 @@ class LatLonGrid extends AbstractSkyEntity_js_1.AbstractSkyEntity {
19919
20264
  Math.sin(latRad),
19920
20265
  ];
19921
20266
  }
19922
- refresh(fovDeg) {
19923
- if (Math.abs(this._fovDeg - fovDeg) > 1e-6) {
20267
+ refresh(fovDeg, input) {
20268
+ const coarse = !!input.cameraMoving;
20269
+ const steps = XYZFoVHelper_js_1.xyzFovHelper.getLonLatSteps(fovDeg, coarse);
20270
+ const center = input.centerSphericalDeg;
20271
+ const localGrid = !!center && !coarse && fovDeg < 2;
20272
+ const centerLon = center ? this.normalizeLon(center.phi > 180 ? center.phi - 360 : center.phi) : 0;
20273
+ const centerLat = center ? 90 - center.theta : 0;
20274
+ const centerKey = localGrid
20275
+ ? `${this.roundToStep(centerLon, Math.max(steps.lonStep, fovDeg))}:${this.roundToStep(centerLat, Math.max(steps.latStep, fovDeg))}`
20276
+ : 'global';
20277
+ const bufferKey = `${coarse ? 'coarse' : 'settled'}:${steps.lonStep}:${steps.latStep}:${centerKey}`;
20278
+ if (this._bufferKey !== bufferKey) {
19924
20279
  this._fovDeg = fovDeg;
19925
- this.initBuffers(this._fovDeg);
20280
+ this._bufferKey = bufferKey;
20281
+ this.initBuffers(this._fovDeg, input.centerSphericalDeg, coarse);
19926
20282
  }
19927
20283
  }
19928
20284
  refreshFoV(input) {
19929
20285
  if (!input.camera || !input.pMatrix)
19930
20286
  return this._fovDeg;
19931
20287
  this._fovObj.getFoV(Global_js_1.default.insideSphere, this, input.camera, input.pMatrix);
19932
- this.refresh(this._fovObj.minFoV);
20288
+ this.refresh(this._fovObj.minFoV, input);
19933
20289
  return this._fovObj.minFoV;
19934
20290
  }
19935
20291
  getMinFoVDeg() {
@@ -20091,6 +20447,7 @@ var CoordsType;
20091
20447
  CoordsType["CARTESIAN"] = "cartesian";
20092
20448
  CoordsType["SPHERICAL"] = "spherical";
20093
20449
  CoordsType["ASTRO"] = "astro";
20450
+ CoordsType["GEOGRAPHIC"] = "geographic";
20094
20451
  })(CoordsType || (exports.CoordsType = CoordsType = {}));
20095
20452
  // export default CoordsType;
20096
20453
 
@@ -20172,6 +20529,9 @@ class Tile {
20172
20529
  getReadyState() {
20173
20530
  return this._ready;
20174
20531
  }
20532
+ isLoading() {
20533
+ return !this._ready && !this._abort;
20534
+ }
20175
20535
  get cacheTime0() {
20176
20536
  return this._cacheTime0;
20177
20537
  }
@@ -20496,7 +20856,40 @@ exports["default"] = Tile;
20496
20856
  Object.defineProperty(exports, "__esModule", ({ value: true }));
20497
20857
  exports.xyzFovHelper = void 0;
20498
20858
  class XYZFoVHelper {
20499
- getZoom(fov) {
20859
+ static LEVEL_HYSTERESIS = 0.12;
20860
+ static ZOOM_MIN_FOV = {
20861
+ 2: 179,
20862
+ 3: 90,
20863
+ 4: 30,
20864
+ 5: 20,
20865
+ 6: 6,
20866
+ 7: 3.2,
20867
+ 8: 1.6,
20868
+ 9: 0.85,
20869
+ 10: 0.42,
20870
+ 11: 0.21,
20871
+ 12: 0.12,
20872
+ 13: 0.06,
20873
+ 14: 0.015,
20874
+ 15: 0,
20875
+ };
20876
+ getZoom(fov, currentZoom) {
20877
+ const rawZoom = this.getRawZoom(fov);
20878
+ if (currentZoom === undefined || currentZoom === rawZoom)
20879
+ return rawZoom;
20880
+ if (rawZoom > currentZoom) {
20881
+ const boundary = XYZFoVHelper.ZOOM_MIN_FOV[currentZoom];
20882
+ if (boundary > 0 && fov > boundary * (1 - XYZFoVHelper.LEVEL_HYSTERESIS))
20883
+ return currentZoom;
20884
+ }
20885
+ else {
20886
+ const boundary = XYZFoVHelper.ZOOM_MIN_FOV[rawZoom];
20887
+ if (boundary > 0 && fov < boundary * (1 + XYZFoVHelper.LEVEL_HYSTERESIS))
20888
+ return currentZoom;
20889
+ }
20890
+ return rawZoom;
20891
+ }
20892
+ getRawZoom(fov) {
20500
20893
  if (fov >= 179)
20501
20894
  return 2;
20502
20895
  if (fov >= 90)
@@ -20526,10 +20919,14 @@ class XYZFoVHelper {
20526
20919
  return 15;
20527
20920
  }
20528
20921
  // used in grid drawing
20529
- getLonLatSteps(fov) {
20922
+ getLonLatSteps(fov, coarse = false) {
20530
20923
  let lonStep;
20531
20924
  let latStep;
20532
- if (fov >= 179) {
20925
+ if (coarse && fov < 0.21) {
20926
+ lonStep = 10;
20927
+ latStep = 10;
20928
+ }
20929
+ else if (fov >= 179) {
20533
20930
  lonStep = 10;
20534
20931
  latStep = 10;
20535
20932
  }
@@ -20584,6 +20981,127 @@ exports.xyzFovHelper = new XYZFoVHelper();
20584
20981
  exports["default"] = XYZFoVHelper;
20585
20982
 
20586
20983
 
20984
+ /***/ }),
20985
+
20986
+ /***/ 8755:
20987
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
20988
+
20989
+
20990
+ /*
20991
+ * AstroViewer
20992
+ * Copyright (C) Fabrizio Giordano
20993
+ * SPDX-License-Identifier: LicenseRef-AstroViewer-Dual-License
20994
+ *
20995
+ * This file is part of AstroViewer.
20996
+ * AstroViewer is distributed under a dual-license model.
20997
+ * Commercial use requires a separate commercial license.
20998
+ * Non-commercial use is governed by LICENSE-NONCOMMERCIAL.md.
20999
+ *
21000
+ * See LICENSE.md, LICENSE-COMMERCIAL.md, and LICENSE-NONCOMMERCIAL.md for details.
21001
+ */
21002
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
21003
+ const CoordsType_js_1 = __webpack_require__(8145);
21004
+ const Point_js_1 = __webpack_require__(6553);
21005
+ class GeoJSONParser {
21006
+ static isGeoJSON(value) {
21007
+ if (!value || typeof value !== 'object')
21008
+ return false;
21009
+ const type = value.type;
21010
+ return type === 'FeatureCollection'
21011
+ || type === 'Feature'
21012
+ || type === 'Polygon'
21013
+ || type === 'MultiPolygon'
21014
+ || type === 'GeometryCollection';
21015
+ }
21016
+ static parseGeoJSON(value) {
21017
+ if (!value || typeof value !== 'object') {
21018
+ throw new Error('GeoJSON root must be an object');
21019
+ }
21020
+ const obj = value;
21021
+ if (obj.type === 'FeatureCollection') {
21022
+ if (!Array.isArray(obj.features))
21023
+ throw new Error('GeoJSON FeatureCollection has no features array');
21024
+ return obj.features.flatMap((feature) => GeoJSONParser.parseFeature(feature));
21025
+ }
21026
+ if (obj.type === 'Feature')
21027
+ return GeoJSONParser.parseFeature(obj);
21028
+ if (obj.type === 'Polygon' || obj.type === 'MultiPolygon' || obj.type === 'GeometryCollection') {
21029
+ return GeoJSONParser.parseGeometry(obj, {});
21030
+ }
21031
+ throw new Error(`Unsupported GeoJSON type: ${obj.type ?? 'unknown'}`);
21032
+ }
21033
+ static parseFeature(value) {
21034
+ if (!value || typeof value !== 'object')
21035
+ throw new Error('GeoJSON feature must be an object');
21036
+ const feature = value;
21037
+ if (feature.type !== 'Feature')
21038
+ throw new Error('GeoJSON feature has invalid type');
21039
+ if (!feature.geometry)
21040
+ return [];
21041
+ return GeoJSONParser.parseGeometry(feature.geometry, feature.properties ?? {}, feature.id);
21042
+ }
21043
+ static parseGeometry(geometry, properties, id) {
21044
+ if (geometry.type === 'Polygon') {
21045
+ return [{
21046
+ id,
21047
+ geometryType: 'Polygon',
21048
+ properties,
21049
+ polygons: GeoJSONParser.parsePolygonCoordinates(geometry.coordinates),
21050
+ }];
21051
+ }
21052
+ if (geometry.type === 'MultiPolygon') {
21053
+ return [{
21054
+ id,
21055
+ geometryType: 'MultiPolygon',
21056
+ properties,
21057
+ polygons: GeoJSONParser.parseMultiPolygonCoordinates(geometry.coordinates),
21058
+ }];
21059
+ }
21060
+ if (geometry.type === 'GeometryCollection') {
21061
+ if (!Array.isArray(geometry.geometries))
21062
+ return [];
21063
+ return geometry.geometries.flatMap((child) => GeoJSONParser.parseGeometry(child, properties, id));
21064
+ }
21065
+ return [];
21066
+ }
21067
+ static parseMultiPolygonCoordinates(coordinates) {
21068
+ if (!Array.isArray(coordinates))
21069
+ throw new Error('GeoJSON MultiPolygon coordinates must be an array');
21070
+ return coordinates.flatMap((polygonCoordinates) => GeoJSONParser.parsePolygonCoordinates(polygonCoordinates));
21071
+ }
21072
+ static parsePolygonCoordinates(coordinates) {
21073
+ if (!Array.isArray(coordinates))
21074
+ throw new Error('GeoJSON Polygon coordinates must be an array');
21075
+ return coordinates
21076
+ .map((ring) => GeoJSONParser.parseLinearRing(ring))
21077
+ .filter((ring) => ring.length >= 3);
21078
+ }
21079
+ static parseLinearRing(ring) {
21080
+ if (!Array.isArray(ring))
21081
+ throw new Error('GeoJSON linear ring must be an array');
21082
+ const points = ring.map((position) => GeoJSONParser.parsePosition(position));
21083
+ if (points.length > 1) {
21084
+ const first = points[0];
21085
+ const last = points[points.length - 1];
21086
+ if (first.lonDeg === last.lonDeg && first.latDeg === last.latDeg)
21087
+ points.pop();
21088
+ }
21089
+ return points;
21090
+ }
21091
+ static parsePosition(position) {
21092
+ if (!Array.isArray(position) || position.length < 2) {
21093
+ throw new Error('GeoJSON position must be [longitude, latitude]');
21094
+ }
21095
+ const [lonDeg, latDeg] = position;
21096
+ if (!Number.isFinite(lonDeg) || !Number.isFinite(latDeg)) {
21097
+ throw new Error('GeoJSON position contains non-finite longitude/latitude');
21098
+ }
21099
+ return new Point_js_1.Point({ lonDeg, latDeg }, CoordsType_js_1.CoordsType.GEOGRAPHIC);
21100
+ }
21101
+ }
21102
+ exports["default"] = GeoJSONParser;
21103
+
21104
+
20587
21105
  /***/ }),
20588
21106
 
20589
21107
  /***/ 8819:
@@ -20923,8 +21441,50 @@ exports.FootprintShaderProgram = FootprintShaderProgram;
20923
21441
  Object.defineProperty(exports, "__esModule", ({ value: true }));
20924
21442
  exports.TerraFootprintSetGL = void 0;
20925
21443
  const FootprintSetGL_js_1 = __webpack_require__(592);
21444
+ const CoordsType_js_1 = __webpack_require__(8145);
21445
+ const Footprint_js_1 = __webpack_require__(2475);
21446
+ const MetadataColumn_js_1 = __webpack_require__(1072);
21447
+ const MetadataManager_js_1 = __webpack_require__(5403);
21448
+ const MetadataColumn_js_2 = __webpack_require__(1072);
20926
21449
  class TerraFootprintSetGL extends FootprintSetGL_js_1.FootprintSetGL {
20927
21450
  _kind = 'TerraFootprintSetGL';
21451
+ _coordsType = CoordsType_js_1.CoordsType.GEOGRAPHIC;
21452
+ addGeoJSONFeatures(features) {
21453
+ this._ready = false;
21454
+ this.clearFootprints();
21455
+ this._metadataManager = new MetadataManager_js_1.MetadataManager(this.createGeoJSONMetadataColumns(features));
21456
+ for (const feature of features) {
21457
+ const footprint = Footprint_js_1.Footprint.fromPolygons(feature.polygons, this.createGeoJSONDetails(feature), CoordsType_js_1.CoordsType.GEOGRAPHIC);
21458
+ if (footprint.valid) {
21459
+ this.addFootprint(footprint);
21460
+ this.totPoints += footprint.totPoints;
21461
+ this.totConvexPoints += footprint.totConvexPoints;
21462
+ }
21463
+ }
21464
+ this._ready = true;
21465
+ this._bufferInitialised = false;
21466
+ }
21467
+ createGeoJSONMetadataColumns(features) {
21468
+ const names = new Set();
21469
+ features.forEach(feature => Object.keys(feature.properties).forEach(name => names.add(name)));
21470
+ return Array.from(names).map((name, index) => {
21471
+ const values = features.map(feature => feature.properties[name]).filter(value => value !== null && value !== undefined && value !== '');
21472
+ const isNumber = values.length > 0 && values.every(value => typeof value === 'number' || !Number.isNaN(Number(value)));
21473
+ const isName = /^name$|nome|denominazione|label|title/i.test(name);
21474
+ return new MetadataColumn_js_1.MetadataColumn({
21475
+ index,
21476
+ name,
21477
+ columnType: isName ? MetadataColumn_js_2.ColumnType.MAIN_NAME : (isNumber ? MetadataColumn_js_2.ColumnType.NUMBER : MetadataColumn_js_2.ColumnType.STRING),
21478
+ unit: '',
21479
+ });
21480
+ });
21481
+ }
21482
+ createGeoJSONDetails(feature) {
21483
+ return Object.entries(feature.properties).map(([key, value]) => ({
21484
+ key,
21485
+ value: typeof value === 'number' ? value : String(value ?? ''),
21486
+ }));
21487
+ }
20928
21488
  }
20929
21489
  exports.TerraFootprintSetGL = TerraFootprintSetGL;
20930
21490
 
@@ -20958,15 +21518,15 @@ const Point_js_1 = __webpack_require__(6553);
20958
21518
  const CoordsType_js_1 = __webpack_require__(8145);
20959
21519
  const Global_js_1 = __importDefault(__webpack_require__(4382));
20960
21520
  class STCSParser {
20961
- static parseSTCS(stcs) {
21521
+ static parseSTCS(stcs, options = {}) {
20962
21522
  const stcsParsed = STCSParser.cleanStcs(stcs);
20963
21523
  let totPoints = 0;
20964
21524
  const polygons = [];
20965
21525
  if (stcsParsed.includes("POLYGON")) {
20966
- return STCSParser.parsePolygon(stcsParsed);
21526
+ return STCSParser.parsePolygon(stcsParsed, options);
20967
21527
  }
20968
21528
  else if (stcsParsed.includes("CIRCLE")) {
20969
- return STCSParser.parseCircle(stcsParsed);
21529
+ return STCSParser.parseCircle(stcsParsed, options);
20970
21530
  }
20971
21531
  else {
20972
21532
  console.warn("STCS not recognised");
@@ -20989,10 +21549,11 @@ class STCSParser {
20989
21549
  s = s.replace(/ {2,}/g, ' ').trim();
20990
21550
  return s;
20991
21551
  }
20992
- static parsePolygon(stcs) {
21552
+ static parsePolygon(stcs, options = {}) {
20993
21553
  let totPoints = 0;
20994
21554
  const polygons = [];
20995
21555
  const MAX_DECIMALS = Global_js_1.default.MAX_DECIMALS ?? 12;
21556
+ const coordsType = options.coordsType ?? CoordsType_js_1.CoordsType.ASTRO;
20996
21557
  const polys = stcs.split("POLYGON ");
20997
21558
  for (let i = 1; i < polys.length; i++) {
20998
21559
  const currPoly = [];
@@ -21007,9 +21568,11 @@ class STCSParser {
21007
21568
  }
21008
21569
  if (points.length > 2) {
21009
21570
  for (let p = 0; p < points.length - 1; p += 2) {
21010
- const raDeg = Number(parseFloat(points[p]).toFixed(MAX_DECIMALS));
21011
- const decDeg = Number(parseFloat(points[p + 1]).toFixed(MAX_DECIMALS));
21012
- const point = new Point_js_1.Point({ raDeg, decDeg }, CoordsType_js_1.CoordsType.ASTRO);
21571
+ const xDeg = Number(parseFloat(points[p]).toFixed(MAX_DECIMALS));
21572
+ const yDeg = Number(parseFloat(points[p + 1]).toFixed(MAX_DECIMALS));
21573
+ const point = coordsType === CoordsType_js_1.CoordsType.GEOGRAPHIC
21574
+ ? new Point_js_1.Point({ lonDeg: xDeg, latDeg: yDeg }, CoordsType_js_1.CoordsType.GEOGRAPHIC)
21575
+ : new Point_js_1.Point({ raDeg: xDeg, decDeg: yDeg }, CoordsType_js_1.CoordsType.ASTRO);
21013
21576
  currPoly.push(point);
21014
21577
  totPoints += 1;
21015
21578
  }
@@ -21019,9 +21582,10 @@ class STCSParser {
21019
21582
  return { totpoints: totPoints, polygons };
21020
21583
  }
21021
21584
  // Example format: "CIRCLE ICRS 8.739685 4.38147 0.027833"
21022
- static parseCircle(stcs) {
21585
+ static parseCircle(stcs, options = {}) {
21023
21586
  let totPoints = 0;
21024
21587
  const polygons = [];
21588
+ const coordsType = options.coordsType ?? CoordsType_js_1.CoordsType.ASTRO;
21025
21589
  const polys = stcs.split("CIRCLE ");
21026
21590
  for (let i = 1; i < polys.length; i++) {
21027
21591
  const currPoly = [];
@@ -21036,7 +21600,9 @@ class STCSParser {
21036
21600
  for (let p = npoints; p > 0; p--) {
21037
21601
  const curra = radius * Math.cos(p * alpha) + ra;
21038
21602
  const curdec = radius * Math.sin(p * alpha) + dec;
21039
- const point = new Point_js_1.Point({ raDeg: curra, decDeg: curdec }, CoordsType_js_1.CoordsType.ASTRO);
21603
+ const point = coordsType === CoordsType_js_1.CoordsType.GEOGRAPHIC
21604
+ ? new Point_js_1.Point({ lonDeg: curra, latDeg: curdec }, CoordsType_js_1.CoordsType.GEOGRAPHIC)
21605
+ : new Point_js_1.Point({ raDeg: curra, decDeg: curdec }, CoordsType_js_1.CoordsType.ASTRO);
21040
21606
  currPoly.push(point);
21041
21607
  totPoints += 1;
21042
21608
  }
@@ -21069,6 +21635,7 @@ exports["default"] = STCSParser;
21069
21635
  Object.defineProperty(exports, "__esModule", ({ value: true }));
21070
21636
  exports.PerspectiveMatrixManager = void 0;
21071
21637
  const gl_matrix_1 = __webpack_require__(1961);
21638
+ const Config_js_1 = __webpack_require__(2919);
21072
21639
  class PerspectiveMatrixManager {
21073
21640
  _pMatrix;
21074
21641
  _aspectRatio = 1;
@@ -21099,7 +21666,9 @@ class PerspectiveMatrixManager {
21099
21666
  const cf = c2 * Math.sin(beta);
21100
21667
  farPlane = cf > 0 ? cf : r;
21101
21668
  }
21102
- gl_matrix_1.mat4.perspective(p, (fovDeg * Math.PI) / 180, this._aspectRatio, nearPlane, farPlane);
21669
+ const effectiveFovDeg = insideSphere ? Config_js_1.bootSetup.inside_camera_fov_deg : fovDeg;
21670
+ const effectiveNearPlane = insideSphere ? Math.max(nearPlane, 0.001) : nearPlane;
21671
+ gl_matrix_1.mat4.perspective(p, (effectiveFovDeg * Math.PI) / 180, this._aspectRatio, effectiveNearPlane, farPlane);
21103
21672
  this._pMatrix = p;
21104
21673
  return p;
21105
21674
  }
@@ -21168,6 +21737,7 @@ class EquatorialGrid extends AbstractSkyEntity_js_1.AbstractSkyEntity {
21168
21737
  _thetaStepRad = 0;
21169
21738
  _phiArray = [];
21170
21739
  _thetaArray = [];
21740
+ _bufferKey = '';
21171
21741
  // For placing text labels near current view center:
21172
21742
  // - _dec4Labels: key = RA(deg), value = points along that RA ring (for Dec labels)
21173
21743
  // - _ra4Labels : key = Dec(deg), value = points along that Dec ring (for RA labels)
@@ -21228,9 +21798,9 @@ class EquatorialGrid extends AbstractSkyEntity_js_1.AbstractSkyEntity {
21228
21798
  super.webgl.useProgram(this._shaderProgram);
21229
21799
  }
21230
21800
  /** Build RA/Dec line vertex arrays based on FoV step helper */
21231
- initBuffers(fovDeg) {
21801
+ initBuffers(fovDeg, coarse = false) {
21232
21802
  const R = 1.0;
21233
- const steps = FoVHelper_js_1.fovHelper.getRADegSteps(fovDeg);
21803
+ const steps = FoVHelper_js_1.fovHelper.getRADegSteps(fovDeg, coarse);
21234
21804
  const phiStep = steps.raStep; // RA step (deg)
21235
21805
  const thetaStep = steps.decStep; // Dec step (deg)
21236
21806
  this._phiStep = phiStep;
@@ -21282,11 +21852,14 @@ class EquatorialGrid extends AbstractSkyEntity_js_1.AbstractSkyEntity {
21282
21852
  }
21283
21853
  }
21284
21854
  /** Update buffers when FoV (in degrees) changes */
21285
- refresh(fovDeg) {
21855
+ refresh(fovDeg, coarse = false) {
21286
21856
  // const fovDeg = healpixGridSingleton.getMinFoV()
21287
- if (this._fov !== fovDeg) {
21857
+ const steps = FoVHelper_js_1.fovHelper.getRADegSteps(fovDeg, coarse);
21858
+ const bufferKey = `${coarse ? 'coarse' : 'settled'}:${steps.raStep}:${steps.decStep}`;
21859
+ if (this._bufferKey !== bufferKey) {
21288
21860
  this._fov = fovDeg;
21289
- this.initBuffers(this._fov);
21861
+ this._bufferKey = bufferKey;
21862
+ this.initBuffers(this._fov, coarse);
21290
21863
  }
21291
21864
  }
21292
21865
  vectorDistance(p1, p2) {
@@ -21346,7 +21919,7 @@ class EquatorialGrid extends AbstractSkyEntity_js_1.AbstractSkyEntity {
21346
21919
  return;
21347
21920
  if (this._thetaArray.length === 0)
21348
21921
  return;
21349
- this.refresh(fovDeg);
21922
+ this.refresh(fovDeg, !!input.cameraMoving);
21350
21923
  if (!this.showGrid) {
21351
21924
  // gridTextHelper.resetDivSets();
21352
21925
  this.gridText.resetDivSets();
@@ -21494,76 +22067,12 @@ exports.EquatorialGrid = EquatorialGrid;
21494
22067
  /******/ })();
21495
22068
  /******/
21496
22069
  /************************************************************************/
21497
- var __webpack_exports__ = {};
21498
- // This entry needs to be wrapped in an IIFE because it uses a non-standard name for the exports (exports).
21499
- (() => {
21500
- var exports = __webpack_exports__;
21501
-
21502
- /*
21503
- * AstroViewer
21504
- * Copyright (C) Fabrizio Giordano
21505
- * SPDX-License-Identifier: LicenseRef-AstroViewer-Dual-License
21506
- *
21507
- * This file is part of AstroViewer.
21508
- * AstroViewer is distributed under a dual-license model.
21509
- * Commercial use requires a separate commercial license.
21510
- * Non-commercial use is governed by LICENSE-NONCOMMERCIAL.md.
21511
- *
21512
- * See LICENSE.md, LICENSE-COMMERCIAL.md, and LICENSE-NONCOMMERCIAL.md for details.
21513
- */
21514
- Object.defineProperty(exports, "__esModule", ({ value: true }));
21515
- exports.Footprint = exports.Source = exports.WMTSAdapter = exports.XYZMap = exports.HiPS = exports.createColorMapFromSamples = exports.COLOR_MAP_SAMPLE_COUNT = exports.ColorMaps = exports.CoordsType = exports.FoVUtils = exports.CartesianOpts = exports.PointInitOpts = exports.AstroOpts = exports.SphericalOpts = exports.Point = exports.ColumnType = exports.MetadataInit = exports.MetadataColumn = exports.MetadataManager = exports.TerraFootprintSetGL = exports.TerraPointSetGL = exports.CatalogueGL = exports.FootprintSetGL = exports.HoveredFootprintDetail = exports.SphereFoV = exports.FoV = exports.HiPSDescriptor = exports.AstroViewer = void 0;
21516
- var AstroViewer_js_1 = __webpack_require__(772);
21517
- Object.defineProperty(exports, "AstroViewer", ({ enumerable: true, get: function () { return AstroViewer_js_1.AstroViewer; } }));
21518
- var HiPSDescriptor_js_1 = __webpack_require__(5087);
21519
- Object.defineProperty(exports, "HiPSDescriptor", ({ enumerable: true, get: function () { return HiPSDescriptor_js_1.HiPSDescriptor; } }));
21520
- var SphereFoV_js_1 = __webpack_require__(5803);
21521
- Object.defineProperty(exports, "FoV", ({ enumerable: true, get: function () { return SphereFoV_js_1.SphereFoV; } }));
21522
- var SphereFoV_js_2 = __webpack_require__(5803);
21523
- Object.defineProperty(exports, "SphereFoV", ({ enumerable: true, get: function () { return SphereFoV_js_2.SphereFoV; } }));
21524
- var FootprintSetGL_js_1 = __webpack_require__(592);
21525
- Object.defineProperty(exports, "HoveredFootprintDetail", ({ enumerable: true, get: function () { return FootprintSetGL_js_1.HoveredFootprintDetail; } }));
21526
- Object.defineProperty(exports, "FootprintSetGL", ({ enumerable: true, get: function () { return FootprintSetGL_js_1.FootprintSetGL; } }));
21527
- var CatalogueGL_js_1 = __webpack_require__(1232);
21528
- Object.defineProperty(exports, "CatalogueGL", ({ enumerable: true, get: function () { return CatalogueGL_js_1.CatalogueGL; } }));
21529
- var TerraPointSetGL_js_1 = __webpack_require__(5781);
21530
- Object.defineProperty(exports, "TerraPointSetGL", ({ enumerable: true, get: function () { return TerraPointSetGL_js_1.TerraPointSetGL; } }));
21531
- var TerraFootprintSetGL_js_1 = __webpack_require__(9022);
21532
- Object.defineProperty(exports, "TerraFootprintSetGL", ({ enumerable: true, get: function () { return TerraFootprintSetGL_js_1.TerraFootprintSetGL; } }));
21533
- var MetadataManager_js_1 = __webpack_require__(5403);
21534
- Object.defineProperty(exports, "MetadataManager", ({ enumerable: true, get: function () { return MetadataManager_js_1.MetadataManager; } }));
21535
- var MetadataColumn_js_1 = __webpack_require__(1072);
21536
- Object.defineProperty(exports, "MetadataColumn", ({ enumerable: true, get: function () { return MetadataColumn_js_1.MetadataColumn; } }));
21537
- Object.defineProperty(exports, "MetadataInit", ({ enumerable: true, get: function () { return MetadataColumn_js_1.MetadataInit; } }));
21538
- Object.defineProperty(exports, "ColumnType", ({ enumerable: true, get: function () { return MetadataColumn_js_1.ColumnType; } }));
21539
- var Point_js_1 = __webpack_require__(6553);
21540
- Object.defineProperty(exports, "Point", ({ enumerable: true, get: function () { return Point_js_1.Point; } }));
21541
- Object.defineProperty(exports, "SphericalOpts", ({ enumerable: true, get: function () { return Point_js_1.SphericalOpts; } }));
21542
- Object.defineProperty(exports, "AstroOpts", ({ enumerable: true, get: function () { return Point_js_1.AstroOpts; } }));
21543
- Object.defineProperty(exports, "PointInitOpts", ({ enumerable: true, get: function () { return Point_js_1.PointInitOpts; } }));
21544
- Object.defineProperty(exports, "CartesianOpts", ({ enumerable: true, get: function () { return Point_js_1.CartesianOpts; } }));
21545
- var FoVUtils_js_1 = __webpack_require__(8083);
21546
- Object.defineProperty(exports, "FoVUtils", ({ enumerable: true, get: function () { return FoVUtils_js_1.FoVUtils; } }));
21547
- var CoordsType_js_1 = __webpack_require__(8145);
21548
- Object.defineProperty(exports, "CoordsType", ({ enumerable: true, get: function () { return CoordsType_js_1.CoordsType; } }));
21549
- var ColorMaps_js_1 = __webpack_require__(619);
21550
- Object.defineProperty(exports, "ColorMaps", ({ enumerable: true, get: function () { return ColorMaps_js_1.ColorMaps; } }));
21551
- Object.defineProperty(exports, "COLOR_MAP_SAMPLE_COUNT", ({ enumerable: true, get: function () { return ColorMaps_js_1.COLOR_MAP_SAMPLE_COUNT; } }));
21552
- Object.defineProperty(exports, "createColorMapFromSamples", ({ enumerable: true, get: function () { return ColorMaps_js_1.createColorMapFromSamples; } }));
21553
- var HiPS_js_1 = __webpack_require__(3726);
21554
- Object.defineProperty(exports, "HiPS", ({ enumerable: true, get: function () { return HiPS_js_1.HiPS; } }));
21555
- var XYZMap_js_1 = __webpack_require__(1741);
21556
- Object.defineProperty(exports, "XYZMap", ({ enumerable: true, get: function () { return XYZMap_js_1.XYZMap; } }));
21557
- var WMTSAdapter_js_1 = __webpack_require__(3956);
21558
- Object.defineProperty(exports, "WMTSAdapter", ({ enumerable: true, get: function () { return WMTSAdapter_js_1.WMTSAdapter; } }));
21559
- var Source_js_1 = __webpack_require__(146);
21560
- Object.defineProperty(exports, "Source", ({ enumerable: true, get: function () { return Source_js_1.Source; } }));
21561
- var Footprint_js_1 = __webpack_require__(2475);
21562
- Object.defineProperty(exports, "Footprint", ({ enumerable: true, get: function () { return Footprint_js_1.Footprint; } }));
21563
- console.log('astroviewer UMD loaded');
21564
-
21565
- })();
21566
-
21567
- module.exports = __webpack_exports__;
22070
+ /******/
22071
+ /******/ // startup
22072
+ /******/ // Load entry module and return exports
22073
+ /******/ // This entry module is referenced by other modules so it can't be inlined
22074
+ /******/ var __webpack_exports__ = __webpack_require__(1229);
22075
+ /******/ module.exports = __webpack_exports__;
22076
+ /******/
21568
22077
  /******/ })()
21569
22078
  ;