@maplibre-yaml/core/register
Auto-registration for maplibre-yaml web components
Import this module to automatically register the <ml-map> web component.
import '@maplibre-yaml/core/register';import 'maplibre-gl/dist/maplibre-gl.css';After importing, the <ml-map> element is available in your HTML.
Examples
Section titled “Examples”External YAML file (recommended)
<ml-map src="/configs/my-map.yaml" style="height: 400px;"></ml-map>Inline YAML via script tag
<ml-map style="height: 400px;"> <script type="text/yaml">type: mapid: my-mapconfig: center: [-74.006, 40.7128] zoom: 12 mapStyle: "https://demotiles.maplibre.org/style.json"layers: [] </script></ml-map>JSON config attribute (programmatic)
<ml-map config='{"type":"map","id":"demo",...}'></ml-map>References
Section titled “References”Re-exports MLMap
MLMapErrorDetail
Section titled “MLMapErrorDetail”Re-exports MLMapErrorDetail
MLMapEventMap
Section titled “MLMapEventMap”Re-exports MLMapEventMap
registerMLMap
Section titled “registerMLMap”Re-exports registerMLMap