isard 1.2.0 → 1.3.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 (94) hide show
  1. package/CHANGELOG.md +88 -0
  2. package/README.md +44 -39
  3. package/dist/basemap/pmtileslayer.d.ts +33 -0
  4. package/dist/basemap/pmtileslayer.js +97 -0
  5. package/dist/basemap/pmtileslayer.js.map +1 -0
  6. package/dist/basemap/trees.d.ts +26 -0
  7. package/dist/basemap/trees.js +141 -0
  8. package/dist/basemap/trees.js.map +1 -0
  9. package/dist/basemap/vectorstyle.d.ts +10 -0
  10. package/dist/basemap/vectorstyle.js +35 -0
  11. package/dist/basemap/vectorstyle.js.map +1 -1
  12. package/dist/basemap/vectortiles.d.ts +67 -44
  13. package/dist/basemap/vectortiles.js +386 -302
  14. package/dist/basemap/vectortiles.js.map +1 -1
  15. package/dist/basemap/workerpool.d.ts +17 -0
  16. package/dist/basemap/workerpool.js +194 -0
  17. package/dist/basemap/workerpool.js.map +1 -0
  18. package/dist/basemap.worker.js +2 -2
  19. package/dist/basemap.worker.js.map +15 -8
  20. package/dist/decoder.worker.js +4 -4
  21. package/dist/decoder.worker.js.map +3 -3
  22. package/dist/engine-loader.d.ts +5 -1
  23. package/dist/engine-loader.js +11 -1
  24. package/dist/engine-loader.js.map +1 -1
  25. package/dist/geoplateforme.d.ts +16 -0
  26. package/dist/geoplateforme.js +23 -0
  27. package/dist/geoplateforme.js.map +1 -1
  28. package/dist/index.d.ts +11 -4
  29. package/dist/index.js +9 -2
  30. package/dist/index.js.map +1 -1
  31. package/dist/isard_bg.wasm +0 -0
  32. package/dist/isard_core_bg.wasm +0 -0
  33. package/dist/isard_tess_bg.wasm +0 -0
  34. package/dist/layers/layers.js +9 -0
  35. package/dist/layers/layers.js.map +1 -1
  36. package/dist/layers/vectors.d.ts +60 -0
  37. package/dist/layers/vectors.js +130 -0
  38. package/dist/layers/vectors.js.map +1 -0
  39. package/dist/map/frame-loop.d.ts +3 -0
  40. package/dist/map/frame-loop.js +6 -0
  41. package/dist/map/frame-loop.js.map +1 -1
  42. package/dist/map/raster-source.js +1 -1
  43. package/dist/map/raster-source.js.map +1 -1
  44. package/dist/map/workers.d.ts +1 -1
  45. package/dist/map/workers.js +1 -1
  46. package/dist/map/workers.js.map +1 -1
  47. package/dist/map.d.ts +21 -6
  48. package/dist/map.js +65 -11
  49. package/dist/map.js.map +1 -1
  50. package/dist/react/IsardMap.js +1 -0
  51. package/dist/react/IsardMap.js.map +1 -1
  52. package/dist/react/Swipe.d.ts +11 -4
  53. package/dist/react/Swipe.js +26 -15
  54. package/dist/react/Swipe.js.map +1 -1
  55. package/dist/react/VectorGeometry.d.ts +35 -0
  56. package/dist/react/VectorGeometry.js +82 -0
  57. package/dist/react/VectorGeometry.js.map +1 -0
  58. package/dist/react/context.d.ts +2 -1
  59. package/dist/react/context.js.map +1 -1
  60. package/dist/react/index.d.ts +2 -1
  61. package/dist/react/index.js +2 -1
  62. package/dist/react/index.js.map +1 -1
  63. package/dist/types.d.ts +24 -1
  64. package/dist/types.js.map +1 -1
  65. package/dist/ui/minimap.d.ts +25 -0
  66. package/dist/ui/minimap.js +90 -0
  67. package/dist/ui/minimap.js.map +1 -0
  68. package/dist/ui/scale.d.ts +19 -0
  69. package/dist/ui/scale.js +44 -0
  70. package/dist/ui/scale.js.map +1 -0
  71. package/dist/ui/search.d.ts +25 -0
  72. package/dist/ui/search.js +119 -0
  73. package/dist/ui/search.js.map +1 -0
  74. package/dist/ui/style.js +17 -0
  75. package/dist/ui/style.js.map +1 -1
  76. package/dist/util/sun.d.ts +11 -0
  77. package/dist/util/sun.js +26 -0
  78. package/dist/util/sun.js.map +1 -0
  79. package/dist/wasm/isard.d.ts +82 -7
  80. package/dist/wasm/isard.js +229 -8
  81. package/dist/wasm/isard_core.d.ts +82 -7
  82. package/dist/wasm/isard_core.js +229 -8
  83. package/dist/wasm/isard_tess.d.ts +109 -0
  84. package/dist/wasm/isard_tess.js +398 -0
  85. package/dist/workers/basemap/geometry.d.ts +72 -0
  86. package/dist/workers/basemap/labels.d.ts +8 -0
  87. package/dist/workers/basemap/raster.d.ts +10 -0
  88. package/dist/workers/basemap/tiles.d.ts +65 -0
  89. package/dist/workers/basemap/trees.d.ts +19 -0
  90. package/dist/workers/basemap.worker.d.ts +126 -22
  91. package/dist/workers/basemap.worker.js +72 -551
  92. package/dist/workers/basemap.worker.js.map +1 -1
  93. package/package.json +5 -4
  94. package/vite.js +10 -2
