Milchstrasse erst mal raus. Darstellungsprobleme nicht lösbar aktuell
This commit is contained in:
@@ -15,8 +15,6 @@ $constellationDataError = null;
|
|||||||
$starDataError = null;
|
$starDataError = null;
|
||||||
$messierData = [];
|
$messierData = [];
|
||||||
$messierDataError = null;
|
$messierDataError = null;
|
||||||
$milkyWayData = null;
|
|
||||||
$milkyWayDataError = null;
|
|
||||||
$availableLocations = [];
|
$availableLocations = [];
|
||||||
$starDbMagLimit = 12.0;
|
$starDbMagLimit = 12.0;
|
||||||
|
|
||||||
@@ -236,16 +234,6 @@ try {
|
|||||||
$messierDataError = $e->getMessage();
|
$messierDataError = $e->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
$milkyWayPath = __DIR__ . '/js/mw.json';
|
|
||||||
if (is_file($milkyWayPath)) {
|
|
||||||
$milkyWayData = json_decode((string) file_get_contents($milkyWayPath), true, 512, JSON_THROW_ON_ERROR);
|
|
||||||
}
|
|
||||||
} catch (Throwable $e) {
|
|
||||||
$milkyWayData = null;
|
|
||||||
$milkyWayDataError = $e->getMessage();
|
|
||||||
}
|
|
||||||
|
|
||||||
$favCometDataJson = json_encode(
|
$favCometDataJson = json_encode(
|
||||||
$favCometData ?? [],
|
$favCometData ?? [],
|
||||||
JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES
|
JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES
|
||||||
@@ -271,14 +259,6 @@ $messierDataErrorJson = json_encode(
|
|||||||
$messierDataError,
|
$messierDataError,
|
||||||
JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES
|
JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES
|
||||||
);
|
);
|
||||||
$milkyWayDataJson = json_encode(
|
|
||||||
$milkyWayData,
|
|
||||||
JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES
|
|
||||||
);
|
|
||||||
$milkyWayDataErrorJson = json_encode(
|
|
||||||
$milkyWayDataError,
|
|
||||||
JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES
|
|
||||||
);
|
|
||||||
?>
|
?>
|
||||||
<?php require __DIR__ . '/header.php'; ?>
|
<?php require __DIR__ . '/header.php'; ?>
|
||||||
<?php
|
<?php
|
||||||
@@ -393,13 +373,6 @@ if (!$availableLocations) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="sp-row">
|
|
||||||
<span class="sp-label">Milchstraße</span>
|
|
||||||
<div class="sp-toggles">
|
|
||||||
<label class="sp-toggle"><input type="checkbox" id="cfgMilkyWayShow" checked><span class="sp-pill"></span><span class="sp-text">an</span></label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="sp-row">
|
<div class="sp-row">
|
||||||
<span class="sp-label">Sternbilder</span>
|
<span class="sp-label">Sternbilder</span>
|
||||||
<div class="sp-toggles">
|
<div class="sp-toggles">
|
||||||
@@ -522,14 +495,6 @@ const CFG_DEFAULT = {
|
|||||||
ecliptic: {
|
ecliptic: {
|
||||||
color: 'rgba(255,175,35,0.52)', width: 1.1, dash: [5,5]
|
color: 'rgba(255,175,35,0.52)', width: 1.1, dash: [5,5]
|
||||||
},
|
},
|
||||||
milkyWay: {
|
|
||||||
fillSoft: 'rgba(180, 208, 255, 0.018)',
|
|
||||||
fillMain: 'rgba(210, 228, 255, 0.028)',
|
|
||||||
stroke: 'rgba(220, 235, 255, 0.035)',
|
|
||||||
glow: 'rgba(185, 210, 255, 0.10)',
|
|
||||||
blur: 16,
|
|
||||||
minPoints: 20
|
|
||||||
},
|
|
||||||
constellations: {
|
constellations: {
|
||||||
color: 'rgba(100,160,220,0.38)', width: 0.8, dash: [],
|
color: 'rgba(100,160,220,0.38)', width: 0.8, dash: [],
|
||||||
colorLabels: 'rgba(120,175,230,0.50)', fontLabels: '9px Rajdhani, sans-serif'
|
colorLabels: 'rgba(120,175,230,0.50)', fontLabels: '9px Rajdhani, sans-serif'
|
||||||
@@ -631,7 +596,6 @@ let showAltaz = false;
|
|||||||
let showPlanets = true;
|
let showPlanets = true;
|
||||||
let showSunMoon = true;
|
let showSunMoon = true;
|
||||||
let showEclip = true;
|
let showEclip = true;
|
||||||
let showMilkyWay = true;
|
|
||||||
let showMessier = true;
|
let showMessier = true;
|
||||||
let showConst = true;
|
let showConst = true;
|
||||||
let showComets = true;
|
let showComets = true;
|
||||||
@@ -654,8 +618,6 @@ const STAR_DATA_URL = 'sternenhimmel.php?stars_api=1';
|
|||||||
const EMBEDDED_STAR_ERROR = <?php echo $starDataErrorJson ?: 'null'; ?>;
|
const EMBEDDED_STAR_ERROR = <?php echo $starDataErrorJson ?: 'null'; ?>;
|
||||||
const EMBEDDED_MESSIER_DATA = <?php echo $messierDataJson ?: '[]'; ?>;
|
const EMBEDDED_MESSIER_DATA = <?php echo $messierDataJson ?: '[]'; ?>;
|
||||||
const EMBEDDED_MESSIER_ERROR = <?php echo $messierDataErrorJson ?: 'null'; ?>;
|
const EMBEDDED_MESSIER_ERROR = <?php echo $messierDataErrorJson ?: 'null'; ?>;
|
||||||
const EMBEDDED_MILKY_WAY_DATA = <?php echo $milkyWayDataJson ?: 'null'; ?>;
|
|
||||||
const EMBEDDED_MILKY_WAY_ERROR = <?php echo $milkyWayDataErrorJson ?: 'null'; ?>;
|
|
||||||
const MESSIER = Array.isArray(EMBEDDED_MESSIER_DATA) ? EMBEDDED_MESSIER_DATA : [];
|
const MESSIER = Array.isArray(EMBEDDED_MESSIER_DATA) ? EMBEDDED_MESSIER_DATA : [];
|
||||||
const FAV_COMETS = <?php echo $favCometDataJson ?: '[]'; ?>;
|
const FAV_COMETS = <?php echo $favCometDataJson ?: '[]'; ?>;
|
||||||
let constellationData = EMBEDDED_CONSTELLATION_DATA;
|
let constellationData = EMBEDDED_CONSTELLATION_DATA;
|
||||||
@@ -674,66 +636,6 @@ function buildMStyle() {
|
|||||||
}
|
}
|
||||||
let M_STYLE = buildMStyle();
|
let M_STYLE = buildMStyle();
|
||||||
|
|
||||||
function buildMilkyWayRings(data) {
|
|
||||||
if (!data || !Array.isArray(data.features)) return [];
|
|
||||||
|
|
||||||
const rings = [];
|
|
||||||
for (const feature of data.features) {
|
|
||||||
const geometry = feature && feature.geometry ? feature.geometry : null;
|
|
||||||
if (!geometry) continue;
|
|
||||||
|
|
||||||
const polygons = geometry.type === 'Polygon'
|
|
||||||
? [geometry.coordinates]
|
|
||||||
: geometry.type === 'MultiPolygon'
|
|
||||||
? geometry.coordinates
|
|
||||||
: [];
|
|
||||||
|
|
||||||
for (const polygon of polygons) {
|
|
||||||
if (!Array.isArray(polygon)) continue;
|
|
||||||
for (const rawRing of polygon) {
|
|
||||||
if (!Array.isArray(rawRing) || rawRing.length < CFG.milkyWay.minPoints) continue;
|
|
||||||
|
|
||||||
const coords = [];
|
|
||||||
let area = 0;
|
|
||||||
|
|
||||||
for (let i = 0; i < rawRing.length; i++) {
|
|
||||||
const point = rawRing[i];
|
|
||||||
if (!Array.isArray(point) || point.length < 2) continue;
|
|
||||||
const lon = Number(point[0]);
|
|
||||||
const lat = Number(point[1]);
|
|
||||||
if (!Number.isFinite(lon) || !Number.isFinite(lat)) continue;
|
|
||||||
|
|
||||||
coords.push([lon, lat]);
|
|
||||||
|
|
||||||
if (i < rawRing.length - 1) {
|
|
||||||
const next = rawRing[i + 1];
|
|
||||||
const lon2 = Array.isArray(next) ? Number(next[0]) : NaN;
|
|
||||||
const lat2 = Array.isArray(next) ? Number(next[1]) : NaN;
|
|
||||||
if (Number.isFinite(lon2) && Number.isFinite(lat2)) {
|
|
||||||
area += (lon * lat2) - (lon2 * lat);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (coords.length < CFG.milkyWay.minPoints) continue;
|
|
||||||
|
|
||||||
const areaAbs = Math.abs(area / 2);
|
|
||||||
if (!Number.isFinite(areaAbs)) continue;
|
|
||||||
|
|
||||||
rings.push({
|
|
||||||
coords,
|
|
||||||
areaAbs,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
rings.sort((a, b) => b.areaAbs - a.areaAbs);
|
|
||||||
return rings;
|
|
||||||
}
|
|
||||||
|
|
||||||
const MILKY_WAY_RINGS = buildMilkyWayRings(EMBEDDED_MILKY_WAY_DATA);
|
|
||||||
|
|
||||||
function getTime() { return liveMode ? new Date() : simTime; }
|
function getTime() { return liveMode ? new Date() : simTime; }
|
||||||
|
|
||||||
// ═══════════════════════════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════════════════════════
|
||||||
@@ -1968,7 +1870,6 @@ function render() {
|
|||||||
ctx.fill();
|
ctx.fill();
|
||||||
ctx.clip();
|
ctx.clip();
|
||||||
|
|
||||||
if (showMilkyWay) drawMilkyWay(date);
|
|
||||||
if (showAltaz) drawAltazGrid();
|
if (showAltaz) drawAltazGrid();
|
||||||
if (showEq) drawEquatorialGrid(date);
|
if (showEq) drawEquatorialGrid(date);
|
||||||
if (showEclip) drawEcliptic(date);
|
if (showEclip) drawEcliptic(date);
|
||||||
@@ -2303,7 +2204,6 @@ spBind('cfgPlanetsShow', () => showPlanets, v => showPlanets = v);
|
|||||||
spBind('cfgCometsShow', () => showComets, v => showComets = v);
|
spBind('cfgCometsShow', () => showComets, v => showComets = v);
|
||||||
spBind('cfgCometsLabels', () => labelComets, v => labelComets = v);
|
spBind('cfgCometsLabels', () => labelComets, v => labelComets = v);
|
||||||
spBind('cfgEclipShow', () => showEclip, v => showEclip = v);
|
spBind('cfgEclipShow', () => showEclip, v => showEclip = v);
|
||||||
spBind('cfgMilkyWayShow', () => showMilkyWay, v => showMilkyWay = v);
|
|
||||||
spBind('cfgMessierShow', () => showMessier, v => showMessier = v);
|
spBind('cfgMessierShow', () => showMessier, v => showMessier = v);
|
||||||
spBind('cfgSunMoonShow', () => showSunMoon, v => showSunMoon = v);
|
spBind('cfgSunMoonShow', () => showSunMoon, v => showSunMoon = v);
|
||||||
|
|
||||||
@@ -2394,10 +2294,6 @@ if (EMBEDDED_MESSIER_ERROR) {
|
|||||||
console.warn('Messier-Daten aus der Datenbank nicht geladen:', EMBEDDED_MESSIER_ERROR);
|
console.warn('Messier-Daten aus der Datenbank nicht geladen:', EMBEDDED_MESSIER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EMBEDDED_MILKY_WAY_ERROR) {
|
|
||||||
console.warn('Milchstraßen-Daten nicht geladen:', EMBEDDED_MILKY_WAY_ERROR);
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateStarLoadingUi(done, total) {
|
function updateStarLoadingUi(done, total) {
|
||||||
if (!starLoadingOverlay || !starLoadingFill || !starLoadingStatus || !starLoadingNote) return;
|
if (!starLoadingOverlay || !starLoadingFill || !starLoadingStatus || !starLoadingNote) return;
|
||||||
const safeTotal = Math.max(1, total);
|
const safeTotal = Math.max(1, total);
|
||||||
|
|||||||
Reference in New Issue
Block a user