Location
For a typical street address for a locale, use
{{$location.streetAddress}}
, {{$location.city}}
, {{$location.state}}
, and {{$location.zipCode}}
. Most locales provide localized versions for a specific country.{{$location.latitude}}
and {{$location.longitude}}
, or {{$location.nearbyGPSCoordinateLatitude}}
for a latitude/longitude near a given location.{{$location.country}}
or {{$location.countryCode}}
.buildingNumber
cardinalDirection
Name | Type | Default | Description |
---|---|---|---|
abbreviated | boolean | false | If true this will return abbreviated directions (N, E, etc). Otherwise this will return the long name. |
city
country
countryCode
Name | Type | Default | Description |
---|---|---|---|
variant | 'alpha-2' |'alpha-3' | 'numeric' | 'alpha-2' | The code to return. Can be either 'alpha-2' (two-letter code), 'alpha-3' (three-letter code) or 'numeric' (numeric code). |
direction
Name | Type | Default | Description |
---|---|---|---|
abbreviated | boolean | false | If true this will return abbreviated directions (NW, E, etc). Otherwise this will return the long name. |
latitude
Name | Type | Default | Description |
---|---|---|---|
max | number | 90 | The upper bound for the latitude to generate. |
min | number | -90 | The lower bound for the latitude to generate. |
precision | number | 4 | The number of decimal points of precision for the latitude. |
longitude
Name | Type | Default | Description |
---|---|---|---|
max | number | 90 | The upper bound for the longitude to generate. |
min | number | -90 | The lower bound for the longitude to generate. |
precision | number | 4 | The number of decimal points of precision for the longitude. |
nearbyGPSCoordinate
faker.location.nearbyGPSCoordinate()
method has been refined into two more precise variables:{{$location.nearbyGPSCoordinateLatitude}}
: Generates an Latitude within the specified radius from the given coordinate.{{$location.nearbyGPSCoordinateLongitude}}
: Generates an Longitude within the specified radius from the given coordinate.Name | Type | Default | Description |
---|---|---|---|
isMetric | boolean | false | If true assume the radius to be in kilometers. If false for miles. |
latitude | number | The original latitude to get a new coordinate close to. | |
longitude | number | The original longitude to get a new coordinate close to. | |
radius | number | 10 | The maximum distance from the given coordinate to the new coordinate. |
ordinalDirection
Name | Type | Default | Description |
---|---|---|---|
abbreviated | boolean | false | If true this will return abbreviated directions (NW, SE, etc). Otherwise this will return the long name. |
secondaryAddress
state
ar
locale includes subdivisions from Arabic-speaking countries, such as Tunisia, Algeria, Syria, Lebanon, etc. For historical compatibility reasons, the default en
locale only includes states in the United States (identical to en_US
). However, you can use other English locales, such as en_IN
, en_GB
, and en_AU
, if needed.Name | Type | Default | Description |
---|---|---|---|
abbreviated | boolean | false | If true this will return abbreviated first-level administrative entity names. Otherwise this will return the long name. |
street
streetAddress
Name | Type | Default | Description |
---|---|---|---|
useFullAddress | boolean | When true this will generate a full address. Otherwise it will just generate a street address. | |
timeZone
zipCode
Name | Type | Default | Description |
---|---|---|---|
format | string | WThe optional format used to generate the zip code. This won't be used if the state option is specified. |