Constructor
new Location(loc)
Constructor.
Name | Type | Description |
---|---|---|
loc | module:domain~Location | | the location to copy properties from |
- Source
Extends
Members
country :string
An ISO 3166-1 alpha-2 character country code.
- string
- Source
elevation :number
The elevation above sea level, in meters.
- number
- Source
id :number
A SolarNetwork assigned unique identifier.
- number
- Source
latitude :number
The decimal world latitude.
- number
- Source
locality :string
Get the locality (city, town).
- string
- Source
longitude :number
The decimal world longitude.
- number
- Source
name :string
A generalized name, can be used for "virtual" locations.
- string
- Source
postalCode :string
A country-specific postal code.
- string
- Source
props :object
The object that all properties are stored on.
- object
- Overrides
- Source
region :string
A country-specific regional identifier.
- string
- Source
stateOrProvince :string
A country-specific state or province identifier.
- string
- Source
street :string
The street address.
- string
- Source
timeZoneId :string
A time zone ID, for example Pacific/Auckland
.
- string
- Source
Methods
prop(key, newValueopt) → {*}
Get, set, or remove a property value.
Name | Type | Attributes | Description |
---|---|---|---|
key | string | the key to get or set the value for | |
newValue | * | <optional> | if defined, the new value to set for the given |
- Overrides
- Source
if called as a getter, the associated value for the given key
, otherwise this object
- Type:
- *
properties(newPropsopt) → {object}
Get, set, or remove multiple properties.
Name | Type | Attributes | Description |
---|---|---|---|
newProps | object | <optional> | the new values to set; if any value is |
- Overrides
- Source
if called as a getter, all properties of this object copied into a simple object; otherwise this object
- Type:
- object
toUriEncoding(propertyNameopt, callbackFnopt) → {string}
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.
Name | Type | Attributes | 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 |
- Overrides
- Source
the URI encoded string
- Type:
- string
toUriEncodingWithSorting(sortsopt, paginationopt, propertyNameopt, callbackFnopt) → {string}
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.
Name | Type | Attributes | 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 |
- Source
the URI encoded string
- Type:
- string