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

<mth-map-cluster>

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

Spatial point clustering layer over MapLibre with accessible cluster controls and zoom expansion.

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

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/maps/map-cluster"></script>
<mth-map-cluster radius="48" zoom="4"></mth-map-cluster>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
points—ReadonlyArray<unknown>—Array of spatial cluster points (id, lng, lat, optional label).
radiusradiusnumber48Spatial clustering bucket radius in pixels.
zoomzoomnumber4Initial zoom level used for spatial bucketing.
maxZoommax-zoomnumber18Zoom threshold above which individual points are rendered unclustered.
labellabelstring""Accessible region label.

Events

EventDetail TypeDescription
mth-cluster-expand{ clusterId: string; count: number; center: readonly [number, number]; zoom: number }Fired when a multi-point cluster is expanded.
mth-cluster-select{ point: unknown }Fired when a single point cluster item is activated.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
ArrowLeftltrcluster toolbar focusedMoves focus to previous cluster item
ArrowRightltrcluster toolbar focusedMoves focus to next cluster item
Enterbothcluster item focusedExpands focused cluster or selects point

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-cluster.spec.test.ts
i18nRoutes 5 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test