{"name":"prefab-map","title":"Map","kind":"prefab","status":"available","summary":"Embeddable vector map: markers, popups, GeoJSON overlays, light/dark/grayscale themes, click/fly-to/pan-and-zoom. Real OpenStreetMap-derived roads, water, and towns worldwide, up to zoom 10 anywhere on Earth - no external tile host or API key, no CSP change, mandatory OSM/Protomaps attribution. The basemap is served on demand over ranged CDN fetches, like a shared image or model asset, not downloaded in full by every prototype that uses it.","spec":"prefab-map@0.1.6","version":"0.1.6","versions":["0.1.6","0.1.5","0.1.4","0.1.3","0.1.2","0.1.1","0.1.0"],"license":"MIT","source":"prototir","sizeKB":3639992,"requires":["maplibre-gl"],"permissions":[],"flags":{"wasm":false,"streamed":true},"compatibility":"Desktop and mobile browsers with WebGL. Worldwide coverage up to zoom 10; tiles stream from the Prototir CDN as the player explores.","install":{"manifest":"{\n  \"modules\": [\n    \"prefab-map@0.1.6\"\n  ]\n}","importFrom":"prefab-map"},"example":"import { createMap } from 'prefab-map';\n\nconst map = await createMap({\n  theme: 'dark',\n  markers: [{ lngLat: [-0.1278, 51.5074], popup: 'London' }]\n});","api":[{"heading":"createMap(options)","entries":[{"signature":"container, mount = document.body","description":"Your own element, or a new one added to `mount`."},{"signature":"center = [10, 25], zoom = 1.6, maxZoom = 10","description":"Starting view as [longitude, latitude]. Zoom is capped at the basemap detail, 10."},{"signature":"theme: 'light' | 'dark' | 'grayscale'","description":"Basemap style."},{"signature":"markers: [{ lngLat, color?, popup?, id? }]","description":"Markers added when the map loads. popup is HTML."},{"signature":"geojson: [{ id?, data, type = 'fill', paint?, filter? }]","description":"GeoJSON overlays drawn as MapLibre layers."},{"signature":"onLoad(map), onClick(event), onMoveEnd({ center, zoom })","description":"Map events."}]},{"heading":"The returned map","entries":[{"signature":"addMarker(marker) / removeMarker(id)","description":"Returns the marker id."},{"signature":"addGeoJSON(overlay)","description":"Adds or updates an overlay by id."},{"signature":"setTheme(theme)","description":"Switches style and keeps your overlays."},{"signature":"map","description":"The MapLibre map, for anything else."},{"signature":"destroy()","description":"Removes the map."}]}],"notes":["Place and road names are not drawn yet. OpenStreetMap and Protomaps attribution is always shown."],"upstreamDocs":null,"labs":[]}