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

<mth-map-draw>

@methane-ui/maps~7.9 KB brotli shell + lazy engine~2.0 KB shell · lazy engine chunk

Interactive GeoJSON drawing surface supporting points, lines, polygons, keyboard drawing, and undo/redo.

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-draw> (@methane-ui/maps)
Ready · interact with <mth-map-draw>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/maps/map-draw"></script>
<mth-map-draw mode="select"></mth-map-draw>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
modemode'select' | 'point' | 'line' | 'polygon'"point"Active drawing mode (select, point, line, polygon).
features—unknown—Current GeoJSON FeatureCollection.
labellabelstring""Accessible region label.
disableddisabledbooleanfalseDisables toolbar controls and drawing input.

Events

EventDetail TypeDescription
mth-draw-change{ features: unknown }Fired when features are added, undone, redone, or cleared.
mth-draw-mode{ mode: unknown }Fired when the active drawing mode changes.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
ArrowLeftltrtoolbar focusedMoves focus to previous tool
ArrowRightltrtoolbar focusedMoves focus to next tool
Enterbothtool focusedActivates focused drawing tool

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 3 APG keyboard transitions across LTR/RTL.mth-map-draw.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(disabled).Conformance suite
i18nRoutes 12 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test