Skip to main content

Map Address Facet

Map Address Facet lets visitors search an address or ZIP code through the OME LocationIQ proxy. It stores the selected label, latitude, longitude, and provider ID on the component root, then combines with a same-target Map Radius Facet to emit a geo_radius value.

Required Setup

  • Configure a LocationIQ token in OME settings.
  • Store latitude and longitude meta on each result post.
  • Use the same target ID on Map Address Facet, Map Radius Facet, Map Facet, and Facet Target.
  • Set matching latitude and longitude meta keys on the address and map components.

Props

GroupPropDefaultMeaning
SettingstargetemptyShared target ID.
SettingsplaceholderSearch address...Placeholder text shown inside the address input.
Settingsminimum_query_length3Number of characters required before lookup starts.
Settingsdebounce_ms300Delay before address lookup requests are sent.
Settingsclear_aria_labelClear addressAccessible name for the clear button inside the address input.
Querylat_meta_keylatitudeMeta key used for result latitude values.
Querylng_meta_keylongitudeMeta key used for result longitude values.
Stylingclassome-map-address-facet-defaultRoot wrapper class.
Stylinginput_classome-map-address-facet-default__inputThe search input.
Stylingclear_button_classome-map-address-facet-default__clearThe inline ✕ clear button.
Stylingresults_classome-map-address-facet-default__resultsThe results list.
Stylingresult_item_classome-map-address-facet-default__resultEach result item (applied by the runtime).
Stylingstatus_classome-map-address-facet-default__statusThe status region.
Stylingresults_host_classome-map-address-facet-default__hostThe floating results host overlay.

Preview

The Map Address Facet ships an Etch-builder preview mode so you can design the results dropdown and clear button before live geocoding is wired up.

GroupPropDefaultMeaning
Previewshow_resultstrueIn Etch: render two sample addresses into the results list.
Previewshow_clear_buttontrueIn Etch: render the clear ✕ visibly (no selection required).

Runtime Behavior

Typing opens geocode suggestions. Selecting a suggestion filters the target when a radius is selected, centers the paired map, fits the selected radius, and draws the radius circle. Clearing the address clears the radius filter and removes the map circle.

The public ome:map-address-change event exposes the selected human-readable address or null. The Facet Events API includes a complete recipe for adding that address as saddr to authored Map POI direction links before Map consumes refreshed selected content.

Clear button

When an address is selected, an inline ✕ icon appears at the right edge of the input. Clicking it clears the selection, the input value, and the cached results list. The icon's accessible name is configurable via settings.clear_aria_label.

Selection clears results

Selecting an address from the dropdown closes the dropdown immediately and clears the cached results. The dropdown cannot reappear until a new query is typed.