Home > @magiclane/maps-sdk > AddressInfo > format

AddressInfo.format() method

Returns the address formatted as a single, human-readable line.

The method builds a concise, display-friendly address by selecting the relevant address components, trimming whitespace, omitting null or empty values, collapsing adjacent duplicates, and joining the remaining parts with a readable separator (", "). The ordering of components follows a common mailing/display convention.

Signature:

format(options?: {
        excludeFields?: AddressField[];
        includeFields?: AddressField[];
    }): string;

Parameters

Parameter

Type

Description

options

{ excludeFields?: AddressField[]; includeFields?: AddressField[]; }

(Optional)

options properties:

Returns:

string