Methane@methane-ui/*
CSS LayoutsComponentsSkillsTheme BuilderGitHub
← All Components

<mth-map-route>

@methane-ui/maps~6.8 KB brotli shell + lazy engine~1.4 KB shell · lazy engine chunk

Route path visualizer computing Haversine distance and interactive bounds fitting across ordered stops.

When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.

Live Interactive Preview

Interactive StageLive Custom Element · <mth-map-route> (@methane-ui/maps)
Ready · interact with <mth-map-route>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/maps/map-route"></script>
<mth-map-route unit="km"></mth-map-route>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
origin—unknown | nullnullStarting route waypoint (lng, lat, optional label).
destination—unknown | nullnullEnding route waypoint (lng, lat, optional label).
waypoints—ReadonlyArray<unknown>—Intermediate ordered route waypoints.
unitunit'km' | 'mi'"km"Distance unit displayed in the summary (km or mi).
labellabelstring""Accessible region label.

Events

EventDetail TypeDescription
mth-route-fit{ bounds: unknown; distanceKm: number }Fired when bounds are fitted across route stops.
mth-waypoint-select{ waypoint: unknown; index: number }Fired when a route stop button is selected.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
Enterbothstop button focusedCenters map on selected route stop

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusFocus ownership matches focusModel="host".lint-plugin & spec-compiler
contrastRenders legible borders, focus outlines, and selection indicators under forced-colors: active.Playwright forced-colors matrix
keyboardImplements all 1 APG keyboard transitions across LTR/RTL.mth-map-route.spec.test.ts
i18nRoutes 9 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test