Class: Location

domain~ Location

A geographic location.


new Location(loc)

Constructor.

Extends:
Parameters:
Name Type Description
loc module:domain~Location | object

the location to copy properties from

Extends

Members


country :string

An ISO 3166-1 alpha-2 character country code.

Type:
  • string

elevation :number

The elevation above sea level, in meters.

Type:
  • number

id :number

A SolarNetwork assigned unique identifier.

Type:
  • number

latitude :number

The decimal world latitude.

Type:
  • number

locality :string

Get the locality (city, town).

Type:
  • string

longitude :number

The decimal world longitude.

Type:
  • number

name :string

A generalized name, can be used for "virtual" locations.

Type:
  • string

postalCode :string

A country-specific postal code.

Type:
  • string

props :object

The object that all properties are stored on.

Type:
  • object
Inherited From:

region :string

A country-specific regional identifier.

Type:
  • string

stateOrProvince :string

A country-specific state or province identifier.

Type:
  • string

street :string

The street address.

Type:
  • string

timeZoneId :string

A time zone ID, for example Pacific/Auckland.

Type:
  • string

Methods


prop(key [, newValue])

Get, set, or remove a property value.

Parameters:
Name Type Argument Description
key string

the key to get or set the value for

newValue * <optional>

if defined, the new value to set for the given key; if null then the key property will be removed

Inherited From:
Returns:

if called as a getter, the associated value for the given key, otherwise this object

Type
*

properties( [newProps])

Get, set, or remove multiple properties.

Parameters:
Name Type Argument Description
newProps object <optional>

the new values to set; if any value is null that property will be deleted

Inherited From:
Returns:

if called as a getter, all properties of this object copied into a simple object; otherwise this object

Type
object

toUriEncoding( [propertyName] [, callbackFn])

Get this object as a standard URI encoded (query parameters) string value.

All enumerable properties of the props property will be added to the result. If any property value is an array, the values of the array will be joined by a comma. Any module:util~Enum values will have their name property used. Any value that has a toUriEncoding() function property will have that function invoked, passing the associated property name as the first argument, and the returned value will be used.

Parameters:
Name Type Argument Description
propertyName string <optional>

an optional object property prefix to add to all properties

callbackFn function <optional>

An optional function that will be called for each property. The function will be passed property name and value arguments, and must return either null to skip the property, a 2-element array with the property name and value to use, or anything else to use the property as- is.

Inherited From:
Returns:

the URI encoded string

Type
string

toUriEncodingWithSorting( [sorts] [, pagination] [, propertyName] [, callbackFn])

Get this object as a standard URI encoded (query parameters) string value with sorting and pagination parameters.

This calls module:util~PropMap#toUriEncoding first, then encodes the sorts and pagination parameters, if provided.

Parameters:
Name Type Argument Description
sorts Array.<module:domain~SortDescriptor> <optional>

optional sort settings to use

pagination module:domain~Pagination <optional>

optional pagination settings to use

propertyName string <optional>

an optional object property prefix to add to all properties

callbackFn function <optional>

An optional function that will be called for each property. The function will be passed property name and value arguments, and must return either null to skip the property, a 2-element array with the property name and value to use, or anything else to use the property as- is.

Inherited From:
Returns:

the URI encoded string

Type
string