{# Map Components — MapLibre GL Reusable macros for MapLibre GL map containers (theme-aware popups). ALL maps in Tusk use MapLibre GL (no Leaflet). Macros: map_assets, map_container, map_dark_styles, carto_dark_style Map initialization (new maplibregl.Map) remains in JS files. These macros standardize the container, CDN tags, basemap, and dark theme. #} {% macro map_assets() %} {# MapLibre GL CDN script and CSS tags. Place in {% block extra_head %} or at the top of {% block scripts %}. #} {% endmacro %} {% macro map_container(id, height="100%", extra_classes="", rounded=true) %} {# Container div for a MapLibre instance. Args: id: DOM element ID (used by maplibregl.Map to attach) height: CSS height value (default "100%") extra_classes: Additional CSS classes rounded: Whether to round corners (default true) #}
{% endmacro %} {% macro map_dark_styles() %} {# Token-based CSS for MapLibre popups (follows the app theme). Outputs a {% endmacro %} {% macro carto_dark_style() %} {# Basemap style for `new maplibregl.Map({ style: ... })`. Kept under its historical name; resolves to the configured XYZ provider (Settings → Studio) or OpenFreeMap's keyless vector styles, matching the theme. #} window.tuskBasemapStyle() {% endmacro %}