@@ -0,0 +1,119 @@
1
+ /**
2
+ * The search bar: places suggested as the user types (the Géoplateforme's geocoding by default, or yours), the map
3
+ * flying to the one picked. A combobox for screen readers: arrows move in the list, Enter picks, Escape closes.
4
+ */
5
+ import { geoplateformeGeocode } from "../geoplateforme.js";
6
+ /** Milliseconds of typing before the text is looked up */
7
+ const DEBOUNCE_MS = 250;
8
+ /** The default pick: a flight to the place, an address seen closer than a town */
9
+ const flyThere = (place, map) => map.flyTo({ center: place.lonLat, zoom: place.kind === 'address' ? 17 : 14 });
10
+ /** A text box and the places it suggests, in a corner of the map */
11
+ export class SearchControl {
12
+ options;
13
+ stop;
14
+ constructor(options = {}) {
15
+ this.options = options;
16
+ }
17
+ onAdd(map) {
18
+ const { geocode, onSelect = flyThere, placeholder = 'Search a place', maxResults = 8 } = this.options;
19
+ const lookUp = geocode ?? ((text, signal) => geoplateformeGeocode(text, { signal }));
20
+ const element = document.createElement('div');
21
+ const input = document.createElement('input');
22
+ const list = document.createElement('ul');
23
+ const listId = `isard-search-${Math.random().toString(36).slice(2)}`;
24
+ const state = { places: [], active: -1 };
25
+ element.className = 'isard-ctrl-search';
26
+ input.type = 'search';
27
+ input.placeholder = placeholder;
28
+ input.setAttribute('role', 'combobox');
29
+ input.setAttribute('aria-label', placeholder);
30
+ input.setAttribute('aria-autocomplete', 'list');
31
+ input.setAttribute('aria-controls', listId);
32
+ input.setAttribute('aria-expanded', 'false');
33
+ list.id = listId;
34
+ list.setAttribute('role', 'listbox');
35
+ list.hidden = true;
36
+ element.append(input, list);
37
+ const show = () => {
38
+ list.replaceChildren(...state.places.map((place, i) => {
39
+ const item = document.createElement('li');
40
+ item.id = `${listId}-${i}`;
41
+ item.setAttribute('role', 'option');
42
+ item.setAttribute('aria-selected', String(i === state.active));
43
+ item.textContent = place.label;
44
+ // Before the input's blur
45
+ item.addEventListener('pointerdown', (e) => {
46
+ e.preventDefault();
47
+ pick(i);
48
+ });
49
+ return item;
50
+ }));
51
+ list.hidden = state.places.length === 0;
52
+ input.setAttribute('aria-expanded', String(!list.hidden));
53
+ if (state.active >= 0)
54
+ input.setAttribute('aria-activedescendant', `${listId}-${state.active}`);
55
+ else
56
+ input.removeAttribute('aria-activedescendant');
57
+ };
58
+ const close = () => {
59
+ state.places = [];
60
+ state.active = -1;
61
+ show();
62
+ };
63
+ const pick = (i) => {
64
+ const place = state.places[i];
65
+ if (!place)
66
+ return;
67
+ input.value = place.label;
68
+ close();
69
+ onSelect(place, map);
70
+ };
71
+ const search = () => {
72
+ state.query?.abort();
73
+ const query = new AbortController();
74
+ state.query = query;
75
+ lookUp(input.value, query.signal).then((places) => {
76
+ if (query.signal.aborted)
77
+ return;
78
+ state.places = places.slice(0, maxResults);
79
+ state.active = -1;
80
+ show();
81
+ }, (error) => {
82
+ if (!query.signal.aborted)
83
+ console.warn(error);
84
+ });
85
+ };
86
+ input.addEventListener('input', () => {
87
+ clearTimeout(state.timer);
88
+ state.timer = setTimeout(search, DEBOUNCE_MS);
89
+ });
90
+ input.addEventListener('keydown', (e) => {
91
+ const count = state.places.length;
92
+ if (e.key === 'ArrowDown' && count > 0)
93
+ state.active = (state.active + 1) % count;
94
+ else if (e.key === 'ArrowUp' && count > 0)
95
+ state.active = (state.active - 1 + count) % count;
96
+ else if (e.key === 'Enter')
97
+ pick(Math.max(0, state.active));
98
+ else if (e.key === 'Escape')
99
+ close();
100
+ else
101
+ return;
102
+ e.preventDefault();
103
+ show();
104
+ });
105
+ input.addEventListener('blur', close);
106
+ // The map's keys (arrows, +, -) are not the input's
107
+ element.addEventListener('keydown', (e) => e.stopPropagation());
108
+ this.stop = () => {
109
+ clearTimeout(state.timer);
110
+ state.query?.abort();
111
+ };
112
+ return element;
113
+ }
114
+ onRemove() {
115
+ this.stop?.();
116
+ this.stop = undefined;
117
+ }
118
+ }
119
+ //# sourceMappingURL=search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/ui/search.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAsB,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAe/E,0DAA0D;AAC1D,MAAM,WAAW,GAAG,GAAG,CAAC;AAExB,kFAAkF;AAClF,MAAM,QAAQ,GAAG,CAAC,KAAoB,EAAE,GAAW,EAAE,EAAE,CACrD,GAAG,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAEhF,oEAAoE;AACpE,MAAM,OAAO,aAAa;IACP,OAAO,CAAgB;IAChC,IAAI,CAA2B;IAEvC,YAAY,UAAyB,EAAE;QACrC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,GAAW;QACf,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,QAAQ,EAAE,WAAW,GAAG,gBAAgB,EAAE,UAAU,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;QACtG,MAAM,MAAM,GAAG,OAAO,IAAI,CAAC,CAAC,IAAY,EAAE,MAAmB,EAAE,EAAE,CAAC,oBAAoB,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;QAC1G,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC9C,MAAM,KAAK,G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,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;iBAC7E,IAAI,CAAC,CAAC,GAAG,KAAK,SAAS,IAAI,KAAK,GAAG,CAAC;gBAAE,KAAK,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC;iBACxF,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO;gBAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;iBACvD,IAAI,CAAC,CAAC,GAAG,KAAK,QAAQ;gBAAE,KAAK,EAAE,CAAC;;gBAChC,OAAO;YACZ,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,IAAI,EAAE,CAAC;QACT,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,gBAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QACtC,oDAAoD;QACpD,OAAO,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,CAAC;QAEhE,IAAI,CAAC,IAAI,GAAG,GAAG,EAAE;YACf,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC1B,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC;QACvB,CAAC,CAAC;QAEF,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,QAAQ;QACN,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;QACd,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;IACxB,CAAC;CACF","sourcesContent":["/**\n * The search bar: places suggested as the user types (the Géoplateforme's geocoding by default, or yours), the map\n * flying to the one picked. A combobox for screen readers: arrows move in the list, Enter picks, Escape closes.\n */\n\nimport { type GeocodedPlace, geoplateformeGeocode } from '../geoplateforme.ts';\nimport type { GeoMap } from '../map.ts';\nimport type { Control } from './controls.ts';\n\nexport interface SearchOptions {\n /** The places of a text (default: the Géoplateforme's geocoding, France) */\n geocode?: (text: string, signal: AbortSignal) => Promise<GeocodedPlace[]>;\n /** What a pick does (default: a flight there, closer for an address than for a place) */\n onSelect?: (place: GeocodedPlace, map: GeoMap) => void;\n /** Default 'Search a place' */\n placeholder?: string;\n /** Suggestions shown at most (default 8) */\n maxResults?: number;\n}\n\n/** Milliseconds of typing before the text is looked up */\nconst DEBOUNCE_MS = 250;\n\n/** The default pick: a flight to the place, an address seen closer than a town */\nconst flyThere = (place: GeocodedPlace, map: GeoMap) =>\n map.flyTo({ center: place.lonLat, zoom: place.kind === 'address' ? 17 : 14 });\n\n/** A text box and the places it suggests, in a corner of the map */\nexport class SearchControl implements Control {\n private readonly options: SearchOptions;\n private stop: (() => void) | undefined;\n\n constructor(options: SearchOptions = {}) {\n this.options = options;\n }\n\n onAdd(map: GeoMap): HTMLElement {\n const { geocode, onSelect = flyThere, placeholder = 'Search a place', maxResults = 8 } = this.options;\n const lookUp = geocode ?? ((text: string, signal: AbortSignal) => geoplateformeGeocode(text, { signal }));\n const element = document.createElement('div');\n const input = document.createElement('input');\n const list = document.createElement('ul');\n const listId = `isard-search-${Math.random().toString(36).slice(2)}`;\n const state: {\n places: GeocodedPlace[];\n active: number;\n timer?: ReturnType<typeof setTimeout>;\n query?: AbortController;\n } = { places: [], active: -1 };\n\n element.className = 'isard-ctrl-search';\n input.type = 'search';\n input.placeholder = placeholder;\n input.setAttribute('role', 'combobox');\n input.setAttribute('aria-label', placeholder);\n input.setAttribute('aria-autocomplete', 'list');\n input.setAttribute('aria-controls', listId);\n input.setAttribute('aria-expanded', 'false');\n list.id = listId;\n list.setAttribute('role', 'listbox');\n list.hidden = true;\n element.append(input, list);\n\n const show = () => {\n list.replaceChildren(\n ...state.places.map((place, i) => {\n const item = document.createElement('li');\n\n item.id = `${listId}-${i}`;\n item.setAttribute('role', 'option');\n item.setAttribute('aria-selected', String(i === state.active));\n item.textContent = place.label;\n // Before the input's blur\n item.addEventListener('pointerdown', (e) => {\n e.preventDefault();\n pick(i);\n });\n\n return item;\n }),\n );\n list.hidden = state.places.length === 0;\n input.setAttribute('aria-expanded', String(!list.hidden));\n if (state.active >= 0) input.setAttribute('aria-activedescendant', `${listId}-${state.active}`);\n else input.removeAttribute('aria-activedescendant');\n };\n const close = () => {\n state.places = [];\n state.active = -1;\n show();\n };\n const pick = (i: number) => {\n const place = state.places[i];\n\n if (!place) return;\n input.value = place.label;\n close();\n onSelect(place, map);\n };\n const search = () => {\n state.query?.abort();\n\n const query = new AbortController();\n\n state.query = query;\n lookUp(input.value, query.signal).then(\n (places) => {\n if (query.signal.aborted) return;\n state.places = places.slice(0, maxResults);\n state.active = -1;\n show();\n },\n (error: unknown) => {\n if (!query.signal.aborted) console.warn(error);\n },\n );\n };\n\n input.addEventListener('input', () => {\n clearTimeout(state.timer);\n state.timer = setTimeout(search, DEBOUNCE_MS);\n });\n input.addEventListener('keydown', (e) => {\n const count = state.places.length;\n\n if (e.key === 'ArrowDown' && count > 0) state.active = (state.active + 1) % count;\n else if (e.key === 'ArrowUp' && count > 0) state.active = (state.active - 1 + count) % count;\n else if (e.key === 'Enter') pick(Math.max(0, state.active));\n else if (e.key === 'Escape') close();\n else return;\n e.preventDefault();\n show();\n });\n input.addEventListener('blur', close);\n // The map's keys (arrows, +, -) are not the input's\n element.addEventListener('keydown', (e) => e.stopPropagation());\n\n this.stop = () => {\n clearTimeout(state.timer);\n state.query?.abort();\n };\n\n return element;\n }\n\n onRemove(): void {\n this.stop?.();\n this.stop = undefined;\n }\n}\n"]}
package/dist/ui/style.js CHANGED
@@ -48,6 +48,23 @@ const CSS = `
48
48
  .isard-ctrl-group button.active { background: var(--isard-ctrl-active); color: var(--isard-ctrl-active-fg); }
49
49
  .isard-ctrl-group button svg { display: block; margin: auto; pointer-events: none; }
50
50
  .isard-ctrl-compass svg { transition: transform 0.05s; }
51
+ .isard-ctrl-scale {
52
+ box-sizing: border-box; padding: 0 5px; border: 2px solid var(--isard-ctrl-fg); border-top: 0;
53
+ background: var(--isard-attrib-bg); color: var(--isard-ctrl-fg); font: 11px/1.4 system-ui, sans-serif; white-space: nowrap;
54
+ }
55
+ .isard-ctrl-search { position: relative; width: 260px; }
56
+ .isard-ctrl-search input {
57
+ box-sizing: border-box; width: 100%; padding: 6px 10px; border: 0; border-radius: 4px; outline: none;
58
+ background: var(--isard-ctrl-bg); color: var(--isard-ctrl-fg); box-shadow: var(--isard-ctrl-shadow); font: 13px system-ui, sans-serif;
59
+ }
60
+ .isard-ctrl-search input:focus-visible { box-shadow: 0 0 0 2px var(--isard-focus); }
61
+ .isard-ctrl-search ul {
62
+ position: absolute; left: 0; right: 0; margin: 4px 0 0; padding: 4px 0; list-style: none; border-radius: 4px;
63
+ background: var(--isard-ctrl-bg); color: var(--isard-ctrl-fg); box-shadow: var(--isard-ctrl-shadow); font: 13px system-ui, sans-serif;
64
+ }
65
+ .isard-ctrl-search li { padding: 5px 10px; cursor: pointer; }
66
+ .isard-ctrl-search li:hover, .isard-ctrl-search li[aria-selected="true"] { background: var(--isard-ctrl-hover); }
67
+ .isard-ctrl-minimap { overflow: hidden; cursor: pointer; border-radius: 4px; box-shadow: var(--isard-ctrl-shadow); background: var(--isard-ctrl-bg); }
51
68
  .isard-marker { position: absolute; top: 0; left: 0; pointer-events: auto; will-change: transform; }
52
69
  .isard-marker-draggable { cursor: grab; touch-action: none; }
53
70
  .isard-marker-dragging { cursor: grabbing; }
@@ -1 +1 @@
1
- {"version":3,"file":"style.js","sourceRoot":"","sources":["../../src/ui/style.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,GAAG,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmHX,CAAC;AAEF,MAAM,MAAM,GAAG,IAAI,OAAO,EAAY,CAAC;AAEvC,mHAAmH;AACnH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAa,EAAQ,EAAE;IACjD,IAAI,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC;QAAE,OAAO;IAC5B,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAEhB,MAAM,KAAK,GAAG,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAEzC,KAAK,CAAC,OAAO,CAAC,KAAK,GAAG,EAAE,CAAC;IACzB,KAAK,CAAC,WAAW,GAAG,GAAG,CAAC;IACxB,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC1B,CAAC,CAAC","sourcesContent":["/**\n * Styles of the DOM overlays (markers, popups, controls), injected once per document so the package needs no CSS\n * file. Colors are custom properties, defaults on the root with no specificity: an application restyles them on any\n * element around the map (its container's class may be replaced by a framework: nothing depends on it).\n */\n\nconst CSS = `\n:where(:root) {\n --isard-ctrl-bg: #fff;\n --isard-ctrl-fg: #333;\n --isard-ctrl-hover: rgb(0 0 0 / 0.05);\n --isard-ctrl-active: #1d2433;\n --isard-ctrl-active-fg: #fff;\n --isard-ctrl-border: #ddd;\n --isard-ctrl-shadow: 0 0 0 2px rgb(0 0 0 / 0.1);\n --isard-popup-bg: #fff;\n --isard-popup-fg: #1d2433;\n --isard-marker-color: #3a6fd8;\n --isard-attrib-bg: rgb(255 255 255 / 0.5);\n --isard-attrib-fg: rgb(0 0 0 / 0.75);\n --isard-focus: #3a6fd8;\n}\n.isard-canvas:focus { outline: none; }\n.isard-canvas:focus-visible { outline: 2px solid var(--isard-focus); outline-offset: -2px; }\n.isard-overlay { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }\n.isard-ctrl-top-left, .isard-ctrl-top-right, .isard-ctrl-bottom-left, .isard-ctrl-bottom-right {\n position: absolute; pointer-events: none; z-index: 2;\n}\n.isard-ctrl-top-left { top: 0; left: 0; }\n.isard-ctrl-top-right { top: 0; right: 0; }\n.isard-ctrl-bottom-left { bottom: 0; left: 0; }\n.isard-ctrl-bottom-right { bottom: 0; right: 0; }\n.isard-ctrl { clear: both; pointer-events: auto; transform: translate(0, 0); }\n.isard-ctrl-top-left .isard-ctrl { float: left; margin: 10px 0 0 10px; }\n.isard-ctrl-top-right .isard-ctrl { float: right; margin: 10px 10px 0 0; }\n.isard-ctrl-bottom-left .isard-ctrl { float: left; margin: 0 0 10px 10px; }\n.isard-ctrl-bottom-right .isard-ctrl { float: right; margin: 0 10px 10px 0; }\n.isard-ctrl-group { background: var(--isard-ctrl-bg); border-radius: 4px; box-shadow: var(--isard-ctrl-shadow); }\n.isard-ctrl-group button {\n display: block; width: 29px; height: 29px; padding: 0; margin: 0; border: 0; box-sizing: border-box;\n background: transparent; color: var(--isard-ctrl-fg); cursor: pointer; font: inherit;\n}\n.isard-ctrl-group button + button { border-top: 1px solid var(--isard-ctrl-border); }\n.isard-ctrl-group button:first-child { border-radius: 4px 4px 0 0; }\n.isard-ctrl-group button:last-child { border-radius: 0 0 4px 4px; }\n.isard-ctrl-group button:only-child { border-radius: inherit; }\n.isard-ctrl-group button:hover { background-color: var(--isard-ctrl-hover); }\n.isard-ctrl-group button:focus-visible { outline: 2px solid var(--isard-ctrl-active); outline-offset: -2px; }\n.isard-ctrl-group button.active { background: var(--isard-ctrl-active); color: var(--isard-ctrl-active-fg); }\n.isard-ctrl-group button svg { display: block; margin: auto; pointer-events: none; }\n.isard-ctrl-compass svg { transition: transform 0.05s; }\n.isard-marker { position: absolute; top: 0; left: 0; pointer-events: auto; will-change: transform; }\n.isard-marker-draggable { cursor: grab; touch-action: none; }\n.isard-marker-dragging { cursor: grabbing; }\n.isard-marker-stem { position: absolute; z-index: -1; width: 2px; margin-left: -1px; transform-origin: top center; background: var(--isard-marker-color); opacity: 0.8; pointer-events: none; }\n.isard-marker-stem::after { content: \"\"; position: absolute; bottom: -3px; left: -2px; width: 6px; height: 6px; border-radius: 50%; background: inherit; }\n.isard-marker-pin { display: block; color: var(--isard-marker-color); filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.35)); }\n.isard-panel { position: absolute; top: 0; left: 0; transform-origin: 0 0; pointer-events: auto; will-change: transform; }\n.isard-popup {\n position: absolute; top: 0; left: 0; display: flex; pointer-events: none; will-change: transform; z-index: 1;\n color: var(--isard-popup-fg);\n}\n.isard-popup-anchor-top, .isard-popup-anchor-top-left, .isard-popup-anchor-top-right { flex-direction: column; }\n.isard-popup-anchor-bottom, .isard-popup-anchor-bottom-left, .isard-popup-anchor-bottom-right {\n flex-direction: column-reverse;\n}\n.isard-popup-anchor-left { flex-direction: row; }\n.isard-popup-anchor-right { flex-direction: row-reverse; }\n.isard-popup-tip { width: 0; height: 0; border: 10px solid transparent; z-index: 1; }\n.isard-popup-anchor-top .isard-popup-tip { align-self: center; border-top: none; border-bottom-color: var(--isard-popup-bg); }\n.isard-popup-anchor-top-left .isard-popup-tip {\n align-self: flex-start; border-top: none; border-left: none; border-bottom-color: var(--isard-popup-bg);\n}\n.isard-popup-anchor-top-right .isard-popup-tip {\n align-self: flex-end; border-top: none; border-right: none; border-bottom-color: var(--isard-popup-bg);\n}\n.isard-popup-anchor-bottom .isard-popup-tip { align-self: center; border-bottom: none; border-top-color: var(--isard-popup-bg); }\n.isard-popup-anchor-bottom-left .isard-popup-tip {\n align-self: flex-start; border-bottom: none; border-left: none; border-top-color: var(--isard-popup-bg);\n}\n.isard-popup-anchor-bottom-right .isard-popup-tip {\n align-self: flex-end; border-bottom: none; border-right: none; border-top-color: var(--isard-popup-bg);\n}\n.isard-popup-anchor-left .isard-popup-tip { align-self: center; border-left: none; border-right-color: var(--isard-popup-bg); }\n.isard-popup-anchor-right .isard-popup-tip { align-self: center; border-right: none; border-left-color: var(--isard-popup-bg); }\n.isard-popup-content {\n position: relative; padding: 12px 14px; border-radius: 4px; background: var(--isard-popup-bg);\n box-shadow: 0 1px 4px rgb(0 0 0 / 0.2); pointer-events: auto; overflow-wrap: break-word;\n}\n.isard-popup-has-close .isard-popup-content { padding-right: 26px; }\n.isard-popup-anchor-top-left .isard-popup-content { border-top-left-radius: 0; }\n.isard-popup-anchor-top-right .isard-popup-content { border-top-right-radius: 0; }\n.isard-popup-anchor-bottom-left .isard-popup-content { border-bottom-left-radius: 0; }\n.isard-popup-anchor-bottom-right .isard-popup-content { border-bottom-right-radius: 0; }\n.isard-popup-close {\n position: absolute; top: 0; right: 0; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 0 4px 0 4px;\n background: transparent; color: inherit; font: 18px/22px system-ui, sans-serif; cursor: pointer;\n}\n.isard-popup-close:hover { background: rgb(0 0 0 / 0.05); }\n.isard-popup-close:focus-visible, .isard-attrib-button:focus-visible, .isard-attrib a:focus-visible {\n outline: 2px solid var(--isard-focus); outline-offset: -2px;\n}\n.isard-attrib {\n display: flex; align-items: center; gap: 4px; padding: 0 5px; border-radius: 4px; background: var(--isard-attrib-bg);\n color: var(--isard-attrib-fg); font: 12px/20px system-ui, sans-serif;\n}\n.isard-ctrl-bottom-right .isard-ctrl.isard-attrib, .isard-ctrl-bottom-left .isard-ctrl.isard-attrib { margin-bottom: 0; }\n.isard-ctrl-bottom-right .isard-ctrl.isard-attrib { margin-right: 0; border-radius: 4px 0 0 0; }\n.isard-ctrl-bottom-left .isard-ctrl.isard-attrib { margin-left: 0; border-radius: 0 4px 0 0; }\n.isard-attrib a { color: inherit; text-decoration: none; }\n.isard-attrib a:hover { text-decoration: underline; }\n.isard-attrib-button {\n display: none; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 12px; flex: none;\n background: var(--isard-ctrl-bg); color: var(--isard-ctrl-fg); cursor: pointer;\n}\n.isard-attrib-button svg { display: block; margin: auto; }\n.isard-ctrl.isard-attrib.isard-attrib-compact { min-height: 24px; padding: 2px; border-radius: 12px; margin: 0 10px 10px; }\n.isard-attrib-compact .isard-attrib-button { display: block; }\n.isard-attrib-compact .isard-attrib-inner { display: none; padding: 0 6px 0 2px; }\n.isard-attrib-compact.isard-attrib-open { background: var(--isard-ctrl-bg); }\n.isard-attrib-compact.isard-attrib-open .isard-attrib-inner { display: block; }\n`;\n\nconst styled = new WeakSet<Document>();\n\n/** Adds the overlay styles to a document, once; first in the head so application rules win at equal specificity */\nexport const injectStyle = (doc: Document): void => {\n if (styled.has(doc)) return;\n styled.add(doc);\n\n const style = doc.createElement('style');\n\n style.dataset.isard = '';\n style.textContent = CSS;\n doc.head.prepend(style);\n};\n"]}
1
+ {"version":3,"file":"style.js","sourceRoot":"","sources":["../../src/ui/style.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,GAAG,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoIX,CAAC;AAEF,MAAM,MAAM,GAAG,IAAI,OAAO,EAAY,CAAC;AAEvC,mHAAmH;AACnH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAa,EAAQ,EAAE;IACjD,IAAI,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC;QAAE,OAAO;IAC5B,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAEhB,MAAM,KAAK,GAAG,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAEzC,KAAK,CAAC,OAAO,CAAC,KAAK,GAAG,EAAE,CAAC;IACzB,KAAK,CAAC,WAAW,GAAG,GAAG,CAAC;IACxB,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC1B,CAAC,CAAC","sourcesContent":["/**\n * Styles of the DOM overlays (markers, popups, controls), injected once per document so the package needs no CSS\n * file. Colors are custom properties, defaults on the root with no specificity: an application restyles them on any\n * element around the map (its container's class may be replaced by a framework: nothing depends on it).\n */\n\nconst CSS = `\n:where(:root) {\n --isard-ctrl-bg: #fff;\n --isard-ctrl-fg: #333;\n --isard-ctrl-hover: rgb(0 0 0 / 0.05);\n --isard-ctrl-active: #1d2433;\n --isard-ctrl-active-fg: #fff;\n --isard-ctrl-border: #ddd;\n --isard-ctrl-shadow: 0 0 0 2px rgb(0 0 0 / 0.1);\n --isard-popup-bg: #fff;\n --isard-popup-fg: #1d2433;\n --isard-marker-color: #3a6fd8;\n --isard-attrib-bg: rgb(255 255 255 / 0.5);\n --isard-attrib-fg: rgb(0 0 0 / 0.75);\n --isard-focus: #3a6fd8;\n}\n.isard-canvas:focus { outline: none; }\n.isard-canvas:focus-visible { outline: 2px solid var(--isard-focus); outline-offset: -2px; }\n.isard-overlay { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }\n.isard-ctrl-top-left, .isard-ctrl-top-right, .isard-ctrl-bottom-left, .isard-ctrl-bottom-right {\n position: absolute; pointer-events: none; z-index: 2;\n}\n.isard-ctrl-top-left { top: 0; left: 0; }\n.isard-ctrl-top-right { top: 0; right: 0; }\n.isard-ctrl-bottom-left { bottom: 0; left: 0; }\n.isard-ctrl-bottom-right { bottom: 0; right: 0; }\n.isard-ctrl { clear: both; pointer-events: auto; transform: translate(0, 0); }\n.isard-ctrl-top-left .isard-ctrl { float: left; margin: 10px 0 0 10px; }\n.isard-ctrl-top-right .isard-ctrl { float: right; margin: 10px 10px 0 0; }\n.isard-ctrl-bottom-left .isard-ctrl { float: left; margin: 0 0 10px 10px; }\n.isard-ctrl-bottom-right .isard-ctrl { float: right; margin: 0 10px 10px 0; }\n.isard-ctrl-group { background: var(--isard-ctrl-bg); border-radius: 4px; box-shadow: var(--isard-ctrl-shadow); }\n.isard-ctrl-group button {\n display: block; width: 29px; height: 29px; padding: 0; margin: 0; border: 0; box-sizing: border-box;\n background: transparent; color: var(--isard-ctrl-fg); cursor: pointer; font: inherit;\n}\n.isard-ctrl-group button + button { border-top: 1px solid var(--isard-ctrl-border); }\n.isard-ctrl-group button:first-child { border-radius: 4px 4px 0 0; }\n.isard-ctrl-group button:last-child { border-radius: 0 0 4px 4px; }\n.isard-ctrl-group button:only-child { border-radius: inherit; }\n.isard-ctrl-group button:hover { background-color: var(--isard-ctrl-hover); }\n.isard-ctrl-group button:focus-visible { outline: 2px solid var(--isard-ctrl-active); outline-offset: -2px; }\n.isard-ctrl-group button.active { background: var(--isard-ctrl-active); color: var(--isard-ctrl-active-fg); }\n.isard-ctrl-group button svg { display: block; margin: auto; pointer-events: none; }\n.isard-ctrl-compass svg { transition: transform 0.05s; }\n.isard-ctrl-scale {\n box-sizing: border-box; padding: 0 5px; border: 2px solid var(--isard-ctrl-fg); border-top: 0;\n background: var(--isard-attrib-bg); color: var(--isard-ctrl-fg); font: 11px/1.4 system-ui, sans-serif; white-space: nowrap;\n}\n.isard-ctrl-search { position: relative; width: 260px; }\n.isard-ctrl-search input {\n box-sizing: border-box; width: 100%; padding: 6px 10px; border: 0; border-radius: 4px; outline: none;\n background: var(--isard-ctrl-bg); color: var(--isard-ctrl-fg); box-shadow: var(--isard-ctrl-shadow); font: 13px system-ui, sans-serif;\n}\n.isard-ctrl-search input:focus-visible { box-shadow: 0 0 0 2px var(--isard-focus); }\n.isard-ctrl-search ul {\n position: absolute; left: 0; right: 0; margin: 4px 0 0; padding: 4px 0; list-style: none; border-radius: 4px;\n background: var(--isard-ctrl-bg); color: var(--isard-ctrl-fg); box-shadow: var(--isard-ctrl-shadow); font: 13px system-ui, sans-serif;\n}\n.isard-ctrl-search li { padding: 5px 10px; cursor: pointer; }\n.isard-ctrl-search li:hover, .isard-ctrl-search li[aria-selected=\"true\"] { background: var(--isard-ctrl-hover); }\n.isard-ctrl-minimap { overflow: hidden; cursor: pointer; border-radius: 4px; box-shadow: var(--isard-ctrl-shadow); background: var(--isard-ctrl-bg); }\n.isard-marker { position: absolute; top: 0; left: 0; pointer-events: auto; will-change: transform; }\n.isard-marker-draggable { cursor: grab; touch-action: none; }\n.isard-marker-dragging { cursor: grabbing; }\n.isard-marker-stem { position: absolute; z-index: -1; width: 2px; margin-left: -1px; transform-origin: top center; background: var(--isard-marker-color); opacity: 0.8; pointer-events: none; }\n.isard-marker-stem::after { content: \"\"; position: absolute; bottom: -3px; left: -2px; width: 6px; height: 6px; border-radius: 50%; background: inherit; }\n.isard-marker-pin { display: block; color: var(--isard-marker-color); filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.35)); }\n.isard-panel { position: absolute; top: 0; left: 0; transform-origin: 0 0; pointer-events: auto; will-change: transform; }\n.isard-popup {\n position: absolute; top: 0; left: 0; display: flex; pointer-events: none; will-change: transform; z-index: 1;\n color: var(--isard-popup-fg);\n}\n.isard-popup-anchor-top, .isard-popup-anchor-top-left, .isard-popup-anchor-top-right { flex-direction: column; }\n.isard-popup-anchor-bottom, .isard-popup-anchor-bottom-left, .isard-popup-anchor-bottom-right {\n flex-direction: column-reverse;\n}\n.isard-popup-anchor-left { flex-direction: row; }\n.isard-popup-anchor-right { flex-direction: row-reverse; }\n.isard-popup-tip { width: 0; height: 0; border: 10px solid transparent; z-index: 1; }\n.isard-popup-anchor-top .isard-popup-tip { align-self: center; border-top: none; border-bottom-color: var(--isard-popup-bg); }\n.isard-popup-anchor-top-left .isard-popup-tip {\n align-self: flex-start; border-top: none; border-left: none; border-bottom-color: var(--isard-popup-bg);\n}\n.isard-popup-anchor-top-right .isard-popup-tip {\n align-self: flex-end; border-top: none; border-right: none; border-bottom-color: var(--isard-popup-bg);\n}\n.isard-popup-anchor-bottom .isard-popup-tip { align-self: center; border-bottom: none; border-top-color: var(--isard-popup-bg); }\n.isard-popup-anchor-bottom-left .isard-popup-tip {\n align-self: flex-start; border-bottom: none; border-left: none; border-top-color: var(--isard-popup-bg);\n}\n.isard-popup-anchor-bottom-right .isard-popup-tip {\n align-self: flex-end; border-bottom: none; border-right: none; border-top-color: var(--isard-popup-bg);\n}\n.isard-popup-anchor-left .isard-popup-tip { align-self: center; border-left: none; border-right-color: var(--isard-popup-bg); }\n.isard-popup-anchor-right .isard-popup-tip { align-self: center; border-right: none; border-left-color: var(--isard-popup-bg); }\n.isard-popup-content {\n position: relative; padding: 12px 14px; border-radius: 4px; background: var(--isard-popup-bg);\n box-shadow: 0 1px 4px rgb(0 0 0 / 0.2); pointer-events: auto; overflow-wrap: break-word;\n}\n.isard-popup-has-close .isard-popup-content { padding-right: 26px; }\n.isard-popup-anchor-top-left .isard-popup-content { border-top-left-radius: 0; }\n.isard-popup-anchor-top-right .isard-popup-content { border-top-right-radius: 0; }\n.isard-popup-anchor-bottom-left .isard-popup-content { border-bottom-left-radius: 0; }\n.isard-popup-anchor-bottom-right .isard-popup-content { border-bottom-right-radius: 0; }\n.isard-popup-close {\n position: absolute; top: 0; right: 0; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 0 4px 0 4px;\n background: transparent; color: inherit; font: 18px/22px system-ui, sans-serif; cursor: pointer;\n}\n.isard-popup-close:hover { background: rgb(0 0 0 / 0.05); }\n.isard-popup-close:focus-visible, .isard-attrib-button:focus-visible, .isard-attrib a:focus-visible {\n outline: 2px solid var(--isard-focus); outline-offset: -2px;\n}\n.isard-attrib {\n display: flex; align-items: center; gap: 4px; padding: 0 5px; border-radius: 4px; background: var(--isard-attrib-bg);\n color: var(--isard-attrib-fg); font: 12px/20px system-ui, sans-serif;\n}\n.isard-ctrl-bottom-right .isard-ctrl.isard-attrib, .isard-ctrl-bottom-left .isard-ctrl.isard-attrib { margin-bottom: 0; }\n.isard-ctrl-bottom-right .isard-ctrl.isard-attrib { margin-right: 0; border-radius: 4px 0 0 0; }\n.isard-ctrl-bottom-left .isard-ctrl.isard-attrib { margin-left: 0; border-radius: 0 4px 0 0; }\n.isard-attrib a { color: inherit; text-decoration: none; }\n.isard-attrib a:hover { text-decoration: underline; }\n.isard-attrib-button {\n display: none; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 12px; flex: none;\n background: var(--isard-ctrl-bg); color: var(--isard-ctrl-fg); cursor: pointer;\n}\n.isard-attrib-button svg { display: block; margin: auto; }\n.isard-ctrl.isard-attrib.isard-attrib-compact { min-height: 24px; padding: 2px; border-radius: 12px; margin: 0 10px 10px; }\n.isard-attrib-compact .isard-attrib-button { display: block; }\n.isard-attrib-compact .isard-attrib-inner { display: none; padding: 0 6px 0 2px; }\n.isard-attrib-compact.isard-attrib-open { background: var(--isard-ctrl-bg); }\n.isard-attrib-compact.isard-attrib-open .isard-attrib-inner { display: block; }\n`;\n\nconst styled = new WeakSet<Document>();\n\n/** Adds the overlay styles to a document, once; first in the head so application rules win at equal specificity */\nexport const injectStyle = (doc: Document): void => {\n if (styled.has(doc)) return;\n styled.add(doc);\n\n const style = doc.createElement('style');\n\n style.dataset.isard = '';\n style.textContent = CSS;\n doc.head.prepend(style);\n};\n"]}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Where the sun stands in the sky: its azimuth and altitude at a place and time, from its ecliptic position (the
3
+ * low-precision formulas of the Astronomical Almanac: within a few hundredths of a degree from 1950 to 2050, far
4
+ * finer than a shadow needs)
5
+ */
6
+ import type { LonLat } from '../types.ts';
7
+ /** The sun's azimuth (degrees clockwise from north) and altitude (degrees above the horizon) at `lonLat` at `date` */
8
+ export declare const sunPosition: (date: Date, [lon, lat]: LonLat) => {
9
+ azimuth: number;
10
+ altitude: number;
11
+ };
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Where the sun stands in the sky: its azimuth and altitude at a place and time, from its ecliptic position (the
3
+ * low-precision formulas of the Astronomical Almanac: within a few hundredths of a degree from 1950 to 2050, far
4
+ * finer than a shadow needs)
5
+ */
6
+ const RAD = Math.PI / 180;
7
+ /** The sun's azimuth (degrees clockwise from north) and altitude (degrees above the horizon) at `lonLat` at `date` */
8
+ export const sunPosition = (date, [lon, lat]) => {
9
+ // Days since J2000.0 (noon on the 1st of January 2000, UTC)
10
+ const d = date.getTime() / 86_400_000 - 10_957.5;
11
+ const g = (357.529 + 0.985_600_28 * d) * RAD;
12
+ const q = 280.459 + 0.985_647_36 * d;
13
+ // Its ecliptic longitude, the obliquity of the ecliptic, then its right ascension and declination
14
+ const l = (q + 1.915 * Math.sin(g) + 0.02 * Math.sin(2 * g)) * RAD;
15
+ const e = (23.439 - 0.000_000_36 * d) * RAD;
16
+ const ra = Math.atan2(Math.cos(e) * Math.sin(l), Math.cos(l));
17
+ const dec = Math.asin(Math.sin(e) * Math.sin(l));
18
+ // Its hour angle at the place, from the sidereal time at Greenwich
19
+ const gmst = 280.460_618_37 + 360.985_647_366_29 * d;
20
+ const h = (gmst + lon) * RAD - ra;
21
+ const phi = lat * RAD;
22
+ const altitude = Math.asin(Math.sin(phi) * Math.sin(dec) + Math.cos(phi) * Math.cos(dec) * Math.cos(h));
23
+ const azimuth = Math.atan2(-Math.sin(h), Math.tan(dec) * Math.cos(phi) - Math.sin(phi) * Math.cos(h));
24
+ return { azimuth: (((azimuth / RAD) % 360) + 360) % 360, altitude: altitude / RAD };
25
+ };
26
+ //# sourceMappingURL=sun.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sun.js","sourceRoot":"","sources":["../../src/util/sun.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,GAAG,GAAG,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC;AAE1B,sHAAsH;AACtH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAU,EAAE,CAAC,GAAG,EAAE,GAAG,CAAS,EAAyC,EAAE;IACnG,4DAA4D;IAC5D,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,UAAU,GAAG,QAAQ,CAAC;IACjD,MAAM,CAAC,GAAG,CAAC,OAAO,GAAG,YAAY,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;IAC7C,MAAM,CAAC,GAAG,OAAO,GAAG,YAAY,GAAG,CAAC,CAAC;IACrC,kGAAkG;IAClG,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAA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,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,EAAE,QAAQ,EAAE,QAAQ,GAAG,GAAG,EAAE,CAAC;AACtF,CAAC,CAAC","sourcesContent":["/**\n * Where the sun stands in the sky: its azimuth and altitude at a place and time, from its ecliptic position (the\n * low-precision formulas of the Astronomical Almanac: within a few hundredths of a degree from 1950 to 2050, far\n * finer than a shadow needs)\n */\n\nimport type { LonLat } from '../types.ts';\n\nconst RAD = Math.PI / 180;\n\n/** The sun's azimuth (degrees clockwise from north) and altitude (degrees above the horizon) at `lonLat` at `date` */\nexport const sunPosition = (date: Date, [lon, lat]: LonLat): { azimuth: number; altitude: number } => {\n // Days since J2000.0 (noon on the 1st of January 2000, UTC)\n const d = date.getTime() / 86_400_000 - 10_957.5;\n const g = (357.529 + 0.985_600_28 * d) * RAD;\n const q = 280.459 + 0.985_647_36 * d;\n // Its ecliptic longitude, the obliquity of the ecliptic, then its right ascension and declination\n const l = (q + 1.915 * Math.sin(g) + 0.02 * Math.sin(2 * g)) * RAD;\n const e = (23.439 - 0.000_000_36 * d) * RAD;\n const ra = Math.atan2(Math.cos(e) * Math.sin(l), Math.cos(l));\n const dec = Math.asin(Math.sin(e) * Math.sin(l));\n // Its hour angle at the place, from the sidereal time at Greenwich\n const gmst = 280.460_618_37 + 360.985_647_366_29 * d;\n const h = (gmst + lon) * RAD - ra;\n const phi = lat * RAD;\n const altitude = Math.asin(Math.sin(phi) * Math.sin(dec) + Math.cos(phi) * Math.cos(dec) * Math.cos(h));\n const azimuth = Math.atan2(-Math.sin(h), Math.tan(dec) * Math.cos(phi) - Math.sin(phi) * Math.cos(h));\n\n return { azimuth: (((azimuth / RAD) % 360) + 360) % 360, altitude: altitude / RAD };\n};\n"]}
@@ -393,6 +393,15 @@ export class Engine {
393
393
  * its info log). The tileset itself is read later: a bad one leaves the layer empty, it does not throw
394
394
  */
395
395
  addTiles3d(url: string, max_error: number, geoid?: boolean | null): number;
396
+ /**
397
+ * An empty layer of vector tiles drawn as geometry: its style layers come with `setVectorSublayers`, its tiles
398
+ * with `setVectorTile`
399
+ *
400
+ * # Errors
401
+ *
402
+ * Throws (to JavaScript) when a shader fails to compile (the error carries its info log)
403
+ */
404
+ addVectorTiles(): number;
396
405
  /**
397
406
  * Longitudes and latitudes the view covers on the ground, `[west, south, east, north]` (degrees): the screen's
398
407
  * border cast on the ground, or on the far plane where it passes the horizon
@@ -510,6 +519,10 @@ export class Engine {
510
519
  * Removes a layer and frees its GPU objects; the other layers forget it (a layer that referred to it)
511
520
  */
512
521
  removeLayer(id: number): void;
522
+ /**
523
+ * Removes tile `key` of a vector tile layer (nothing if there is none)
524
+ */
525
+ removeVectorTile(id: number, key: number): void;
513
526
  /**
514
527
  * Draws a frame: the backdrop, the ground and the layers over it bottom to top, then the panorama and the
515
528
  * viewshed; returns true while tiles are still loading (a new frame will be asked through `redraw`)
@@ -592,10 +605,10 @@ export class Engine {
592
605
  */
593
606
  setFeatureRamp(id: number, rgba: Uint8Array | null | undefined, min: number, max: number): void;
594
607
  /**
595
- * Style of the features of a line, circle, fill or extrusion layer (batch `key` of the latter): 32 floats per
596
- * feature, its color (RGBA 0-1), its second color (a circle's stroke), then two sizes as zoom stops (four zooms,
597
- * four values each): a line's width; a circle's radius and stroke width, CSS pixels; a block's height and base
598
- * height, metres
608
+ * Style of the features of a line, circle, fill, extrusion or vector tile layer (batch or tile `key` of the last
609
+ * two): 32 floats per feature, its color (RGBA 0-1), its second color (a circle's stroke), then two sizes as zoom
610
+ * stops (four zooms, four values each): a line's width; a circle's radius and stroke width, CSS pixels; a block's
611
+ * height and base height, metres
599
612
  */
600
613
  setFeatureStyle(id: number, style: Float32Array, key?: number | null): void;
601
614
  /**
@@ -765,11 +778,22 @@ export class Engine {
765
778
  * Space behind the globe (stars, atmosphere halo), in the globe projection
766
779
  */
767
780
  setSky(enabled: boolean): void;
781
+ /**
782
+ * The sun casting shadows and the night: its azimuth (degrees clockwise from north) and altitude (degrees above
783
+ * the horizon), the shadows' opacity (0 to 1; none under the horizon or not a number), how dark the night is (0 to
784
+ * 1: the frame tinted, the lights of the layers on). Neither shadows nor night: nothing drawn
785
+ *
786
+ * # Errors
787
+ *
788
+ * Throws (to JavaScript) when a WebGL object cannot be created or the pass fails to compile
789
+ */
790
+ setSun(azimuth: number, altitude: number, opacity: number, night: number): void;
768
791
  /**
769
792
  * Shows `layers` on one side of a vertical line only, the others beneath on the other side (comparing two states
770
- * of a place): left of `x` (CSS pixels from the left of the canvas), or right of it; a non-finite `x` stops
793
+ * of a place): left of `x` (CSS pixels from the left of the canvas), or right of it; `others` on the other side
794
+ * only (two meshes of the same place, each on its side, never drawn over each other); a non-finite `x` stops
771
795
  */
772
- setSwipe(x: number, right: boolean, layers: Uint32Array): void;
796
+ setSwipe(x: number, right: boolean, layers: Uint32Array, others: Uint32Array): void;
773
797
  /**
774
798
  * Layer-wide style of a symbol layer: size scale and opacity as zoom stops (four zooms then four values each),
775
799
  * zoom range, visibility
@@ -812,6 +836,44 @@ export class Engine {
812
836
  * for none: it tints the textures and colors the untextured meshes) of a 3D Tiles layer
813
837
  */
814
838
  setTiles3dStyle(id: number, max_error: number, opacity: number, point_size: number | null | undefined, color: Float32Array): void;
839
+ /**
840
+ * The style layers of a vector tile layer, in drawing order: per layer, its kind (0 fill, 1 line, 2 extrusion), its zoom range
841
+ * (two numbers: shown from the first, included, to the second, excluded), whether it shows (0 or 1), its dashes
842
+ * (four numbers: dash, gap, dash, gap, in line widths; 0: solid), its opacity as zoom stops (four zooms then four
843
+ * values; missing: opaque), the caps of its lines' ends (0 butt, 1 round, 2 square; missing: round), whether its
844
+ * lines glow at night (streets; 0 or 1)
845
+ */
846
+ setVectorSublayers(id: number, kinds: Uint8Array, zooms: Float64Array, visible: Uint8Array, dashes: Float32Array, opacities: Float32Array, caps: Uint8Array, lit: Uint8Array): void;
847
+ /**
848
+ * Adds or replaces tile `key` of a vector tile layer ready for the GPU, as the basemap workers make it (the
849
+ * tessellation module): its polygons as for `setVectorTile` (picked here; their prisms built here if drawn in
850
+ * relief while `prism` is false), the vertices of its fills (`shapes::Vertex` as bytes, each with its feature),
851
+ * their triangles, per sublayer its top cap and the rest of its prism (`fill_ranges`: four numbers, first and
852
+ * end of each), its line pieces (`pieces::Piece` as bytes), the line table (feature and length of each line),
853
+ * per sublayer its pieces (`line_ranges`: first, end), the blocks of its extrusion sublayers (`shapes::Block` as
854
+ * bytes), their triangles, per sublayer its blocks' triangles (`block_ranges`: first, end), the extent of its
855
+ * points (`bounds`: min x, min y, max x, max y), `feature_count` features
856
+ *
857
+ * # Errors
858
+ *
859
+ * Throws (to JavaScript) when the vertices, pieces or blocks are cut short, when a WebGL object of the tile cannot be
860
+ * created, or when its features or lines need a table texture past the GPU's `MAX_TEXTURE_SIZE`
861
+ */
862
+ setVectorTileMesh(id: number, key: number, points: Float64Array, ring_start: Uint32Array, polygon_start: Uint32Array, polygon_feature: Uint32Array, fill_start: Uint32Array, vertices: Uint8Array, indices: Uint32Array, fill_ranges: Uint32Array, prism: boolean, pieces: Uint8Array, line_table: Float32Array, line_ranges: Uint32Array, blocks: Uint8Array, block_indices: Uint32Array, block_ranges: Uint32Array, bounds: Float64Array, feature_count: number): void;
863
+ /**
864
+ * Adds or replaces tile `key` of a vector tile layer: its polygons as for `addFills` (`fill_start`: the first
865
+ * polygon of each sublayer, and the end; those of an extrusion sublayer raised into blocks), its lines as for
866
+ * `addLines` (`line_start`: the first line of each sublayer, and the end), `feature_count` features, styled as an
867
+ * extrusion layer's (`setFeatureStyle` with the key: a color, then a line's width or a block's height and base);
868
+ * `tile`: the corners of the tile they are cut to (west, north, east, south; empty: none), along whose edges no
869
+ * wall of a block rises
870
+ *
871
+ * # Errors
872
+ *
873
+ * Throws (to JavaScript) when a WebGL object of the tile cannot be created, or when its features or lines need a
874
+ * table texture past the GPU's `MAX_TEXTURE_SIZE`
875
+ */
876
+ setVectorTile(id: number, key: number, points: Float64Array, ring_start: Uint32Array, polygon_start: Uint32Array, polygon_feature: Uint32Array, fill_start: Uint32Array, line_points: Float64Array, line_first: Uint32Array, line_feature: Uint32Array, line_start: Uint32Array, feature_count: number, tile: Float64Array): void;
815
877
  /**
816
878
  * Shows what can be seen from points, each within its range: `observers` holds 8 numbers per observer
817
879
  * (16 at most): longitude, latitude (degrees), metres above the ground, range (metres), then to look one way
@@ -880,6 +942,12 @@ export class Engine {
880
942
  * A region of the icon atlas: `width` × `height` RGBA texels (premultiplied) at (`x`, `y`)
881
943
  */
882
944
  updateIconAtlas(x: number, y: number, width: number, height: number, data: Uint8Array): void;
945
+ /**
946
+ * Vector tiles (512 CSS pixels across at their level, as `MapLibre`'s) for the view of the last frame (else the
947
+ * camera's), levels `min_z` to `max_z`, three numbers per tile (z, x, y), the nearest to the eye first: what a
948
+ * vector tile layer draws (`addVectorTiles`), coarser far away in a tilted view as the raster layers
949
+ */
950
+ vectorTilesInView(min_z: number, max_z: number): Uint32Array;
883
951
  /**
884
952
  * Tiles a raster layer wants for the view of the last frame, three numbers per tile (z, x, y), the nearest to
885
953
  * the eye first: the level each area of the ground is drawn at, for the labels of a vector style to follow it
@@ -924,6 +992,7 @@ export interface InitOutput {
924
992
  readonly engine_addRaster: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number, number];
925
993
  readonly engine_addSymbols: (a: number) => [number, number, number];
926
994
  readonly engine_addTiles3d: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
995
+ readonly engine_addVectorTiles: (a: number) => [number, number, number];
927
996
  readonly engine_bounds: (a: number) => [number, number];
928
997
  readonly engine_camera: (a: number) => any;
929
998
  readonly engine_clearPanorama: (a: number) => void;
@@ -948,6 +1017,7 @@ export interface InitOutput {
948
1017
  readonly engine_project: (a: number, b: number, c: number, d: number, e: number) => any;
949
1018
  readonly engine_removeExtrusionBatch: (a: number, b: number, c: number) => void;
950
1019
  readonly engine_removeLayer: (a: number, b: number) => void;
1020
+ readonly engine_removeVectorTile: (a: number, b: number, c: number) => void;
951
1021
  readonly engine_render: (a: number) => number;
952
1022
  readonly engine_requestPick: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
953
1023
  readonly engine_resize: (a: number, b: number, c: number, d: number) => void;
@@ -992,12 +1062,16 @@ export interface InitOutput {
992
1062
  readonly engine_setRasterStyle: (a: number, b: number, c: number, d: number) => void;
993
1063
  readonly engine_setRequestHeaders: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
994
1064
  readonly engine_setSky: (a: number, b: number) => void;
995
- readonly engine_setSwipe: (a: number, b: number, c: number, d: number, e: number) => void;
1065
+ readonly engine_setSun: (a: number, b: number, c: number, d: number, e: number) => [number, number];
1066
+ readonly engine_setSwipe: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
996
1067
  readonly engine_setSymbolLayer: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
997
1068
  readonly engine_setSymbols: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => [number, number];
998
1069
  readonly engine_setTerrain: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number];
999
1070
  readonly engine_setTileLoader: (a: number, b: any) => void;
1000
1071
  readonly engine_setTiles3dStyle: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
1072
+ readonly engine_setVectorSublayers: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number) => void;
1073
+ readonly engine_setVectorTile: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number) => [number, number];
1074
+ readonly engine_setVectorTileMesh: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number, c1: number, d1: number, e1: number, f1: number, g1: number, h1: number, i1: number) => [number, number];
1001
1075
  readonly engine_setViewshed: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => [number, number];
1002
1076
  readonly engine_setZoomRange: (a: number, b: number, c: number) => void;
1003
1077
  readonly engine_stats: (a: number) => any;
@@ -1010,6 +1084,7 @@ export interface InitOutput {
1010
1084
  readonly engine_updateGlyphPage: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
1011
1085
  readonly engine_updateGroundTexture: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => [number, number];
1012
1086
  readonly engine_updateIconAtlas: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
1087
+ readonly engine_vectorTilesInView: (a: number, b: number, c: number) => [number, number];
1013
1088
  readonly engine_wantedTiles: (a: number, b: number) => [number, number];
1014
1089
  readonly engine_zoomAt: (a: number, b: number, c: number, d: number) => void;
1015
1090
  readonly wasm_bindgen_2e566c63402fe7fa___convert__closures_____invoke___js_sys_b1e1c29ba6b0e6b3___Function_fn_wasm_bindgen_2e566c63402fe7fa___JsValue_____wasm_bindgen_2e566c63402fe7fa___sys__Undefined___js_sys_b1e1c29ba6b0e6b3___Function_fn_wasm_bindgen_2e566c63402fe7fa___JsValue_____wasm_bindgen_2e566c63402fe7fa___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;