PATTERN: Map Canvas (consumer-only)
COMPOSES: map-pin (pin markers), caller-supplied SVG canvas
Wrapper for the providers Map view. Provides absolute-positioned controls (Map/Satellite toggle top-left,
zoom +/- bottom-right), a pin overlay layer, optional selected-school popover, and attribution footer.
Height is controlled by the caller — pass style="--map-height: Npx" or a size utility on the root element.
Pins and the popover are placed by data: --pin-x / --pin-y percentages, never an inline
left / top.
Anatomy: map-canvas (root) wraps an SVG terrain canvas, a map-canvas-toggle strip (top-left), and map-canvas-zoom buttons (bottom-right).
<div class="map-canvas" style="--map-height: 400px"> … </div>
Pins: map-canvas-pins overlay layer (pointer-events:none) with child map-pin spans.
Pin positions are data (server-rendered lat/lng → percentages), passed as
style="--pin-x: 30%; --pin-y: 35%"; the pattern CSS turns them into left/top and lands the pin tip on the point.
Popover: map-canvas-popover (white card with shadow) + map-canvas-popover-arrow (downward triangle).
The top/left inline styles are data-driven (which pin is selected), not presentational.
<div class="map-canvas-popover" style="--pin-x: 8%; --pin-y: 20%"> … <div class="map-canvas-popover-arrow"></div></div>
Attribution: map-canvas-attribution — bottom-right, 10px neutral ink, 85% white bg, 2px radius. Mimics the Google Maps attribution strip.
<div class="map-canvas-attribution">Map data ©2025 · Terms of Use</div>