Examples
Documentation
Map props
Parameters accepted by {#include components/maps/map lng="..." lat="..." /}. For
markers or GeoJSON overlays, use phaMap({...}) directly in
x-data as in the examples above.
| Name | Type | Default | Description |
|---|---|---|---|
id
|
String | — | DOM id on the root; omit unless something else references the map. |
lng / lat /
zoom
|
String (number) | — | Initial center coordinates and zoom level. |
style
|
String | — |
Tile style preset — light or dark (CARTO), or
OpenStreetMap by default.
|
height
|
String (CSS length) | — | Fixed height for the map container. |
navigationControl / scaleControl /
fullscreenControl
|
String (boolean) | navigation only | Which MapLibre controls to mount. |
Usage
Required assets. MapLibre v6 ships as ESM only, so the host page needs the module shim from the
examples: a type="module" script importing
/web/vendor/maplibre/maplibre-gl.mjs, assigning
window.maplibregl, and firing the maplibre-ready event —
plus maplibre-gl.css, map.css and the
map.js Alpine factory.