RegionTypeParameter

RegionTypeParameter

new RegionTypeParameter(optionsopt)

Source:

A parameter that specifies a type of region.

Parameters:
Name Type Attributes Description
options Object <optional>

Object with the following properties:

Properties
Name Type Attributes Description
terria Terria

The Terria instance.

id String

The unique ID of this parameter.

name String <optional>

The name of this parameter. If not specified, the ID is used as the name.

description String <optional>

The description of the parameter.

validRegionTypes Array.<String> <optional>

The region types from which this RegionTypeParameter selects. If this parameter is not specified, all region types known to Terria may be selected.

Extends

Members

_defaultValue

Source:
Inherited From:

Gets the default value for this parameter, or undefined if there is no default value.

availableFormatters

Source:
Inherited From:

Gets the formatters that are available to format the parameter's value.

catalogFunction :CatalogFunction

Source:
Inherited From:

Gets the function to which this is a parameter.

Type:

converter :Any

Source:
Inherited From:

A converter that can be used to convert this parameter for use with a CatalogFunction. The actual type and content of this property is defined by the catalog function.

Type:
  • Any

defaultValue :*

Source:
Inherited From:

Gets the default value for this parameter, or undefined if there is no default value.

Type:
  • *

description :String

Source:
Inherited From:

Gets or sets the description of the parameter.

Type:
  • String

formatter :String

Source:
Inherited From:

Gets or sets the formatter (from the set defined by FunctionParameter#availableFormatters) to use to format this parameter to pass to the CatalogFunction.

Type:
  • String

id :String

Source:
Inherited From:

Gets the ID of the parameter.

Type:
  • String

isLoading :Boolean

Source:
Inherited From:

Gets or sets a value indicating whether the parameter is currently loading. This property is observable.

Type:
  • Boolean

isRequired :Boolean

Source:
Inherited From:
Default Value:
  • false

Gets or sets a value indicating whether this parameter is required.

Type:
  • Boolean

name :String

Source:
Inherited From:

Gets or sets the name of the parameter.

Type:
  • String

terria :Terria

Source:
Inherited From:

Gets the Terria instance associated with this parameter.

Type:

type :String

Source:
Overrides:

Gets the type of this parameter.

Type:
  • String

value

Source:
Overrides:

Gets or sets the current value of this parameter.

Methods

(static) resolveRegionProvider(regionProviderOrParameter) → {RegionProvider}

Source:

Resolves value that may be either a RegionProvider or a RegionTypeParameter to a RegionProvider.

Parameters:
Name Type Description
regionProviderOrParameter RegionProvider | RegionTypeParameter

The region provider or parameter.

Returns:

If regionProviderOrParameter is a RegionProvider, that value is returned. If it is a RegionTypeParameter, the value of the parameter is returned. The return value may be undefined if regionProviderOrParameter is undefined, or if the value of the region type parameter is undefined.

Type
RegionProvider

formatForService(valueopt) → {Any}

Source:
Inherited From:

Formats this value to pass to a service. The format is controlled by the FunctionParameter#formatter property.

Parameters:
Name Type Attributes Description
value Object <optional>

Value to format as string. If not specified, FunctionParameter#value is used.

Returns:

The formatted value.

Type
Any

formatValueAsString(valueopt) → {String}

Source:
Inherited From:

Represents value as string.

Parameters:
Name Type Attributes Description
value Object <optional>

Value to format as string. If not specified, FunctionParameter#value is used.

Returns:

String representation of the value.

Type
String

getAllRegionTypes() → {Promise.<Array.<RegionProvider>>}

Source:

Gets all list of region types that may be selected for this parameter. Also caches the promise in this._regionProviderPromise, and the promise result in this._regionProviderList.

Returns:

[description]

Type
Promise.<Array.<RegionProvider>>

serializeToJson() → {Object}

Source:
Inherited From:

Serializes the data item to JSON.

Returns:

The serialized JSON object-literal.

Type
Object

updateFromJson(json) → {Promise}

Source:
Inherited From:

Updates the function parameter from a JSON object-literal description of it.

Parameters:
Name Type Description
json Object

The JSON description. The JSON should be in the form of an object literal, not a string.

Returns:

A promise that resolves when the update is complete.

Type
Promise