Address

NZ address autocomplete (LINZ + OpenStreetMap) with overseas manual-entry fallback. Proxies API keys server-side for security.

NZ Address (Autocomplete)

Start typing an NZ address below. The component queries a server-side proxy that blends LINZ street addresses and OpenStreetMap POIs (or returns mock data when no API key is configured).

Overseas Address (Manual)

Interact with an address field to see output...
PHP

PHP PHP Methods (Fluent)

Method / PropertyParametersDescription
$m->address($id)stringCreate an address component.
->suggestUrl($url)stringServer-side proxy URL for address suggestions.
->mode($mode)stringInitial mode: nz (autocomplete) or overseas (manual).
->namePrefix($prefix)stringPrefix for hidden field names (default: component ID).

JS JS Methods

Method / PropertyParametersDescription
m.address(id, opts)string, ?objectGet or create address instance.
setMode(mode)stringSwitch between nz and overseas.
clear()Clear all address fields.

JS JS Options

Method / PropertyParametersDescription
minCharsintMinimum characters before triggering autocomplete (default: 3).
debounceMsintDebounce delay in milliseconds (default: 250).
suggestUrlstringOverride the proxy URL for address suggestions.
onChangefunction(data)Called when an address is selected or mode changes.

EVENT Events

Event NameDetailDescription
m:address:mode{mode}Fired when the address mode changes between NZ and overseas.
m:address:select{suggestion, ...fields}Fired when an NZ address suggestion is selected.