astro-viewer 3.1.0 → 3.2.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 (50) hide show
  1. package/dist/astroviewer.cjs +706 -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 +163 -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 +2 -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) {
@@ -16949,7 +17185,7 @@ class AstroSphere {
16949
17185
  centralPoint: new Point_js_1.Point({ raDeg: centralradeg, decDeg: centraldecdeg }, CoordsType_js_1.CoordsType.ASTRO),
16950
17186
  mouseHoverPoint: this.mousePointCoords,
16951
17187
  colorMap: this._selectedColorMap,
16952
- getFoVPolygon: this.getFoVPolygon(),
17188
+ getFoVPolygon: [],
16953
17189
  };
16954
17190
  return detail;
16955
17191
  // }
@@ -16981,7 +17217,9 @@ class AstroSphere {
16981
17217
  this._camera.setRotationLock({ y: locked });
16982
17218
  if (locked)
16983
17219
  this.inertiaX = 0;
16984
- this.lockedEastWestRaDeg = locked ? this.updateCentralPoint()?.astroDeg.ra ?? null : null;
17220
+ this.lockedEastWestRaDeg = locked
17221
+ ? (this.updateCentralPoint()?.astroDeg.ra ?? null)
17222
+ : null;
16985
17223
  }
16986
17224
  isEastWestRotationLocked() {
16987
17225
  return this._camera.isRotationLockedY();
@@ -16990,7 +17228,9 @@ class AstroSphere {
16990
17228
  this._camera.setRotationLock({ x: locked });
16991
17229
  if (locked)
16992
17230
  this.inertiaY = 0;
16993
- this.lockedNorthSouthDecDeg = locked ? this.updateCentralPoint()?.astroDeg.dec ?? null : null;
17231
+ this.lockedNorthSouthDecDeg = locked
17232
+ ? (this.updateCentralPoint()?.astroDeg.dec ?? null)
17233
+ : null;
16994
17234
  }
16995
17235
  isNorthSouthRotationLocked() {
16996
17236
  return this._camera.isRotationLockedX();
@@ -17002,6 +17242,11 @@ class AstroSphere {
17002
17242
  requests: XYZTileRequestScheduler_js_1.xyzTileRequestScheduler.getDebugStats(),
17003
17243
  };
17004
17244
  }
17245
+ getHiPSDebugStats() {
17246
+ if (!this._activeHiPS)
17247
+ return null;
17248
+ return this._activeHiPS.getDebugStats();
17249
+ }
17005
17250
  draw(canvas) {
17006
17251
  if (this._refreshingStatus)
17007
17252
  return;
@@ -17027,6 +17272,7 @@ class AstroSphere {
17027
17272
  if (Math.abs(this.zoomInertia) > 0.0001) {
17028
17273
  this._camera.zoom(this.zoomInertia);
17029
17274
  this.zoomInertia *= 0.95;
17275
+ this.lastCameraMotionAt = performance.now();
17030
17276
  this.fov = this._healpixGrid.refreshFoV(this._camera, this._perspectiveMatrixManager.pMatrix);
17031
17277
  this._camera.refreshFoV(this.fov.minFoV);
17032
17278
  if (this.prevFov !== this.fov.minFoV) {
@@ -17042,7 +17288,9 @@ class AstroSphere {
17042
17288
  this._cameraStatusChanged = true;
17043
17289
  }
17044
17290
  // Rotation inertia
17045
- if (this.mouseDown || Math.abs(this.inertiaX) > 0.02 || Math.abs(this.inertiaY) > 0.02) {
17291
+ if (this.mouseDown ||
17292
+ Math.abs(this.inertiaX) > 0.02 ||
17293
+ Math.abs(this.inertiaY) > 0.02) {
17046
17294
  cameraRotated = true;
17047
17295
  const filteredInertia = this.filterRotationDeltaByAstroLocks(this.inertiaX, this.inertiaY);
17048
17296
  PHI = filteredInertia.deltaX;
@@ -17050,6 +17298,7 @@ class AstroSphere {
17050
17298
  this.inertiaX = filteredInertia.deltaX * 0.95;
17051
17299
  this.inertiaY = filteredInertia.deltaY * 0.95;
17052
17300
  this._camera.rotate(PHI, THETA);
17301
+ this.lastCameraMotionAt = performance.now();
17053
17302
  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
17303
  const lockCorrected = this.enforceAstronomicalRotationLocks();
17055
17304
  if (!lockCorrected) {
@@ -17060,6 +17309,12 @@ class AstroSphere {
17060
17309
  this.inertiaY = 0;
17061
17310
  this.inertiaX = 0;
17062
17311
  }
17312
+ const nextFoV = this._healpixGrid.refreshFoV(this._camera, this._perspectiveMatrixManager.pMatrix);
17313
+ if (Number.isFinite(nextFoV.minFoV) && nextFoV.minFoV > 0) {
17314
+ this.fov = nextFoV;
17315
+ this._camera.refreshFoV(this.fov.minFoV);
17316
+ this.prevFov = this.fov.minFoV;
17317
+ }
17063
17318
  // Se la camera è ruotata (anche solo per inerzia), aggiorna punto centrale + emetti cameraChanged
17064
17319
  if (cameraRotated) {
17065
17320
  // Ricalcola il punto centrale
@@ -17077,16 +17332,20 @@ class AstroSphere {
17077
17332
  }
17078
17333
  }
17079
17334
  if (this._cameraStatusChanged) {
17080
- const detail = this.getCurrentStatus();
17335
+ const now = performance.now();
17336
+ const shouldEmitCameraChanged = !this.mouseDown || now - this.lastCameraChangedAt > 100;
17337
+ const detail = shouldEmitCameraChanged ? this.getCurrentStatus() : null;
17081
17338
  if (detail) {
17082
17339
  // console.log('[AstroSphere::draw] emitting camera-changed event due to camera status change', detail)
17083
17340
  // console.log('[AstroSphere::draw] inertia', this.zoomInertia, this.inertiaX, this.inertiaY)
17084
- this.canvas.dispatchEvent(new CustomEvent('camera-changed', {
17341
+ this.canvas.dispatchEvent(new CustomEvent("camera-changed", {
17085
17342
  detail,
17086
- bubbles: true, composed: true,
17343
+ bubbles: true,
17344
+ composed: true,
17087
17345
  }));
17346
+ this.lastCameraChangedAt = now;
17088
17347
  }
17089
- if (!this.startup) {
17348
+ if (!this.startup && shouldEmitCameraChanged) {
17090
17349
  this._cameraStatusChanged = false;
17091
17350
  }
17092
17351
  }
@@ -17096,23 +17355,39 @@ class AstroSphere {
17096
17355
  this._webgl.enable(this._webgl.CULL_FACE);
17097
17356
  this._webgl.cullFace(Global_js_1.default.insideSphere ? this._webgl.FRONT : this._webgl.BACK);
17098
17357
  this._webgl.blendFunc(this._webgl.SRC_ALPHA, this._webgl.ONE_MINUS_SRC_ALPHA);
17099
- if (this._activeBaseLayer === 'hips' && this._activeHiPS) {
17358
+ if (this._activeBaseLayer === "hips" && this._activeHiPS) {
17100
17359
  const visibleOrder = Math.min(this._healpixGrid.visibleorder, this._activeHiPS.maxOrder);
17101
17360
  this._healpixGrid.visibleTilesManager.computeVisiblePixels(visibleOrder, this._webgl, this._camera, this._perspectiveMatrixManager.pMatrix);
17102
17361
  }
17103
17362
  // DRAW HiPS
17363
+ const stableFovDeg = this.fov?.minFoV ?? this._healpixGrid.getMinFoV();
17364
+ const nowForGrid = performance.now();
17365
+ const cameraMovingForGrid = this.mouseDown ||
17366
+ Math.abs(this.zoomInertia) > 0.0001 ||
17367
+ Math.abs(this.inertiaX) > 0.02 ||
17368
+ Math.abs(this.inertiaY) > 0.02 ||
17369
+ nowForGrid - this.lastCameraMotionAt < 220;
17370
+ // const skyEntityDrawInput: SkyEntityDrawInput = {
17371
+ // fovDeg: this._healpixGrid.getMinFoV(),
17372
+ // camera: this._camera,
17373
+ // pMatrix: this._perspectiveMatrixManager.pMatrix,
17374
+ // centerSphericalDeg: this.updateCentralPoint().sphericalDeg,
17375
+ // fovPolygon: this._activeBaseLayer === 'xyz' ? this.getFoVPolygon() : undefined,
17376
+ // viewportSphericalSamples: this._activeBaseLayer === 'xyz' ? this.collectViewportSphericalSamples(7) : undefined,
17377
+ // }
17104
17378
  const skyEntityDrawInput = {
17105
- fovDeg: this._healpixGrid.getMinFoV(),
17379
+ fovDeg: stableFovDeg,
17106
17380
  camera: this._camera,
17107
17381
  pMatrix: this._perspectiveMatrixManager.pMatrix,
17108
17382
  centerSphericalDeg: this.updateCentralPoint().sphericalDeg,
17109
- fovPolygon: this._activeBaseLayer === 'xyz' ? this.getFoVPolygon() : undefined,
17110
- viewportSphericalSamples: this._activeBaseLayer === 'xyz' ? this.collectViewportSphericalSamples(7) : undefined,
17383
+ fovPolygon: undefined,
17384
+ viewportSphericalSamples: undefined,
17385
+ cameraMoving: cameraMovingForGrid,
17111
17386
  };
17112
- if (this._activeBaseLayer === 'hips') {
17387
+ if (this._activeBaseLayer === "hips") {
17113
17388
  this._activeHiPS?.draw(skyEntityDrawInput);
17114
17389
  }
17115
- if (this._activeBaseLayer === 'xyz') {
17390
+ if (this._activeBaseLayer === "xyz") {
17116
17391
  this._activeXYZ2?.draw(skyEntityDrawInput);
17117
17392
  }
17118
17393
  this._healpixGrid.draw(skyEntityDrawInput);
@@ -17125,24 +17400,27 @@ class AstroSphere {
17125
17400
  const raDecDeg = (0, Utils_js_1.sphericalToAstroDeg)(phiTheta.phi, phiTheta.theta);
17126
17401
  const raHMS = (0, Utils_js_1.raDegToHMS)(raDecDeg.ra);
17127
17402
  const decDMS = (0, Utils_js_1.decDegToDMS)(raDecDeg.dec);
17128
- this.prevFov = this._healpixGrid.getMinFoV();
17403
+ // this.prevFov = this._healpixGrid.getMinFoV();
17404
+ this.prevFov = this.fov?.minFoV ?? this._healpixGrid.getMinFoV();
17129
17405
  this._cameraStatusChanged = true;
17130
- console.log('(startup coords)', {
17406
+ console.log("(startup coords)", {
17131
17407
  raDeg: raDecDeg.ra,
17132
17408
  decDeg: raDecDeg.dec,
17133
17409
  raHMS,
17134
17410
  decDMS,
17135
17411
  });
17136
17412
  }
17137
- this.activeCatalogues.forEach(cat => {
17138
- const activeModelMatrix = this._activeHiPS?.getModelMatrix() ?? this._activeXYZ2?.getModelMatrix();
17413
+ this.activeCatalogues.forEach((cat) => {
17414
+ const activeModelMatrix = this._activeHiPS?.getModelMatrix() ??
17415
+ this._activeXYZ2?.getModelMatrix();
17139
17416
  if (activeModelMatrix) {
17140
17417
  cat.draw(activeModelMatrix, this.mouseHelper, this._camera.getCameraMatrix(), this._perspectiveMatrixManager.pMatrix);
17141
17418
  }
17142
17419
  });
17143
17420
  this.emitHoveredSourceIfChanged();
17144
- this.activeFootprintSets.forEach(fst => {
17145
- const activeModelMatrix = this._activeHiPS?.getModelMatrix() ?? this._activeXYZ2?.getModelMatrix();
17421
+ this.activeFootprintSets.forEach((fst) => {
17422
+ const activeModelMatrix = this._activeHiPS?.getModelMatrix() ??
17423
+ this._activeXYZ2?.getModelMatrix();
17146
17424
  if (activeModelMatrix) {
17147
17425
  fst.draw(activeModelMatrix, this.mouseHelper, this._camera.getCameraMatrix(), this._perspectiveMatrixManager.pMatrix);
17148
17426
  }
@@ -17159,13 +17437,13 @@ class AstroSphere {
17159
17437
  nextHoveredCatalogue = cat;
17160
17438
  break;
17161
17439
  }
17162
- const unchanged = nextHoveredSource === this.lastHoveredSource
17163
- && nextHoveredCatalogue === this.lastHoveredCatalogue;
17440
+ const unchanged = nextHoveredSource === this.lastHoveredSource &&
17441
+ nextHoveredCatalogue === this.lastHoveredCatalogue;
17164
17442
  if (unchanged)
17165
17443
  return;
17166
17444
  this.lastHoveredSource = nextHoveredSource;
17167
17445
  this.lastHoveredCatalogue = nextHoveredCatalogue;
17168
- this._webgl.canvas.dispatchEvent(new CustomEvent('source-hovered', {
17446
+ this._webgl.canvas.dispatchEvent(new CustomEvent("source-hovered", {
17169
17447
  detail: { source: nextHoveredSource, catalogue: nextHoveredCatalogue },
17170
17448
  bubbles: true,
17171
17449
  composed: true,
@@ -17718,6 +17996,9 @@ class MetadataManager {
17718
17996
  set selectedDecColumn(columnName) {
17719
17997
  this._selectedDecColumn = this._decColumnList.find(c => c.name === columnName) || this._selectedDecColumn;
17720
17998
  }
17999
+ set selectedOutlineColumn(columnName) {
18000
+ this._selectedOutlineColumn = this._outlineColumnList.find(c => c.name === columnName) || this._selectedOutlineColumn;
18001
+ }
17721
18002
  set selectedHueColumn(columnName) {
17722
18003
  this._selectedHueColumn = this._hueColumnList.find(c => c.name === columnName);
17723
18004
  }
@@ -17725,7 +18006,7 @@ class MetadataManager {
17725
18006
  this._selectedShapeColumn = this._shapeColumnList.find(c => c.name === columnName);
17726
18007
  }
17727
18008
  set selectedNameColumn(columnName) {
17728
- this._selectedNameColumn = this._shapeColumnList.find(c => c.name === columnName);
18009
+ this._selectedNameColumn = this._columns.find(c => c.name === columnName);
17729
18010
  }
17730
18011
  resetShapeColumn() {
17731
18012
  this._selectedShapeColumn = undefined;
@@ -18073,7 +18354,7 @@ class SphereFoV {
18073
18354
  }
18074
18355
  const angleDeg = 2 * this.computeAngularDistanceDeg(centerHit.point, edgeHit.point);
18075
18356
  return {
18076
- angleDeg: insideSphere ? 360 - angleDeg : angleDeg,
18357
+ angleDeg,
18077
18358
  distance: edgeHit.distance,
18078
18359
  };
18079
18360
  }
@@ -18081,8 +18362,9 @@ class SphereFoV {
18081
18362
  const aNorm = gl_matrix_1.vec3.normalize(gl_matrix_1.vec3.create(), a);
18082
18363
  const bNorm = gl_matrix_1.vec3.normalize(gl_matrix_1.vec3.create(), b);
18083
18364
  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));
18365
+ const cross = gl_matrix_1.vec3.cross(gl_matrix_1.vec3.create(), aNorm, bNorm);
18366
+ const angleRad = Math.atan2(gl_matrix_1.vec3.length(cross), Math.min(1, Math.max(-1, dot)));
18367
+ return (0, Utils_js_1.radToDeg)(angleRad);
18086
18368
  }
18087
18369
  getIntersectionPointWithModel(mouseX, mouseY, model, camera, pMatrix) {
18088
18370
  const rayWorld = this.getRayFromMouse(mouseX, mouseY, pMatrix, camera.getCameraMatrix());
@@ -18558,6 +18840,7 @@ class Point {
18558
18840
  _raRad;
18559
18841
  _decRad;
18560
18842
  _raDecDeg;
18843
+ _lonLatDeg;
18561
18844
  constructor(in_options, in_type) {
18562
18845
  this._xyz = [0, 0, 0];
18563
18846
  this._raDecDeg = [0, 0];
@@ -18589,6 +18872,20 @@ class Point {
18589
18872
  this._z = Number(z.toFixed(MAX_DECIMALS));
18590
18873
  this._xyz = [this._x, this._y, this._z];
18591
18874
  }
18875
+ else if (in_type === CoordsType_js_1.CoordsType.GEOGRAPHIC) {
18876
+ const { lonDeg, latDeg } = in_options;
18877
+ this._lonLatDeg = [Number(lonDeg), Number(latDeg)];
18878
+ this._raDeg = this._lonLatDeg[0];
18879
+ this._decDeg = this._lonLatDeg[1];
18880
+ this._raDecDeg = [this._raDeg, this._decDeg];
18881
+ this._raRad = (this._raDeg * Math.PI) / 180;
18882
+ this._decRad = (this._decDeg * Math.PI) / 180;
18883
+ const [x, y, z] = this.computeCartesianCoords();
18884
+ this._x = Number(x.toFixed(MAX_DECIMALS));
18885
+ this._y = Number(y.toFixed(MAX_DECIMALS));
18886
+ this._z = Number(z.toFixed(MAX_DECIMALS));
18887
+ this._xyz = [this._x, this._y, this._z];
18888
+ }
18592
18889
  else if (in_type === CoordsType_js_1.CoordsType.SPHERICAL) {
18593
18890
  // Not implemented in original; keep behavior
18594
18891
  console.log(`${CoordsType_js_1.CoordsType.SPHERICAL} not implemented yet`);
@@ -18665,6 +18962,9 @@ class Point {
18665
18962
  get raDeg() { return this._raDeg; }
18666
18963
  get decDeg() { return this._decDeg; }
18667
18964
  get raDecDeg() { return this._raDecDeg; }
18965
+ get lonDeg() { return this._lonLatDeg?.[0] ?? this._raDeg; }
18966
+ get latDeg() { return this._lonLatDeg?.[1] ?? this._decDeg; }
18967
+ get lonLatDeg() { return this._lonLatDeg ?? [this._raDeg, this._decDeg]; }
18668
18968
  toADQL() {
18669
18969
  return `${this._raDecDeg[0]},${this._raDecDeg[1]}`;
18670
18970
  }
@@ -18898,13 +19198,11 @@ class Camera {
18898
19198
  toggleInsideSphere() {
18899
19199
  // if (inside !== global.insideSphere) {
18900
19200
  // global.insideSphere = inside;
19201
+ this.insideSphere = Global_js_1.default.insideSphere;
18901
19202
  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
- }
19203
+ this.cam_pos[0] = 0;
19204
+ this.cam_pos[1] = 0;
19205
+ this.cam_pos[2] = -0.005;
18908
19206
  }
18909
19207
  else {
18910
19208
  this.cam_pos[2] = 2.0 + this.cam_pos[2];
@@ -19841,6 +20139,7 @@ class LatLonGrid extends AbstractSkyEntity_js_1.AbstractSkyEntity {
19841
20139
  _showGrid = true;
19842
20140
  _lonArray = [];
19843
20141
  _latArray = [];
20142
+ _bufferKey = '';
19844
20143
  defaultColor = '#41d4d4';
19845
20144
  gridText = new GridTextHelper_js_1.default('lonlat');
19846
20145
  constructor(radius, position, xrad, yrad, name, webgl) {
@@ -19887,28 +20186,67 @@ class LatLonGrid extends AbstractSkyEntity_js_1.AbstractSkyEntity {
19887
20186
  }
19888
20187
  gl.useProgram(this._shaderProgram);
19889
20188
  }
19890
- initBuffers(fovDeg) {
19891
- const steps = XYZFoVHelper_js_1.xyzFovHelper.getLonLatSteps(fovDeg);
20189
+ initBuffers(fovDeg, centerSphericalDeg, coarse = false) {
20190
+ const steps = XYZFoVHelper_js_1.xyzFovHelper.getLonLatSteps(fovDeg, coarse);
19892
20191
  this._lonStep = steps.lonStep;
19893
20192
  this._latStep = steps.latStep;
19894
20193
  this._segmentStep = Math.max(Math.min(this._lonStep, this._latStep), 0.25);
19895
20194
  this._lonArray = [];
19896
20195
  this._latArray = [];
19897
- for (let lon = -180; lon < 180; lon += this._lonStep) {
20196
+ const center = centerSphericalDeg
20197
+ ? {
20198
+ lon: this.normalizeLon(centerSphericalDeg.phi > 180 ? centerSphericalDeg.phi - 360 : centerSphericalDeg.phi),
20199
+ lat: 90 - centerSphericalDeg.theta,
20200
+ }
20201
+ : null;
20202
+ const localGrid = !!center && !coarse && fovDeg < 2;
20203
+ const lonValues = localGrid
20204
+ ? this.buildLonRange(center.lon, Math.max(fovDeg * 4, this._lonStep * 3), this._lonStep)
20205
+ : this.buildLonRange(0, 180, this._lonStep);
20206
+ const latValues = localGrid
20207
+ ? this.buildLatRange(center.lat, Math.max(fovDeg * 4, this._latStep * 3), this._latStep)
20208
+ : this.buildLatRange(0, 90, this._latStep);
20209
+ const latSegmentRange = localGrid && center
20210
+ ? this.buildLatRange(center.lat, Math.max(fovDeg * 4, this._latStep * 3), this._segmentStep)
20211
+ : this.buildLatRange(0, 90, this._segmentStep);
20212
+ const lonSegmentRange = localGrid && center
20213
+ ? this.buildLonRange(center.lon, Math.max(fovDeg * 4, this._lonStep * 3), this._segmentStep)
20214
+ : this.buildLonRange(0, 180, this._segmentStep);
20215
+ for (const lon of lonValues) {
19898
20216
  const vertices = [];
19899
- for (let lat = -90; lat <= 90; lat += this._segmentStep) {
20217
+ for (const lat of latSegmentRange) {
19900
20218
  vertices.push(...this.lonLatToCartesian(lon, Math.min(lat, 90)));
19901
20219
  }
19902
20220
  this._lonArray.push(new Float32Array(vertices));
19903
20221
  }
19904
- for (let lat = -90 + this._latStep; lat < 90; lat += this._latStep) {
20222
+ for (const lat of latValues) {
19905
20223
  const vertices = [];
19906
- for (let lon = -180; lon <= 180; lon += this._segmentStep) {
20224
+ if (lat <= -90 || lat >= 90)
20225
+ continue;
20226
+ for (const lon of lonSegmentRange) {
19907
20227
  vertices.push(...this.lonLatToCartesian(Math.min(lon, 180), lat));
19908
20228
  }
19909
20229
  this._latArray.push(new Float32Array(vertices));
19910
20230
  }
19911
20231
  }
20232
+ buildLonRange(centerLon, halfSpan, step) {
20233
+ const values = [];
20234
+ const start = Math.floor((centerLon - halfSpan) / step) * step;
20235
+ const end = Math.ceil((centerLon + halfSpan) / step) * step;
20236
+ for (let lon = start; lon <= end; lon += step) {
20237
+ values.push(this.normalizeLon(lon));
20238
+ }
20239
+ return values;
20240
+ }
20241
+ buildLatRange(centerLat, halfSpan, step) {
20242
+ const values = [];
20243
+ const start = Math.max(-90, Math.floor((centerLat - halfSpan) / step) * step);
20244
+ const end = Math.min(90, Math.ceil((centerLat + halfSpan) / step) * step);
20245
+ for (let lat = start; lat <= end; lat += step) {
20246
+ values.push(lat);
20247
+ }
20248
+ return values;
20249
+ }
19912
20250
  lonLatToCartesian(lonDeg, latDeg) {
19913
20251
  const lonRad = (0, Utils_js_1.degToRad)(lonDeg);
19914
20252
  const latRad = (0, Utils_js_1.degToRad)(latDeg);
@@ -19919,17 +20257,28 @@ class LatLonGrid extends AbstractSkyEntity_js_1.AbstractSkyEntity {
19919
20257
  Math.sin(latRad),
19920
20258
  ];
19921
20259
  }
19922
- refresh(fovDeg) {
19923
- if (Math.abs(this._fovDeg - fovDeg) > 1e-6) {
20260
+ refresh(fovDeg, input) {
20261
+ const coarse = !!input.cameraMoving;
20262
+ const steps = XYZFoVHelper_js_1.xyzFovHelper.getLonLatSteps(fovDeg, coarse);
20263
+ const center = input.centerSphericalDeg;
20264
+ const localGrid = !!center && !coarse && fovDeg < 2;
20265
+ const centerLon = center ? this.normalizeLon(center.phi > 180 ? center.phi - 360 : center.phi) : 0;
20266
+ const centerLat = center ? 90 - center.theta : 0;
20267
+ const centerKey = localGrid
20268
+ ? `${this.roundToStep(centerLon, Math.max(steps.lonStep, fovDeg))}:${this.roundToStep(centerLat, Math.max(steps.latStep, fovDeg))}`
20269
+ : 'global';
20270
+ const bufferKey = `${coarse ? 'coarse' : 'settled'}:${steps.lonStep}:${steps.latStep}:${centerKey}`;
20271
+ if (this._bufferKey !== bufferKey) {
19924
20272
  this._fovDeg = fovDeg;
19925
- this.initBuffers(this._fovDeg);
20273
+ this._bufferKey = bufferKey;
20274
+ this.initBuffers(this._fovDeg, input.centerSphericalDeg, coarse);
19926
20275
  }
19927
20276
  }
19928
20277
  refreshFoV(input) {
19929
20278
  if (!input.camera || !input.pMatrix)
19930
20279
  return this._fovDeg;
19931
20280
  this._fovObj.getFoV(Global_js_1.default.insideSphere, this, input.camera, input.pMatrix);
19932
- this.refresh(this._fovObj.minFoV);
20281
+ this.refresh(this._fovObj.minFoV, input);
19933
20282
  return this._fovObj.minFoV;
19934
20283
  }
19935
20284
  getMinFoVDeg() {
@@ -20091,6 +20440,7 @@ var CoordsType;
20091
20440
  CoordsType["CARTESIAN"] = "cartesian";
20092
20441
  CoordsType["SPHERICAL"] = "spherical";
20093
20442
  CoordsType["ASTRO"] = "astro";
20443
+ CoordsType["GEOGRAPHIC"] = "geographic";
20094
20444
  })(CoordsType || (exports.CoordsType = CoordsType = {}));
20095
20445
  // export default CoordsType;
20096
20446
 
@@ -20172,6 +20522,9 @@ class Tile {
20172
20522
  getReadyState() {
20173
20523
  return this._ready;
20174
20524
  }
20525
+ isLoading() {
20526
+ return !this._ready && !this._abort;
20527
+ }
20175
20528
  get cacheTime0() {
20176
20529
  return this._cacheTime0;
20177
20530
  }
@@ -20496,7 +20849,40 @@ exports["default"] = Tile;
20496
20849
  Object.defineProperty(exports, "__esModule", ({ value: true }));
20497
20850
  exports.xyzFovHelper = void 0;
20498
20851
  class XYZFoVHelper {
20499
- getZoom(fov) {
20852
+ static LEVEL_HYSTERESIS = 0.12;
20853
+ static ZOOM_MIN_FOV = {
20854
+ 2: 179,
20855
+ 3: 90,
20856
+ 4: 30,
20857
+ 5: 20,
20858
+ 6: 6,
20859
+ 7: 3.2,
20860
+ 8: 1.6,
20861
+ 9: 0.85,
20862
+ 10: 0.42,
20863
+ 11: 0.21,
20864
+ 12: 0.12,
20865
+ 13: 0.06,
20866
+ 14: 0.015,
20867
+ 15: 0,
20868
+ };
20869
+ getZoom(fov, currentZoom) {
20870
+ const rawZoom = this.getRawZoom(fov);
20871
+ if (currentZoom === undefined || currentZoom === rawZoom)
20872
+ return rawZoom;
20873
+ if (rawZoom > currentZoom) {
20874
+ const boundary = XYZFoVHelper.ZOOM_MIN_FOV[currentZoom];
20875
+ if (boundary > 0 && fov > boundary * (1 - XYZFoVHelper.LEVEL_HYSTERESIS))
20876
+ return currentZoom;
20877
+ }
20878
+ else {
20879
+ const boundary = XYZFoVHelper.ZOOM_MIN_FOV[rawZoom];
20880
+ if (boundary > 0 && fov < boundary * (1 + XYZFoVHelper.LEVEL_HYSTERESIS))
20881
+ return currentZoom;
20882
+ }
20883
+ return rawZoom;
20884
+ }
20885
+ getRawZoom(fov) {
20500
20886
  if (fov >= 179)
20501
20887
  return 2;
20502
20888
  if (fov >= 90)
@@ -20526,10 +20912,14 @@ class XYZFoVHelper {
20526
20912
  return 15;
20527
20913
  }
20528
20914
  // used in grid drawing
20529
- getLonLatSteps(fov) {
20915
+ getLonLatSteps(fov, coarse = false) {
20530
20916
  let lonStep;
20531
20917
  let latStep;
20532
- if (fov >= 179) {
20918
+ if (coarse && fov < 0.21) {
20919
+ lonStep = 10;
20920
+ latStep = 10;
20921
+ }
20922
+ else if (fov >= 179) {
20533
20923
  lonStep = 10;
20534
20924
  latStep = 10;
20535
20925
  }
@@ -20584,6 +20974,127 @@ exports.xyzFovHelper = new XYZFoVHelper();
20584
20974
  exports["default"] = XYZFoVHelper;
20585
20975
 
20586
20976
 
20977
+ /***/ }),
20978
+
20979
+ /***/ 8755:
20980
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
20981
+
20982
+
20983
+ /*
20984
+ * AstroViewer
20985
+ * Copyright (C) Fabrizio Giordano
20986
+ * SPDX-License-Identifier: LicenseRef-AstroViewer-Dual-License
20987
+ *
20988
+ * This file is part of AstroViewer.
20989
+ * AstroViewer is distributed under a dual-license model.
20990
+ * Commercial use requires a separate commercial license.
20991
+ * Non-commercial use is governed by LICENSE-NONCOMMERCIAL.md.
20992
+ *
20993
+ * See LICENSE.md, LICENSE-COMMERCIAL.md, and LICENSE-NONCOMMERCIAL.md for details.
20994
+ */
20995
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
20996
+ const CoordsType_js_1 = __webpack_require__(8145);
20997
+ const Point_js_1 = __webpack_require__(6553);
20998
+ class GeoJSONParser {
20999
+ static isGeoJSON(value) {
21000
+ if (!value || typeof value !== 'object')
21001
+ return false;
21002
+ const type = value.type;
21003
+ return type === 'FeatureCollection'
21004
+ || type === 'Feature'
21005
+ || type === 'Polygon'
21006
+ || type === 'MultiPolygon'
21007
+ || type === 'GeometryCollection';
21008
+ }
21009
+ static parseGeoJSON(value) {
21010
+ if (!value || typeof value !== 'object') {
21011
+ throw new Error('GeoJSON root must be an object');
21012
+ }
21013
+ const obj = value;
21014
+ if (obj.type === 'FeatureCollection') {
21015
+ if (!Array.isArray(obj.features))
21016
+ throw new Error('GeoJSON FeatureCollection has no features array');
21017
+ return obj.features.flatMap((feature) => GeoJSONParser.parseFeature(feature));
21018
+ }
21019
+ if (obj.type === 'Feature')
21020
+ return GeoJSONParser.parseFeature(obj);
21021
+ if (obj.type === 'Polygon' || obj.type === 'MultiPolygon' || obj.type === 'GeometryCollection') {
21022
+ return GeoJSONParser.parseGeometry(obj, {});
21023
+ }
21024
+ throw new Error(`Unsupported GeoJSON type: ${obj.type ?? 'unknown'}`);
21025
+ }
21026
+ static parseFeature(value) {
21027
+ if (!value || typeof value !== 'object')
21028
+ throw new Error('GeoJSON feature must be an object');
21029
+ const feature = value;
21030
+ if (feature.type !== 'Feature')
21031
+ throw new Error('GeoJSON feature has invalid type');
21032
+ if (!feature.geometry)
21033
+ return [];
21034
+ return GeoJSONParser.parseGeometry(feature.geometry, feature.properties ?? {}, feature.id);
21035
+ }
21036
+ static parseGeometry(geometry, properties, id) {
21037
+ if (geometry.type === 'Polygon') {
21038
+ return [{
21039
+ id,
21040
+ geometryType: 'Polygon',
21041
+ properties,
21042
+ polygons: GeoJSONParser.parsePolygonCoordinates(geometry.coordinates),
21043
+ }];
21044
+ }
21045
+ if (geometry.type === 'MultiPolygon') {
21046
+ return [{
21047
+ id,
21048
+ geometryType: 'MultiPolygon',
21049
+ properties,
21050
+ polygons: GeoJSONParser.parseMultiPolygonCoordinates(geometry.coordinates),
21051
+ }];
21052
+ }
21053
+ if (geometry.type === 'GeometryCollection') {
21054
+ if (!Array.isArray(geometry.geometries))
21055
+ return [];
21056
+ return geometry.geometries.flatMap((child) => GeoJSONParser.parseGeometry(child, properties, id));
21057
+ }
21058
+ return [];
21059
+ }
21060
+ static parseMultiPolygonCoordinates(coordinates) {
21061
+ if (!Array.isArray(coordinates))
21062
+ throw new Error('GeoJSON MultiPolygon coordinates must be an array');
21063
+ return coordinates.flatMap((polygonCoordinates) => GeoJSONParser.parsePolygonCoordinates(polygonCoordinates));
21064
+ }
21065
+ static parsePolygonCoordinates(coordinates) {
21066
+ if (!Array.isArray(coordinates))
21067
+ throw new Error('GeoJSON Polygon coordinates must be an array');
21068
+ return coordinates
21069
+ .map((ring) => GeoJSONParser.parseLinearRing(ring))
21070
+ .filter((ring) => ring.length >= 3);
21071
+ }
21072
+ static parseLinearRing(ring) {
21073
+ if (!Array.isArray(ring))
21074
+ throw new Error('GeoJSON linear ring must be an array');
21075
+ const points = ring.map((position) => GeoJSONParser.parsePosition(position));
21076
+ if (points.length > 1) {
21077
+ const first = points[0];
21078
+ const last = points[points.length - 1];
21079
+ if (first.lonDeg === last.lonDeg && first.latDeg === last.latDeg)
21080
+ points.pop();
21081
+ }
21082
+ return points;
21083
+ }
21084
+ static parsePosition(position) {
21085
+ if (!Array.isArray(position) || position.length < 2) {
21086
+ throw new Error('GeoJSON position must be [longitude, latitude]');
21087
+ }
21088
+ const [lonDeg, latDeg] = position;
21089
+ if (!Number.isFinite(lonDeg) || !Number.isFinite(latDeg)) {
21090
+ throw new Error('GeoJSON position contains non-finite longitude/latitude');
21091
+ }
21092
+ return new Point_js_1.Point({ lonDeg, latDeg }, CoordsType_js_1.CoordsType.GEOGRAPHIC);
21093
+ }
21094
+ }
21095
+ exports["default"] = GeoJSONParser;
21096
+
21097
+
20587
21098
  /***/ }),
20588
21099
 
20589
21100
  /***/ 8819:
@@ -20923,8 +21434,50 @@ exports.FootprintShaderProgram = FootprintShaderProgram;
20923
21434
  Object.defineProperty(exports, "__esModule", ({ value: true }));
20924
21435
  exports.TerraFootprintSetGL = void 0;
20925
21436
  const FootprintSetGL_js_1 = __webpack_require__(592);
21437
+ const CoordsType_js_1 = __webpack_require__(8145);
21438
+ const Footprint_js_1 = __webpack_require__(2475);
21439
+ const MetadataColumn_js_1 = __webpack_require__(1072);
21440
+ const MetadataManager_js_1 = __webpack_require__(5403);
21441
+ const MetadataColumn_js_2 = __webpack_require__(1072);
20926
21442
  class TerraFootprintSetGL extends FootprintSetGL_js_1.FootprintSetGL {
20927
21443
  _kind = 'TerraFootprintSetGL';
21444
+ _coordsType = CoordsType_js_1.CoordsType.GEOGRAPHIC;
21445
+ addGeoJSONFeatures(features) {
21446
+ this._ready = false;
21447
+ this.clearFootprints();
21448
+ this._metadataManager = new MetadataManager_js_1.MetadataManager(this.createGeoJSONMetadataColumns(features));
21449
+ for (const feature of features) {
21450
+ const footprint = Footprint_js_1.Footprint.fromPolygons(feature.polygons, this.createGeoJSONDetails(feature), CoordsType_js_1.CoordsType.GEOGRAPHIC);
21451
+ if (footprint.valid) {
21452
+ this.addFootprint(footprint);
21453
+ this.totPoints += footprint.totPoints;
21454
+ this.totConvexPoints += footprint.totConvexPoints;
21455
+ }
21456
+ }
21457
+ this._ready = true;
21458
+ this._bufferInitialised = false;
21459
+ }
21460
+ createGeoJSONMetadataColumns(features) {
21461
+ const names = new Set();
21462
+ features.forEach(feature => Object.keys(feature.properties).forEach(name => names.add(name)));
21463
+ return Array.from(names).map((name, index) => {
21464
+ const values = features.map(feature => feature.properties[name]).filter(value => value !== null && value !== undefined && value !== '');
21465
+ const isNumber = values.length > 0 && values.every(value => typeof value === 'number' || !Number.isNaN(Number(value)));
21466
+ const isName = /^name$|nome|denominazione|label|title/i.test(name);
21467
+ return new MetadataColumn_js_1.MetadataColumn({
21468
+ index,
21469
+ name,
21470
+ columnType: isName ? MetadataColumn_js_2.ColumnType.MAIN_NAME : (isNumber ? MetadataColumn_js_2.ColumnType.NUMBER : MetadataColumn_js_2.ColumnType.STRING),
21471
+ unit: '',
21472
+ });
21473
+ });
21474
+ }
21475
+ createGeoJSONDetails(feature) {
21476
+ return Object.entries(feature.properties).map(([key, value]) => ({
21477
+ key,
21478
+ value: typeof value === 'number' ? value : String(value ?? ''),
21479
+ }));
21480
+ }
20928
21481
  }
20929
21482
  exports.TerraFootprintSetGL = TerraFootprintSetGL;
20930
21483
 
@@ -20958,15 +21511,15 @@ const Point_js_1 = __webpack_require__(6553);
20958
21511
  const CoordsType_js_1 = __webpack_require__(8145);
20959
21512
  const Global_js_1 = __importDefault(__webpack_require__(4382));
20960
21513
  class STCSParser {
20961
- static parseSTCS(stcs) {
21514
+ static parseSTCS(stcs, options = {}) {
20962
21515
  const stcsParsed = STCSParser.cleanStcs(stcs);
20963
21516
  let totPoints = 0;
20964
21517
  const polygons = [];
20965
21518
  if (stcsParsed.includes("POLYGON")) {
20966
- return STCSParser.parsePolygon(stcsParsed);
21519
+ return STCSParser.parsePolygon(stcsParsed, options);
20967
21520
  }
20968
21521
  else if (stcsParsed.includes("CIRCLE")) {
20969
- return STCSParser.parseCircle(stcsParsed);
21522
+ return STCSParser.parseCircle(stcsParsed, options);
20970
21523
  }
20971
21524
  else {
20972
21525
  console.warn("STCS not recognised");
@@ -20989,10 +21542,11 @@ class STCSParser {
20989
21542
  s = s.replace(/ {2,}/g, ' ').trim();
20990
21543
  return s;
20991
21544
  }
20992
- static parsePolygon(stcs) {
21545
+ static parsePolygon(stcs, options = {}) {
20993
21546
  let totPoints = 0;
20994
21547
  const polygons = [];
20995
21548
  const MAX_DECIMALS = Global_js_1.default.MAX_DECIMALS ?? 12;
21549
+ const coordsType = options.coordsType ?? CoordsType_js_1.CoordsType.ASTRO;
20996
21550
  const polys = stcs.split("POLYGON ");
20997
21551
  for (let i = 1; i < polys.length; i++) {
20998
21552
  const currPoly = [];
@@ -21007,9 +21561,11 @@ class STCSParser {
21007
21561
  }
21008
21562
  if (points.length > 2) {
21009
21563
  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);
21564
+ const xDeg = Number(parseFloat(points[p]).toFixed(MAX_DECIMALS));
21565
+ const yDeg = Number(parseFloat(points[p + 1]).toFixed(MAX_DECIMALS));
21566
+ const point = coordsType === CoordsType_js_1.CoordsType.GEOGRAPHIC
21567
+ ? new Point_js_1.Point({ lonDeg: xDeg, latDeg: yDeg }, CoordsType_js_1.CoordsType.GEOGRAPHIC)
21568
+ : new Point_js_1.Point({ raDeg: xDeg, decDeg: yDeg }, CoordsType_js_1.CoordsType.ASTRO);
21013
21569
  currPoly.push(point);
21014
21570
  totPoints += 1;
21015
21571
  }
@@ -21019,9 +21575,10 @@ class STCSParser {
21019
21575
  return { totpoints: totPoints, polygons };
21020
21576
  }
21021
21577
  // Example format: "CIRCLE ICRS 8.739685 4.38147 0.027833"
21022
- static parseCircle(stcs) {
21578
+ static parseCircle(stcs, options = {}) {
21023
21579
  let totPoints = 0;
21024
21580
  const polygons = [];
21581
+ const coordsType = options.coordsType ?? CoordsType_js_1.CoordsType.ASTRO;
21025
21582
  const polys = stcs.split("CIRCLE ");
21026
21583
  for (let i = 1; i < polys.length; i++) {
21027
21584
  const currPoly = [];
@@ -21036,7 +21593,9 @@ class STCSParser {
21036
21593
  for (let p = npoints; p > 0; p--) {
21037
21594
  const curra = radius * Math.cos(p * alpha) + ra;
21038
21595
  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);
21596
+ const point = coordsType === CoordsType_js_1.CoordsType.GEOGRAPHIC
21597
+ ? new Point_js_1.Point({ lonDeg: curra, latDeg: curdec }, CoordsType_js_1.CoordsType.GEOGRAPHIC)
21598
+ : new Point_js_1.Point({ raDeg: curra, decDeg: curdec }, CoordsType_js_1.CoordsType.ASTRO);
21040
21599
  currPoly.push(point);
21041
21600
  totPoints += 1;
21042
21601
  }
@@ -21069,6 +21628,7 @@ exports["default"] = STCSParser;
21069
21628
  Object.defineProperty(exports, "__esModule", ({ value: true }));
21070
21629
  exports.PerspectiveMatrixManager = void 0;
21071
21630
  const gl_matrix_1 = __webpack_require__(1961);
21631
+ const Config_js_1 = __webpack_require__(2919);
21072
21632
  class PerspectiveMatrixManager {
21073
21633
  _pMatrix;
21074
21634
  _aspectRatio = 1;
@@ -21099,7 +21659,9 @@ class PerspectiveMatrixManager {
21099
21659
  const cf = c2 * Math.sin(beta);
21100
21660
  farPlane = cf > 0 ? cf : r;
21101
21661
  }
21102
- gl_matrix_1.mat4.perspective(p, (fovDeg * Math.PI) / 180, this._aspectRatio, nearPlane, farPlane);
21662
+ const effectiveFovDeg = insideSphere ? Config_js_1.bootSetup.inside_camera_fov_deg : fovDeg;
21663
+ const effectiveNearPlane = insideSphere ? Math.max(nearPlane, 0.001) : nearPlane;
21664
+ gl_matrix_1.mat4.perspective(p, (effectiveFovDeg * Math.PI) / 180, this._aspectRatio, effectiveNearPlane, farPlane);
21103
21665
  this._pMatrix = p;
21104
21666
  return p;
21105
21667
  }
@@ -21168,6 +21730,7 @@ class EquatorialGrid extends AbstractSkyEntity_js_1.AbstractSkyEntity {
21168
21730
  _thetaStepRad = 0;
21169
21731
  _phiArray = [];
21170
21732
  _thetaArray = [];
21733
+ _bufferKey = '';
21171
21734
  // For placing text labels near current view center:
21172
21735
  // - _dec4Labels: key = RA(deg), value = points along that RA ring (for Dec labels)
21173
21736
  // - _ra4Labels : key = Dec(deg), value = points along that Dec ring (for RA labels)
@@ -21228,9 +21791,9 @@ class EquatorialGrid extends AbstractSkyEntity_js_1.AbstractSkyEntity {
21228
21791
  super.webgl.useProgram(this._shaderProgram);
21229
21792
  }
21230
21793
  /** Build RA/Dec line vertex arrays based on FoV step helper */
21231
- initBuffers(fovDeg) {
21794
+ initBuffers(fovDeg, coarse = false) {
21232
21795
  const R = 1.0;
21233
- const steps = FoVHelper_js_1.fovHelper.getRADegSteps(fovDeg);
21796
+ const steps = FoVHelper_js_1.fovHelper.getRADegSteps(fovDeg, coarse);
21234
21797
  const phiStep = steps.raStep; // RA step (deg)
21235
21798
  const thetaStep = steps.decStep; // Dec step (deg)
21236
21799
  this._phiStep = phiStep;
@@ -21282,11 +21845,14 @@ class EquatorialGrid extends AbstractSkyEntity_js_1.AbstractSkyEntity {
21282
21845
  }
21283
21846
  }
21284
21847
  /** Update buffers when FoV (in degrees) changes */
21285
- refresh(fovDeg) {
21848
+ refresh(fovDeg, coarse = false) {
21286
21849
  // const fovDeg = healpixGridSingleton.getMinFoV()
21287
- if (this._fov !== fovDeg) {
21850
+ const steps = FoVHelper_js_1.fovHelper.getRADegSteps(fovDeg, coarse);
21851
+ const bufferKey = `${coarse ? 'coarse' : 'settled'}:${steps.raStep}:${steps.decStep}`;
21852
+ if (this._bufferKey !== bufferKey) {
21288
21853
  this._fov = fovDeg;
21289
- this.initBuffers(this._fov);
21854
+ this._bufferKey = bufferKey;
21855
+ this.initBuffers(this._fov, coarse);
21290
21856
  }
21291
21857
  }
21292
21858
  vectorDistance(p1, p2) {
@@ -21346,7 +21912,7 @@ class EquatorialGrid extends AbstractSkyEntity_js_1.AbstractSkyEntity {
21346
21912
  return;
21347
21913
  if (this._thetaArray.length === 0)
21348
21914
  return;
21349
- this.refresh(fovDeg);
21915
+ this.refresh(fovDeg, !!input.cameraMoving);
21350
21916
  if (!this.showGrid) {
21351
21917
  // gridTextHelper.resetDivSets();
21352
21918
  this.gridText.resetDivSets();
@@ -21494,76 +22060,12 @@ exports.EquatorialGrid = EquatorialGrid;
21494
22060
  /******/ })();
21495
22061
  /******/
21496
22062
  /************************************************************************/
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__;
22063
+ /******/
22064
+ /******/ // startup
22065
+ /******/ // Load entry module and return exports
22066
+ /******/ // This entry module is referenced by other modules so it can't be inlined
22067
+ /******/ var __webpack_exports__ = __webpack_require__(1229);
22068
+ /******/ module.exports = __webpack_exports__;
22069
+ /******/
21568
22070
  /******/ })()
21569
22071
  ;