Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
253 lines (252 loc) · 18.3 KB
/
Copy pathindex.html
File metadata and controls
253 lines (252 loc) · 18.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<!-- viewport-fit=cover: lets the app surface extend into the notch/home-
indicator areas on iOS, which is what makes env(safe-area-inset-*)
report real values (the historical timeline panel pads its bottom by
env(safe-area-inset-bottom) when docked full-bleed on mobile). -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<title>Terrain Viewer: hillshade, LiDAR DEMs and historical imagery</title>
<!-- Canonical: search engines treat every shared link (/?lat=...&zoom=...)
as the same page, the root, instead of thousands of near-duplicates.
Links keep working; this only tells crawlers which address to rank.
Each deploy points at its own root, so historical-satellite keeps
its own; the GitHub Pages mirror defers to the main domain. -->
<link rel="canonical" href="https://terrain-viewer.iconem.com/" />
<!-- Installable on a phone or desktop home screen (Add to Home Screen):
a web app manifest and icons, no service worker (nothing cached,
nothing offline, nothing to break). The historical host swaps in its
own manifest and icon below. -->
<link rel="manifest" href="/manifest.webmanifest" />
<meta name="theme-color" content="#0b1020" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="apple-mobile-web-app-title" content="Terrain Viewer" />
<link rel="apple-touch-icon" sizes="180x180" href="/icons/icon-apple-180.png" />
<script>
// A frame without an origin of its own (sandbox without
// allow-same-origin: some chat hosts frame an MCP App that way) has no
// storage: reading window.localStorage throws, and the app stayed
// blank. Settings then live in memory for the visit.
(function () {
function memory() {
var data = Object.create(null)
return {
getItem: function (k) { return k in data ? data[k] : null },
setItem: function (k, v) { data[k] = String(v) },
removeItem: function (k) { delete data[k] },
clear: function () { data = Object.create(null) },
key: function (i) { return Object.keys(data)[i] || null },
get length() { return Object.keys(data).length },
}
}
["localStorage", "sessionStorage"].forEach(function (name) {
try { window[name].getItem("tv-probe") } catch (e) {
try { Object.defineProperty(window, name, { value: memory(), configurable: true }) } catch (e2) { /* left as is */ }
window.__tvNoStorage = true
}
})
// The same frame cannot start a worker from a URL either ("cannot be
// accessed from origin 'null'"), so MapLibre drew nothing. What it may
// start is a script of its own that loads the real one: a blob with
// importScripts for a classic worker, a data: URL with an import for
// a module worker (a module worker from a blob is refused there too).
if (window.origin === "null" && window.Worker && window.Blob && window.URL) {
var NativeWorker = window.Worker
var BlobWorker = function (url, opts) {
var abs = new URL(String(url), location.href).href
if (/^(blob|data):/.test(abs)) return new NativeWorker(url, opts)
if (opts && opts.type === "module") return new NativeWorker("data:text/javascript," + encodeURIComponent("import " + JSON.stringify(abs) + ";"), opts)
return new NativeWorker(URL.createObjectURL(new Blob(["importScripts(" + JSON.stringify(abs) + ");"], { type: "text/javascript" })), opts)
}
BlobWorker.prototype = NativeWorker.prototype
window.Worker = BlobWorker
}
if (window.parent !== window && /[?&]tvRelayErrors=1/.test(location.search)) {
var relay = function (m) { try { window.parent.postMessage({ tvError: String(m) }, "*") } catch (e) { } }
window.addEventListener("error", function (e) { relay((e.message || "error") + " @ " + (e.filename || "") + ":" + (e.lineno || "")) })
window.addEventListener("unhandledrejection", function (e) { relay("rejection: " + ((e.reason && (e.reason.stack || e.reason.message)) || e.reason)) })
}
})()
</script>
<script>
(function () {
var h = location.hostname
if (h === "historical-satellite.iconem.com" || /\.historical-satellite\.iconem\.com$/.test(h)) {
document.querySelector('link[rel="canonical"]').href = location.origin + "/"
// The same HTML serves both hosts, so the historical host rewrites
// its own title, description and Open Graph tags here (Google and
// Bing render JavaScript; the no-JS shell below names both uses).
// Without this the host was indexed as an elevation viewer.
var title = "Historical Satellite Imagery: Esri Wayback, Google Earth and open archives by date"
var desc = "Free viewer for historical satellite and aerial imagery: Esri World Imagery Wayback, Google Earth timelapse, Bing dated imagery, national archives and open post-disaster data on one timeline, side by side or swiped."
document.title = title
var set = function (sel, value) { var el = document.querySelector(sel); if (el) el.setAttribute("content", value) }
set('meta[name="description"]', desc)
set('meta[property="og:title"]', title)
set('meta[property="og:description"]', desc)
set('meta[property="og:url"]', location.origin + "/")
var man = document.querySelector('link[rel="manifest"]'); if (man) man.href = "/manifest-historical.webmanifest"
var apple = document.querySelector('link[rel="apple-touch-icon"]'); if (apple) apple.href = "/icons/icon-historical-apple-180.png"
set('meta[name="apple-mobile-web-app-title"]', "Historical Sat")
}
})()
</script>
<!-- Search Console / Bing Webmaster site verification (URL-prefix
property https://jo-chemla.github.io/terrain-viewer/, which also
covers /docs). Public tokens, not secrets. -->
<meta name="google-site-verification" content="yvuxv85jdDSBNbn-V6DXMgceZnZR_Lo2yyVn5KAehIM" />
<meta name="msvalidate.01" content="E2FD8970E8A818A99FA195747F71AE68" />
<meta name="description" content="Free web viewer for elevation data: hillshade, contours, slope and sky-view factor on global terrain, national LiDAR or your own COG, in 2D, 3D and on a globe." />
<!-- schema.org description of the app, read by search engines and AI
assistants that do not run the JavaScript. -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebApplication",
"name": "Terrain Viewer",
"url": "https://terrain-viewer.iconem.com/",
"description": "Free, open-source web viewer for elevation data (DEM, DTM, DSM, LiDAR). Hillshade, hypsometric tint, contours, slope, aspect, curvature, local relief model, sky-view factor, openness, matcap and Phong lighting, side-by-side comparison and GeoTIFF export, over global terrain, national LiDAR and open-data services, and your own COG, VRT or WMS.",
"applicationCategory": "GIS",
"operatingSystem": "Any (web browser)",
"browserRequirements": "Requires JavaScript and WebGL",
"isAccessibleForFree": true,
"offers": { "@type": "Offer", "price": "0", "priceCurrency": "EUR" },
"license": "https://github.com/Iconem/terrain-viewer",
"codeRepository": "https://github.com/Iconem/terrain-viewer",
"author": { "@type": "Organization", "name": "Iconem", "url": "https://iconem.com" },
"image": "https://terrain-viewer.iconem.com/terrain-viewer.jpg",
"featureList": ["Hillshade", "Hypsometric tint", "Contour lines", "Slope, aspect, curvature, TPI, roughness", "Local relief model, sky-view factor, openness", "Matcap and Phong lighting", "Side-by-side and overlay comparison", "GeoTIFF export of the DEM and every mode", "COG, VRT, WMS, ArcGIS LERC and Cesium quantized mesh terrain in the browser"]
}
</script>
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<!-- Purple favicon everywhere except the real production domains (any local
dev port, preview/staging deploy, etc.) so an open prod tab is never
visually confusable with a dev one. Inline + synchronous (not a React
effect) so it swaps before first paint, no flash of the wrong icon.
jo-chemla.github.io is the plain GitHub Pages URL this same build is
also served from (terrain-viewer.iconem.com is just a custom domain
pointed at the same Pages deploy) — also real prod, not a fork/preview.
historical-satellite.iconem.com (and any subdomain) is real prod too,
same as any other domain here — see isProdHostname in
lib/settings-atoms.ts, which this duplicates (a plain HTML file can't
import it) since TerrainViewer's own React effect (keyed on
isHistoricalMode) needs the identical rule.
Shape (mountain vs clock, matching the historical-timeline toggle's
own lucide Clock icon, see HistoricalTimelineToggle.tsx) is decided by
the live app MODE, not the domain — historical-satellite.iconem.com
merely defaults a first-ever visit there into Historical mode (see
isHistoricalHostname), same as any domain once a visitor has actually
switched modes. This is only a best-effort guess for the instant
before React mounts and that effect takes over: stored appMode (if
this browser has ever set one, for this exact origin) wins; only a
truly first-ever visit falls back to the hostname default. -->
<script>
(function () {
var host = location.hostname
var isHistoricalHost = host === "historical-satellite.iconem.com" || /\.historical-satellite\.iconem\.com$/.test(host)
var isProd = host === "terrain-viewer.iconem.com" || host === "jo-chemla.github.io" || isHistoricalHost
var storedAppMode = null
try { storedAppMode = JSON.parse(window.localStorage.getItem("appMode") || "null") } catch (e) {}
var isHistoricalShape = storedAppMode ? storedAppMode === "historical" : isHistoricalHost
var href = isHistoricalShape
? (isProd ? "/favicon-historical.svg" : "/favicon-historical-dev.svg")
: (isProd ? "/favicon.svg" : "/favicon-dev.svg")
var link = document.querySelector('link[rel="icon"]')
if (link) link.href = href
})()
</script>
<!-- HeritageWatch AI brand fonts (Bebas Neue headings + Inter body) — only
actually applied when the HWAI theme is active; harmless otherwise. -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@400;500;600;700&family=Outfit&family=Plus+Jakarta+Sans&family=Playfair+Display&family=Merriweather&family=JetBrains+Mono&family=Fira+Code&family=Gabriela&family=Delius+Swash+Caps&family=Geist+Mono&family=Source+Code+Pro&family=Source+Serif+4&family=IBM+Plex+Mono&family=Libre+Baskerville&family=Lora&family=PT+Serif&family=Roboto+Mono&family=Space+Mono&family=Ubuntu+Mono&family=Barlow&family=DM+Sans&family=Geist&family=Lato&family=Montserrat&family=Nunito&family=Open+Sans&family=Poppins&family=Roboto&display=swap" />
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl@5.11.0/dist/maplibre-gl.css" />
<link rel="stylesheet" href="https://unpkg.com/@maplibre/maplibre-gl-geocoder@1.7.0/dist/maplibre-gl-geocoder.css" />
<!-- Loaded only outside local dev — umami's cloud script has no built-in
domain filter, so a plain static tag here would also report every
localhost dev session into the same production dataset. -->
<script>
(function () {
var host = location.hostname
var isLocal = host === "localhost" || host === "127.0.0.1" || host === "::1" || host === ""
if (isLocal) return
// The website id comes from the build's .env (VITE_UMAMI_WEBSITE_ID,
// the deploy's ENV_FILE_CONTENT secret), not from the source: a
// clone built without it reports nowhere. Vite fills the placeholder.
var websiteId = "%VITE_UMAMI_WEBSITE_ID%"
if (!/^[0-9a-f-]{36}$/.test(websiteId)) return
// One browser can mark itself: ?umamiTag=owner stores the tag
// (?umamiTag= clears it), and its loads then carry "owner" instead
// of web / embed / desktop, so the owner's own sessions filter out.
var ownTag = ""
try {
var m = location.search.match(/[?&]umamiTag=([^&]*)/)
if (m) { if (m[1]) localStorage.setItem("umamiTag", decodeURIComponent(m[1])); else localStorage.removeItem("umamiTag") }
// Stored, so out of the address bar (it is not app state, and a copied link must not carry it).
if (m) { try { var u = new URL(location.href); u.searchParams.delete("umamiTag"); history.replaceState(history.state, "", u.toString()) } catch (e) {} }
ownTag = localStorage.getItem("umamiTag") || ""
} catch (e) {}
var s = document.createElement("script")
s.defer = true
s.src = "https://cloud.umami.is/script.js"
s.setAttribute("data-website-id", websiteId)
// umami wraps history.pushState AND replaceState and records a
// pageview whenever the URL changes. Every setting and every camera
// move rewrites the query string (nuqs), so each pan counted as a
// pageview. Pageviews are counted on the path only; what users do is
// tracked with explicit events (lib/analytics.ts).
s.setAttribute("data-exclude-search", "true")
// A hash change counts as a pageview too (20 hash-only history calls
// measured as 20 pageviews on 2026-10-09); the docs headings are hash links.
s.setAttribute("data-exclude-hash", "true")
// The tracker itself only reports from these hosts (any other clone,
// fork or LAN address stays silent even with this tag in place; the
// localhost guard above is the first line, this the second).
s.setAttribute("data-domains", "terrain-viewer.iconem.com,historical-satellite.iconem.com,jo-chemla.github.io,app")
// A tag tells the loads apart in the dashboard (Filter by tag): the
// desktop app (Electrobun serves views://app/, no http), and the
// iframe embeds (the HeritageWatch and Anchise toolboxes), the rest web.
s.setAttribute("data-tag", ownTag || (!/^https?:$/.test(location.protocol) ? "desktop" : window.self !== window.top ? "embed" : "web"))
document.head.appendChild(s)
})()
</script>
<meta name="og:title" property="og:title" content="Terrain Viewer: hillshade, LiDAR DEMs and historical imagery" />
<meta name="og:description" property="og:description" content="Free web viewer for elevation data: hillshade, contours, slope and sky-view factor on global terrain, national LiDAR or your own COG, in 2D, 3D and on a globe." />
<meta name="og:image" property="og:image" content="https://terrain-viewer.iconem.com/terrain-viewer.jpg" />
<meta property="og:url" content="https://terrain-viewer.iconem.com/" />
</head>
<body>
<!-- What crawlers and AI fetchers that do not run JavaScript see; React
replaces it on its first render. Faded in only after 2 s, so a
normal load never shows it. -->
<style>
.shell { max-width: 44rem; margin: 3rem auto; padding: 0 1.25rem; font: 15px/1.55 system-ui, sans-serif; color: #444; opacity: 0; animation: shell-in 0s 2s forwards }
.shell a { color: #2563eb }
@keyframes shell-in { to { opacity: 1 } }
</style>
<div id="root">
<main class="shell">
<h1>Terrain Viewer, and Historical Satellite</h1>
<p>A free, open-source web viewer for elevation data by <a href="https://iconem.com">Iconem</a>, built on MapLibre GL JS. It shows terrain in 2D, 3D and on a globe with hillshade, hypsometric tint, contours, slope, aspect, curvature, local relief model, sky-view factor, openness and matcap or Phong lighting; compares sources side by side; and exports the DEM and every mode as GeoTIFF.</p>
<p>It reads global terrain (Mapterhorn, AWS, Mapbox, MapTiler), national LiDAR and open-data services, and your own Cloud-Optimized GeoTIFF, GDAL VRT, WMS, ArcGIS LERC or Cesium quantized-mesh terrain, all in the browser. Every setting lives in the URL, so a link opens a place in a given mode.</p>
<p>The same app is <a href="https://historical-satellite.iconem.com/">Historical Satellite</a>: historical satellite and aerial imagery on a timeline, Esri World Imagery Wayback, Google Earth timelapse, Bing dated imagery, national archives and open post-disaster releases, in a grid of dated views, blended or swiped, with footprints of what covers the place. See <a href="/docs/features/historical-imagery/">Historical imagery</a> and <a href="/docs/features/historical-sources/">Historical sources</a>.</p>
<p>This page needs JavaScript and WebGL. Documentation:</p>
<ul>
<li><a href="/docs/">Documentation home</a></li>
<li><a href="/docs/features/visualization-modes/">Visualization modes</a></li>
<li><a href="/docs/features/terrain-sources/">Terrain sources</a> and <a href="/docs/features/national-datasets/">national open-data terrain</a></li>
<li><a href="/docs/features/export-and-share/">Export and share</a></li>
<li><a href="/docs/dev/url-api/">URL API</a>: build a link to any place and mode</li>
<li><a href="/sun-position-estimator.html">Sun position calculator</a>: solar azimuth and altitude, analemma, shadow length</li>
<li><a href="/docs/dev/google-timelapse/">Google Earth Timelapse on a map</a>, 1984 to 2022</li>
<li><a href="/docs/dev/custom-protocols/">Custom protocols</a> for developers</li>
<li><a href="https://github.com/Iconem/terrain-viewer">Source code on GitHub</a></li>
</ul>
</main>
</div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>