Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ https://rolgim.github.io/PlanetaryLocator/

#### Key feature: Add nomenclature using the + button (also available in the multi-world dashboard)
<img width="1838" height="960" alt="image" src="https://github.com/user-attachments/assets/14ef3190-1d11-48a8-870b-0435c0eefe61" />

## Credits

All maps are dynamically retrieved from the [NASA Trek catalogue]: https://trek.nasa.gov/# using their WMTS Layer Services.
16 changes: 8 additions & 8 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { PLANETS } from "./data/planets.js";
import { GROUPS } from "./data/groups.js";


// ── Inject group styles ────────────────────────────────────────────────────────
// Inject group styles /////////////////////
(function() {
const style = document.createElement('style');
style.textContent = `
Expand Down Expand Up @@ -78,7 +78,7 @@ import { GROUPS } from "./data/groups.js";



// ── State ─────────────────────────────────────────────────────────────────────
// State /////////////////////

document.getElementById('planet-count').textContent = PLANETS.length;

Expand All @@ -91,7 +91,7 @@ import { GROUPS } from "./data/groups.js";
let sharedCenter = [48.8566, 2.3522]; // lat/lng propagated to all maps
let isSyncing = false; // re-entrancy guard for zoom+pan sync

// ── Helpers ───────────────────────────────────────────────────────────────────
// Helpers /////////////////////

function markerIcon(color) {
return L.divIcon({
Expand Down Expand Up @@ -130,7 +130,7 @@ import { GROUPS } from "./data/groups.js";
return { baseLayers, overlayLayers };
}

// ── Feature 1 : zoom + pan synchronisés ──────────────────────────────────────
// Feature 1 : zoom + pan synchronisés /////////////////////

/** Propagate zoom to every mini-map. Zoom is clamped per-planet native ceiling. */
function syncZoomToAll(sourceId, newZoom) {
Expand Down Expand Up @@ -162,7 +162,7 @@ import { GROUPS } from "./data/groups.js";
isSyncing = false;
}

// ── Feature 2 : modal grand écran ─────────────────────────────────────────────
// Feature 2 : modal grand écran /////////////////////

/** Build the modal DOM once and reuse it. */
function ensureModal() {
Expand Down Expand Up @@ -253,7 +253,7 @@ import { GROUPS } from "./data/groups.js";
if (modalMap) { modalMap.remove(); modalMap = null; modalMarker = null; }
}

// ── Build grid ────────────────────────────────────────────────────────────────
// Build grid /////////////////////

function buildGrid() {
const grid = document.getElementById('grid');
Expand Down Expand Up @@ -314,7 +314,7 @@ import { GROUPS } from "./data/groups.js";
markerInstances[p.id] = marker;
setCoordsLabel(p.id, lat, lng);

// ── Zoom + pan sync listeners (mini-maps only, not modal) ─────────────
// Zoom + pan sync listeners (mini-maps only, not modal) /////////////////////
map.on('zoomend', () => {
if (!isSyncing) syncZoomToAll(p.id, map.getZoom());
});
Expand All @@ -326,7 +326,7 @@ import { GROUPS } from "./data/groups.js";
});
}

// ── Coordinate sync ───────────────────────────────────────────────────────────
// Coordinate sync /////////////////////

function updateAllMaps() {
const lat = parseFloat(document.getElementById('lat').value);
Expand Down