@nika-js/onlymap 0.11.10 → 0.12.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.
- package/CHANGELOG.md +5 -0
- package/README.md +10 -4
- package/dist/attribute-resolution.d.ts +2 -0
- package/dist/{basemap-Cc8v5hPA.js → basemap-CtDse0mW.js} +1328 -1263
- package/dist/basemap-request.d.ts +24 -0
- package/dist/basemap.d.ts +41 -1
- package/dist/cartograph.js +362 -321
- package/dist/cartograph.standalone.js +1995 -1914
- package/dist/{cityjson-k-z1r6c0.js → cityjson-DMc_dwu1.js} +1 -1
- package/dist/{crs-BzE_KP4M.js → crs-D5FyQfEu.js} +74 -7
- package/dist/{crs-ChglCB3O.js → crs-ZdDBJ2EY.js} +39 -36
- package/dist/data-layer.d.ts +36 -3
- package/dist/elements/om-map.d.ts +2 -1
- package/dist/geoparquet-BTHYX1ET.js +30 -0
- package/dist/geoparquet.d.ts +6 -7
- package/dist/{globe-view-BF6-01N_.js → globe-view-KrKNOmVs.js} +11 -11
- package/dist/hillshade-CijRdYyU.js +209 -0
- package/dist/html-data.d.ts +1 -1
- package/dist/{ifc-DXwePQRv.js → ifc-sisRo7I7.js} +1 -1
- package/dist/{index-CwoqJ6IK.js → index-21KGElDr.js} +9 -9
- package/dist/{index-C9gVsJaG.js → index-A45DtXly.js} +18 -18
- package/dist/{index-Dk12Fazj.js → index-BPa2CC8T.js} +20 -20
- package/dist/{index-CCY7Rk1s.js → index-B_Vhebf7.js} +1 -1
- package/dist/{index-C_0KCx9L.js → index-Bfocr1_A.js} +106 -106
- package/dist/{index-Bwdaim-c.js → index-DMc81n9B.js} +14362 -13782
- package/dist/{index-CawlYDgE.js → index-DS6VUGi6.js} +11 -11
- package/dist/{index-BaR4MzNc.js → index-DoGY-Vgi.js} +3 -3
- package/dist/{index-T5LATpR7.js → index-eHYe06mM.js} +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/ir.d.ts +6 -0
- package/dist/layer-registry.d.ts +21 -0
- package/dist/layers/warped-bitmap-layer.d.ts +27 -0
- package/dist/{lerc-CElHRqrE.js → lerc-DjrPALEj.js} +1 -1
- package/dist/onlymap.standalone.js +53028 -52451
- package/dist/onlymapjs.js +86 -84
- package/dist/parse-manifest.d.ts +12 -9
- package/dist/{post-process-effect-VAE0lQ4c.js → post-process-effect-Be1qa2DD.js} +5 -5
- package/dist/programmatic.d.ts +12 -0
- package/dist/projection.d.ts +44 -1
- package/dist/{raster-pipeline-D26Sl0X2.js → raster-pipeline-DspBYxwc.js} +1 -1
- package/dist/{raster-Cn8jugd2.js → raster-zC3qXBrs.js} +3 -3
- package/dist/react/om-layer.d.ts +4 -0
- package/dist/react/om-map.d.ts +2 -0
- package/dist/react.js +225 -218
- package/dist/runtime-core.d.ts +24 -0
- package/dist/source-crs.d.ts +99 -0
- package/dist/{text-on-path-C6SLSkus.js → text-on-path-D0_URrD2.js} +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/{zarr-Do5FzYXm.js → zarr-DopOhzfY.js} +2 -2
- package/docs/basemaps.md +1 -1
- package/docs/cartograph.md +2 -2
- package/docs/cartography.md +106 -1
- package/llms.txt +2 -1
- package/onlymapjs.attributes.json +2 -0
- package/onlymapjs.html-data.json +26 -4
- package/package.json +1 -1
- package/skills/onlymapjs/SKILL.md +5 -3
- package/skills/onlymapjs/references/syntax.md +18 -3
- package/dist/geoparquet-B9p5-Yxf.js +0 -35
- package/dist/hillshade-Dd7MQHfp.js +0 -298
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-request shaping for basemap tiles — the one hook between the MapLibre
|
|
3
|
+
* map and the tile servers it fetches from.
|
|
4
|
+
*
|
|
5
|
+
* OpenStreetMap's own tile server (`osm`) refuses requests it cannot tie to a
|
|
6
|
+
* website or an application, and a page opened from disk sends it nothing it
|
|
7
|
+
* recognises: no Referer, and in Firefox an `Origin: null`. The refusal is a
|
|
8
|
+
* 256×256 "Access blocked" image delivered with HTTP 200 — an exported map in
|
|
9
|
+
* Firefox drew a grid of them, and Chrome drew the same grid for any request
|
|
10
|
+
* carrying `Cache-Control: no-cache` (a hard reload, DevTools' "Disable
|
|
11
|
+
* cache"). Measured 2026-10-08 against the live server from `file://` pages.
|
|
12
|
+
*
|
|
13
|
+
* OSM's Blocked page names the workaround for referer-less contexts: an
|
|
14
|
+
* `X-Requested-With` header. Their CORS policy allows it explicitly (the
|
|
15
|
+
* preflight answers `access-control-allow-headers: x-requested-with`), and
|
|
16
|
+
* with it every variant above gets the real tile. Scoped to OSM's host only:
|
|
17
|
+
* a custom header makes browsers preflight every tile request, which other
|
|
18
|
+
* tile servers need not allow.
|
|
19
|
+
*/
|
|
20
|
+
/** Extra request parameters for a basemap resource, or undefined to send it as is. */
|
|
21
|
+
export declare function basemapRequestParameters(url: string): {
|
|
22
|
+
url: string;
|
|
23
|
+
headers: Record<string, string>;
|
|
24
|
+
} | undefined;
|
package/dist/basemap.d.ts
CHANGED
|
@@ -45,13 +45,23 @@ export declare class MapLibreBasemapAdapter {
|
|
|
45
45
|
*/
|
|
46
46
|
private initialized;
|
|
47
47
|
private loadCallbacks;
|
|
48
|
+
/**
|
|
49
|
+
* Globe view (docs/design/globe.md). MapLibre draws the sphere and the
|
|
50
|
+
* overlay follows: @deck.gl/mapbox reads MapLibre's projection and switches
|
|
51
|
+
* deck to its GlobeView. The projection lives in MapLibre's STYLE, so every
|
|
52
|
+
* `setStyle` (a basemap switch) resets it to Mercator; `style.load`
|
|
53
|
+
* re-applies it.
|
|
54
|
+
*/
|
|
55
|
+
private globe;
|
|
56
|
+
/** The tilt ceiling the flat map had before the globe flattened it — restored when the globe turns off. */
|
|
57
|
+
private flatMaxPitch?;
|
|
48
58
|
constructor(container: HTMLElement, resolved: ResolvedBasemap, initialView: {
|
|
49
59
|
longitude: number;
|
|
50
60
|
latitude: number;
|
|
51
61
|
zoom: number;
|
|
52
62
|
pitch?: number;
|
|
53
63
|
bearing?: number;
|
|
54
|
-
}, deckProps: DeckProps, showAttribution?: boolean, attributionHost?: HTMLElement, deterministic?: boolean);
|
|
64
|
+
}, deckProps: DeckProps, showAttribution?: boolean, attributionHost?: HTMLElement, deterministic?: boolean, globe?: boolean);
|
|
55
65
|
/**
|
|
56
66
|
* whenSettled's basemap gate (issue #37 follow-up), as an EVENT LATCH
|
|
57
67
|
* rather than a polling predicate: MapLibre's `idle` event is its own
|
|
@@ -182,9 +192,39 @@ export declare class MapLibreBasemapAdapter {
|
|
|
182
192
|
* back, while a controller maximum simply refuses to go further.
|
|
183
193
|
*/
|
|
184
194
|
setMaxPitch(maxPitch: number | null): void;
|
|
195
|
+
/**
|
|
196
|
+
* A globe is flat-on and north-up (docs/design/globe.md). MapLibre's globe
|
|
197
|
+
* tilts and rotates, but deck's GlobeView has neither pitch nor bearing: a
|
|
198
|
+
* tilted globe drew deck's layers up to 13 px off the basemap at zoom 4 and
|
|
199
|
+
* dropped some entirely (e2e/globe.spec.ts). So while the globe is on, the
|
|
200
|
+
* controller refuses tilt and rotation and the camera levels out.
|
|
201
|
+
*/
|
|
202
|
+
private applyCameraLimits;
|
|
185
203
|
/** Floor how far the user can zoom out. Null restores MapLibre's own minimum. */
|
|
186
204
|
setMinZoom(minZoom: number | null): void;
|
|
187
205
|
isLoaded(): boolean;
|
|
206
|
+
/** Live globe switch — MapLibre changes projection in place; camera and deck layers survive. */
|
|
207
|
+
setGlobe(globe: boolean): void;
|
|
208
|
+
isGlobe(): boolean;
|
|
209
|
+
private applyProjection;
|
|
210
|
+
/**
|
|
211
|
+
* Is a ground point hidden on the far side of the globe? Always false on a
|
|
212
|
+
* flat map. MapLibre answers this itself (`transform.isLocationOccluded`),
|
|
213
|
+
* but on its internal transform — and maplibre-gl is a caret range, not an
|
|
214
|
+
* exact pin — so a geometric fallback stands behind it: a visible point
|
|
215
|
+
* survives a project → unproject round trip, a far-side one comes back as
|
|
216
|
+
* the near-side point under the same pixel.
|
|
217
|
+
*/
|
|
218
|
+
private isOccluded;
|
|
219
|
+
/**
|
|
220
|
+
* Is this screen pixel on the planet? Always true on a flat map. A globe
|
|
221
|
+
* zoomed out has SPACE around it, and MapLibre's unproject still answers a
|
|
222
|
+
* pixel there — with a point on the limb — so a click in space would report
|
|
223
|
+
* a coordinate it never touched. Same internal-with-fallback shape as
|
|
224
|
+
* isOccluded: the fallback re-projects the answer and checks it lands back
|
|
225
|
+
* on the pixel.
|
|
226
|
+
*/
|
|
227
|
+
private isOnSurface;
|
|
188
228
|
getViewport(): ViewportLike;
|
|
189
229
|
getViewState(): BasemapViewState;
|
|
190
230
|
/** Instant recenter/rezoom — the basemap's own camera jump, no deck viewState involved. */
|