{"_id":"@facilitronworks/react-native-windows-maps","name":"@facilitronworks/react-native-windows-maps","dist-tags":{"latest":"0.1.0-pre.0"},"versions":{"0.1.0-pre.0":{"name":"@facilitronworks/react-native-windows-maps","version":"0.1.0-pre.0","description":"The app-agnostic half of a react-native-windows map: Web Mercator projection maths, and a builder for the maplibre-gl page that renders inside a WebView2 island. Zero runtime dependencies.","main":"src/index.ts","types":"src/index.ts","source":"src/index.ts","react-native":"src/index.ts","sideEffects":false,"keywords":["react-native","react-native-windows","windows","maps","maplibre","mercator","webview2","projection","new-architecture"],"repository":{"type":"git","url":"git+https://github.com/FacilitronWorks/react-native-windows-maps.git"},"license":"MIT","peerDependencies":{"maplibre-gl":"^4.7.1"},"peerDependenciesMeta":{"maplibre-gl":{"optional":true}},"publishConfig":{"access":"public"},"_id":"@facilitronworks/react-native-windows-maps@0.1.0-pre.0","gitHead":"2ee9c766cbb773e5d6c23a581da2b56cdae98c1e","bugs":{"url":"https://github.com/FacilitronWorks/react-native-windows-maps/issues"},"homepage":"https://github.com/FacilitronWorks/react-native-windows-maps#readme","_nodeVersion":"24.7.0","_npmVersion":"11.5.1","dist":{"integrity":"sha512-HvRQVvUjYtqnV7nfG+ZUq+Dxy93DwZjUDZtqJptpYvKajy+YTJ1zfZQfo3BAHLDYUH4db92ROwXoDu1Esn6kRw==","shasum":"8165902b16d0142f329a5a9b0c6bcf68f1659d2f","tarball":"https://registry.npmjs.org/@facilitronworks/react-native-windows-maps/-/react-native-windows-maps-0.1.0-pre.0.tgz","fileCount":6,"unpackedSize":23672,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDNlmjaZKapjc2P4G5uDq6PHIrsCe3rxK1Vfut14d2I0AiBaodZPGYsleOaZsHjrM5xjukB3pIe8v4Kl77SYpfABtA=="}]},"_npmUser":{"name":"faithfulaudio","email":"collindanielschneide@gmail.com"},"directories":{},"maintainers":[{"name":"faithfulaudio","email":"collindanielschneide@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/react-native-windows-maps_0.1.0-pre.0_1787606941321_0.8341631276384798"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-24T21:29:01.106Z","0.1.0-pre.0":"2026-08-24T21:29:01.468Z","modified":"2026-08-24T21:29:01.737Z"},"maintainers":[{"name":"faithfulaudio","email":"collindanielschneide@gmail.com"}],"description":"The app-agnostic half of a react-native-windows map: Web Mercator projection maths, and a builder for the maplibre-gl page that renders inside a WebView2 island. Zero runtime dependencies.","homepage":"https://github.com/FacilitronWorks/react-native-windows-maps#readme","keywords":["react-native","react-native-windows","windows","maps","maplibre","mercator","webview2","projection","new-architecture"],"repository":{"type":"git","url":"git+https://github.com/FacilitronWorks/react-native-windows-maps.git"},"bugs":{"url":"https://github.com/FacilitronWorks/react-native-windows-maps/issues"},"license":"MIT","readme":"# @facilitronworks/react-native-windows-maps\n\nThe app-agnostic half of a [react-native-windows](https://github.com/microsoft/react-native-windows)\nmap surface: Web Mercator projection maths, and a builder for the maplibre-gl HTML page that renders\ninside a WebView2 island.\n\n**Zero runtime dependencies.** Both modules are pure TypeScript with no imports.\n\n## What this is not\n\nThis package deliberately does **not** ship a `<MapView>` component or any basemap style resolution.\n\nStyle resolution reads `EXPO_PUBLIC_*` environment variables, and `babel-preset-expo` only inlines\nthose for files **outside** `node_modules`. A resolver living in this package would silently read\n`''` in every build: the map would fall back to raw OSM tiles and the dark-mode toggle would inject a\nbyte-identical style, doing nothing, with no error and no failing test. The host app owns styling and\npasses the resolved style in.\n\n## Usage\n\n```ts\nimport {\n  buildMapPage,\n  projectToViewport,\n  regionToZoom,\n  viewportToRegion,\n  type LatLng,\n  type Region,\n} from '@facilitronworks/react-native-windows-maps';\n```\n\n`buildMapPage(options)` returns a complete HTML document. Render it in a WebView that injects\n`window.ReactNativeWebView.postMessage` **before** content load.\n\n### Bridge protocol\n\npage → host, via `window.ReactNativeWebView.postMessage`:\n\n| message | meaning |\n| --- | --- |\n| `{type:'ready'}` | maplibre constructed, first style loaded |\n| `{type:'viewport', center, zoom, css}` | on every move and on resize |\n| `{type:'press', coordinate}` | single click on the map surface |\n| `{type:'markerPress', id}` | an in-page marker element was clicked |\n| `{type:'error', message}` | script / style / tile failure |\n\nhost → page, via `injectJavaScript` against `window.__worksMap`:\n\n| call | meaning |\n| --- | --- |\n| `setRegion({center, zoom}, durationMs)` | camera move (`0` = jump) |\n| `setStyle(styleJsonOrUrl)` | appearance change |\n| `setMarkers(list)` | replace the in-page marker layer |\n\n### Markers render in the page, not over it\n\nOn react-native-windows the WebView2 island composites above **all** react-native content within its\nbounds, regardless of sibling order or `zIndex` (verified against three independent layering\nstrategies). An RN overlay can therefore never be seen. The host still computes clusters and owns\nevery handler; the page only draws the bubbles it is handed via `setMarkers` and reports presses\nback. Each entry is plain data — `{id, latitude, longitude, kind:'cluster'|'pin', label, bg, fg,\nborder, size}` — themed by the host.\n\n## maplibre-gl is pinned by version and SRI\n\nThe page loads maplibre-gl from unpkg pinned by version **and** by `sha384` subresource integrity.\n`MAPLIBRE_JS_SRI` / `MAPLIBRE_CSS_SRI` are the hashes of the exact artifacts in `maplibre-gl@4.7.1`.\nA tampered or substituted file fails the check, the script does not execute, and the page reports\n`{type:'error'}` so the host can fall back.\n\n`maplibre-gl` is declared as an **optional peer dependency** so a host on a different version gets an\ninstall-time signal. If you bump it, the two SRI constants must be regenerated in the same change or\nthe map loads nothing.\n\n## Platform\n\nCorrect only under the `windows` platform, where Metro redirects `react-native` to\n`react-native-windows`.\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-faec7359555b7dca34e231d55df34d29"}