← All Components
<mth-location-picker>
Form-associated geographic coordinate picker (lat,lng) with keyboard nudging and validation.
When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.
Live Interactive Preview
Ready · interact with <mth-location-picker>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/maps/location-picker"></script>
<mth-location-picker step="0.01"></mth-location-picker>import '@methane-ui/maps/location-picker';
import '@methane-ui/react';
export function Example() {
return <mth-location-picker step="0.01"></mth-location-picker>;
}<script setup lang="ts">
import '@methane-ui/maps/location-picker';
</script>
<template>
<mth-location-picker step="0.01"></mth-location-picker>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/maps/location-picker';
import { MthLocationPickerDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthLocationPickerDirective],
template: `<mth-location-picker step="0.01"></mth-location-picker>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/maps/location-picker';
import MthLocationPicker from '@methane-ui/svelte/MthLocationPicker.svelte';
</script>
<MthLocationPicker step="0.01"></MthLocationPicker>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
name | name | string | "" | Form field name. |
value | value | string | "" | Selected lat,lng string value. |
defaultValue | default-value | string | "" | Default reset lat,lng string value. |
label | label | string | "" | Accessible field label. |
step | step | number | 0.01 | Keyboard and button coordinate nudge step in degrees. |
required | required | boolean | false | Marks a coordinate selection as required. |
disabled | disabled | boolean | false | Disables interaction and form submission. |
readOnly | readonly | boolean | false | Prevents changing the coordinate value. |
Events
| Event | Detail Type | Description |
|---|---|---|
input | undefined | Native composed event fired when coordinate changes. |
change | undefined | Native composed event fired when coordinate commits. |
mth-location-select | { lat: number; lng: number; value: string } | Fired with parsed lat, lng, and formatted value. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| ArrowLeft | ltr | pin target focused | Nudges longitude west |
| ArrowRight | rtl | pin target focused | Nudges longitude west in RTL |
| ArrowUp | both | pin target focused | Nudges latitude north |
| ArrowDown | both | pin target focused | Nudges latitude south |
| Delete | both | pin target focused | Clears the selected coordinate |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|---|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | delegatesFocus: true with zero host internals.role (ADR-014). | lint-plugin & spec-compiler |
| contrast | Renders legible borders, focus outlines, and selection indicators under forced-colors: active. | Playwright forced-colors matrix |
| keyboard | Implements all 5 APG keyboard transitions across LTR/RTL. | mth-location-picker.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(disabled), :state(readonly), :state(invalid), :state(dirty), :state(touched). | Conformance suite |
| i18n | Routes 11 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |