Global

Members

_bumpyTerrainProvider

Source:

A terrain provider used when ViewerMode === ViewerMode.CesiumTerrain

_terrain

Source:

The terrain provider currently being used - can be either a bumpy terrain provider or a smooth EllipsoidTerrainProvider

activeTimeColumnNameIdOrIndex :String|Integer|Array.<String>|Array.<Integer>|undefined

Source:

Gets or sets the active time column name, id or index. If you pass an array of two such, eg. [0, 1], treats these as the start and end date column identifiers.

Type:
  • String | Integer | Array.<String> | Array.<Integer> | undefined

allFeaturesAvailablePromise :Promise

Source:

Gets or sets a promise that indicates, when it resolves, that all picked features are available in the {@see PickedFeatures#features} array.

Type:
  • Promise

allShareKeys

Source:

All keys that have historically been used to resolve this member - the current uniqueId + past shareKeys.

barHeightMax :Number

Source:
Default Value:
  • 130

Gets or sets the maximum height of the whole color bar, unless very many items.

Type:
  • Number

barHeightMin :Number

Source:
Default Value:
  • 30

Gets or sets the minimum height of the whole color bar.

Type:
  • Number

barLeft :Number

Source:
Default Value:
  • 5

Gets or sets the spacing to the left of the color bar.

Type:
  • Number

barTop :Number

Source:
Default Value:
  • 5

Gets or sets the spacing between the title and color bar.

Type:
  • Number

categoryName :String

Source:

Name of the category for this set of points., eg. the source catalog item.

Type:
  • String

color :String

Source:

CSS color code for this set of points.

Type:
  • String

computeScreenSpacePosition :SelectionIndicatorViewModel~ComputeScreenSpacePosition

Source:
Default Value:
  • SceneTransforms.wgs84ToWindowCoordinates

Gets or sets the function for converting the world position of the object to the screen space position.

Type:
  • SelectionIndicatorViewModel~ComputeScreenSpacePosition
Example
selectionIndicatorViewModel.computeScreenSpacePosition = function(position, result) {
    return Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position, result);
};

config :Object

Source:

Contains configuration information retrieved from the server. The attributes are defined by TerriaJS-Server but include: version: current version of server proxyAllDomains: whether all domains can be proxied allowProxyFrom: array of domains that can be proxied maxConversionSize: maximum size, in bytes, of files that can be uploaded to conversion service newShareUrlPrefix: if defined, the share URL service is active shareUrlPrefixes: object defining share URL prefixes that can be resolved additionalFeedbackParameters: array of additional feedback parameters that can be used

Type:
  • Object

cssClass :String

Source:

Gets or sets the CSS class that will be applied to the legend when it is displayed. This is used to ensure that the correct font is used when measuring text for word wrapping.

Type:
  • String

(constant) CustomComponents

Source:

A store of registered custom component types, eg. .

(constant) Description

Source:

CatalogItem description.

direction :Cartesian3

Source:

Gets the look direction of the camera in the Earth-centered Fixed frame.

Type:
  • Cartesian3

error :String

Source:

Gets or sets a message describing an error that occurred while picking features. If this property is undefined, no error occurred.

Type:
  • String

extent :Rectangle

Source:

Gets a Rectangle covering the extent of the data, based on lat & lon columns. (It could be based on regions too eventually.)

Type:
  • Rectangle

extent :Rectangle

Source:

Gets a Rectangle covering the extent of the data, based on lat & lon columns. (It could be based on regions too eventually.)

Type:
  • Rectangle

featureClicked :CesiumEvent

Source:

Gets or sets an event that is raised when a feature is clicked on the Leaflet map.

Type:
  • CesiumEvent

featureMousedown :CesiumEvent

Source:

Gets or sets an event that is raised when a mousedown event occurs on the Leaflet map.

Type:
  • CesiumEvent

features :Array.<Entity>

Source:

Gets or sets the array of picked features. The array is observable and may be updated up until the point that {@see PickedFeatures#allFeaturesAvailablePromise} resolves.

Type:
  • Array.<Entity>

gradientColorMap :ColorMap

Source:

Gets or sets a color map used to draw a smooth gradient instead of discrete color boxes.

Type:

hasAddress :Boolean

Source:

Gets a flag which states whether this data has address data.

Type:
  • Boolean

hasChildren :Boolean

Source:

Gets a value indicating whether this item has child items.

Type:
  • Boolean

hasChildren :Boolean

Source:

Gets a value indicating whether this item has child items.

Type:
  • Boolean

hasChildren :Boolean

Source:

Gets a value indicating whether this item has child items. If your subclass can return true, it must also define isOpen & items properties, and a toggleOpen function.

Type:
  • Boolean

hasChildren :Boolean

Source:

Gets a value indicating whether this item has child items.

Type:
  • Boolean

hasLatitudeAndLongitude :Boolean

Source:

Gets a flag which states whether this data has latitude and longitude data.

Type:
  • Boolean

id :String

Source:

Unique id for this set of points.

Type:
  • String

infoWithoutSources

Source:

A filtered view of CatalogMember#info that excludes info items that divulge details about the data's source, as determined by CatalogMember#__sourceInfoItemNames.

isLoading :Boolean

Source:

Gets or sets a value indicating whether the list of picked features is still loading.

Type:
  • Boolean

isVisible :Boolean

Source:

Gets the visibility of the position indicator. This can be false even if an object is selected, when the selected object has no position.

Type:
  • Boolean

itemHeight :Number

Source:
Default Value:
  • the smaller of `props.barHeightMax / props.items.length` and 30.

Gets or sets the forced height of each color box. Better to leave unset.

Type:
  • Number

itemHeightMin :Number

Source:
Default Value:
  • 12

Gets or sets the asbolute minimum height of each color box, overruling barHeightMax.

Type:
  • Number

items :Array.<Object>

Source:

Gets or sets the list of items, ordered from bottom to top, with properties:

  • color: CSS color description,
  • lineColor: CSS color description,
  • multipleColors: An array of CSS color descriptions. A grid of these colors will be displayed in the box to the left of the item label.
  • title: label placed level with middle of box
  • titleAbove: label placed level with top of box
  • titleBelow: label placed level with bottom of box
  • imageUrl: url of image that will be drawn instead of a coloured box
  • imageWidth, imageHeight: image dimensions
  • spacingAbove: adds to itemSpacing for this item only.
Type:
  • Array.<Object>

items :Array.<CatalogItem>

Source:

Gets the list of items that we are "now viewing". It is recommended that you use the methods on this instance instead of manipulating the list of items directly. This property is observable.

Type:

itemSpacing :Number

Source:
Default Value:
  • 0

Gets or sets the gap between each pair of color boxes.

Type:
  • Number

itemWidth :Number

Source:
Default Value:
  • 30

Gets or sets the width of each color box (and hence, the color bar)

Type:
  • Number

legendUrl :String

Source:

Gets a URL for the legend for this data.

Type:
  • String

legendUrl :String

Source:

Gets a URL for the legend for this data.

Type:
  • String

map :L.map

Source:

Gets or sets the Leaflet map.

Type:
  • L.map

name :String

Source:

Name for this set of points.

Type:
  • String

onClick :function

Source:

Click handler (called with (x, y) in data units) if some special behaviour is required on clicking.

Type:
  • function

pickPosition :Cartesian3

Source:

Gets or sets the ground position that was picked, if any.

Type:
  • Cartesian3

point :Object

Source:

A selected point from the array above. Used internally by charting functions for hover/clicking functionality.

Type:
  • Object

points :Array.<Object>

Source:

The array of points. Each point should have the format {x: X, y: Y}.

Type:
  • Array.<Object>

position :Cartesian3

Source:

Gets or sets the world position of the object for which to display the selection indicator.

Type:
  • Cartesian3

position :Cartesian3

Source:

Gets the position of the camera in the Earth-centered Fixed frame.

Type:
  • Cartesian3

prevBoundsType

Source:

A variable to store what sort of bounds our leaflet map has been looking at 0 = a normal extent 1 = zoomed in close to the east/left of anti-meridian 2 = zoomed in close to the west/right of the anti-meridian When this value changes we'll need to recompute the location of our points to help them wrap around the anti-meridian

Proj4Definitions :Object

Source:

Defines the built-in proj4 projection definitions known to TerriaJS. Additional projections can be added to this object literal.

Type:
  • Object

rectangle :Rectangle

Source:

Gets the rectangular extent of the view. If CameraView#position, CameraView#direction, and CameraView#up are specified, this property will be ignored for viewers that support those parameters (e.g. Cesium). This property must always be supplied, however, for the benefit of viewers that do not understand these parameters (e.g. Leaflet).

Type:
  • Rectangle

regionDetails :Array.<Object>

Source:

Once loaded, gets the region details (an array of "regionDetail" objects, with regionProvider, columnName and disambigColumnName properties). By checking if defined, can be used as the region-mapping equivalent to "hasLatitudeAndLongitude".

Type:
  • Array.<Object>

selectedIndex :Integer

Source:

The selected index which you might somehow highlight on your chart

Type:
  • Integer

shareKeyIndex :Object

Source:

A flat index of all catalog member in this catalog by their share keys. Because items can have multiple share keys to preserve backwards compatibility, multiple entries in this index will lead to the same catalog member.

Type:
  • Object

showAll :Boolean

Source:
Default Value:
  • true

Request that the chart be scaled so that this series can be shown entirely.

Type:
  • Boolean

showSelection :Boolean

Source:

Gets or sets the visibility of the selection indicator.

Type:
  • Boolean

supportsIntervals :Boolean

Source:

Gets a value indicating whether this ImageryLayerCatalogItem supports the ImageryLayerCatalogItem#intervals property for configuring time-dynamic imagery.

Type:
  • Boolean

supportsIntervals :Boolean

Source:

Gets a value indicating whether this ImageryLayerCatalogItem supports the ImageryLayerCatalogItem#intervals property for configuring time-dynamic imagery.

Type:
  • Boolean

supportsIntervals :Boolean

Source:

Gets a value indicating whether this ImageryLayerCatalogItem supports the ImageryLayerCatalogItem#intervals property for configuring time-dynamic imagery.

Type:
  • Boolean

(constant) Title

Source:

Handles the drawing of the chart title, which may be a string or a legend.

(constant) Tooltip

Source:

Handles the drawing of the chart tooltip, which shows the values of the selected data in a legend.

type :String

Source:

Chart type. If you want these points to be rendered with a certain way. Leave empty for auto detection.

Type:
  • String

units :String

Source:

Units of this set of points.

Type:
  • String

up :Cartesian3

Source:

Gets the up vector direction of the camera in the Earth-centered Fixed frame.

Type:
  • Cartesian3

variableNameLeft :Number

Source:
Default Value:
  • 5

Gets or sets the horizontal offset of variable title.

Type:
  • Number

variableNameTop :Number

Source:
Default Value:
  • 17

Gets or sets the vertical offset of variable title.

Type:
  • Number

ViewerMode

Source:

Identifies the map viewer mode to use.

width :Number

Source:
Default Value:
  • 310

Gets or sets the forced total width of the legend.

Type:
  • Number

yAxisMax :String

Source:

Maximum value for y axis to display, overriding maximum value in data.

Type:
  • String

yAxisMin :String

Source:

Minimum value for y axis to display, overriding minimum value in data.

Type:
  • String

Methods

addBoundingBox(requestData, rectangle)

Source:

Adds a bounding box filter to the search query for elastic search. This simply modifies requestData and returns nothing.

Parameters:
Name Type Description
requestData object

Request data to modify

rectangle Rectangle

rectangle to source the bounding box from.

addMarker()

Source:

Adds a location marker to the map with the position supplied in the result, adding a data source to terria if one hasn't already been added, and removing all previously added markers in that data source. This data source is stored in terria.locationMarker.

addUserCatalogMember(terria, newCatalogItemOrPromise, optionsopt) → {Promise}

Source:

Adds a user's catalog item or group to the catalog.

Parameters:
Name Type Attributes Description
terria Terria

The Terria instance to contain the catalog member.

newCatalogItemOrPromise CatalogItem | Promise

The catalog member to add, or a promise for a catalog member.

options Object <optional>

An object with the following members:

Properties
Name Type Attributes Default Description
enable Boolean <optional>
true

True to enable the newly-added member if it is an item; otherwise, false.

open Boolean <optional>
true

True to open the newly-added member if it is a group; otherwise, false.

zoomTo Boolean <optional>
true

True to zoom and use the clock of the newly-added member if it is an item; otherwise, false.

Returns:

A promise that resolves to the catalog item when loaded successfully, or to a TerriaError if loading fails. The TerriaError is reported by raising Terria#error prior to resolving. The promise never rejects.

Type
Promise

animateTimer(radius, interval, elapsedTimeElement, backgroundElement)

Source:

Runs the timer animation, making an arc fill from 0 to 100% of the circle.

Parameters:
Name Type Attributes Default Description
radius number

Radius of timer.

interval number

Timer duration in seconds.

elapsedTimeElement DOMElement

SVG path containing the elapsed time "pie".

backgroundElement DOMElement

SVG path containing the background circle.

options.deltaOpacity number <optional>
0.5

Change in opacity when fading in and out timer.

options.opacityAnimationInterval number <optional>
3

How long fade in/out lasts in seconds.

options.minOpacity number <optional>
0.1

When fading out, doesn't let opacity go below minOpacity.

options.elapsed number <optional>
0

How much time has already passed.

arcFactory(radius)

Source:

Returns a function that returns a string representing the svg path of an arc.

Parameters:
Name Type Description
radius number

arrayProduct(pools) → {Array.<Array>}

Source:

Find the "product" of a set of arrays, equivalent to the python one-liner: list(itertools.product(*pools)). Eg. [[a,b,c], [d], [e,f]] => [[a,d,e], [a,d,f], [b,d,e], [b,d,f], [c,d,e], [c,d,f]].

Parameters:
Name Type Description
pools Array.<Array>

The arrays of arrays.

Returns:

The product of the arrays.

Type
Array.<Array>

buildEmptyAccumulator()

Source:

Builds an empty accumulator object - each location for custom elements will have an empty array in the return object

buildRequestData(searchTerm, maxResults)

Source:

Builds the data to be POSTed to elastic search.

Parameters:
Name Type Description
searchTerm string

The plain-text query to search for.

maxResults number

The max number of results to search for.

Source:

Builds a share link that reflects the state of the passed Terria instance.

Parameters:
Name Type Attributes Description
terria

The terria instance to serialize.

viewState ViewState <optional>

The viewState to read whether we're viewing the catalog or not

options Object <optional>

Options for building the share link.

Properties
Name Type Attributes Default Description
includeStories Boolean <optional>
true

True to include stories in the share link, false to exclude them.

Returns:

A URI that will rebuild the current state when viewed in a browser.

Type
String
Source:

Like buildShareLink, but shortens the result using Terria#urlShortener.

Returns:

A promise that will return the shortened url when complete.

Type
Promise.<String>

calculateFinishDatesFromStartDates(startJulianDates, localDefaultFinalDurationSecondsopt, shaveSecondsopt, finalEndJulianDateopt) → {Array.<JulianDate>}

Source:
Parameters:
Name Type Attributes Description
startJulianDates Array.<JulianDate>

An array of start dates.

localDefaultFinalDurationSeconds Number <optional>

The duration to use if there is only one date in the list. Defaults to defaultFinalDurationSeconds.

shaveSeconds Number <optional>

Subtract this many seconds from the end dates so they don't overlap (defaults to zero). If duration < 20 * shaveSeconds, use 5% of duration.

finalEndJulianDate JulianDate <optional>

If present, use this for the final end date.

Returns:

An array of end dates which correspond to the array of start dates.

Type
Array.<JulianDate>

canShorten(terria) → {Boolean}

Source:

Is it currently possible to generate short URLs?

Parameters:
Name Type Description
terria Object

The Terria object.

Returns:
Type
Boolean

ChartData(pointsopt, parametersopt)

Source:

A container to pass data to a d3 chart: a single series of data points. For documentation on the custom tag, see lib/Models/registerCustomComponentTypes.js.

Parameters:
Name Type Attributes Description
points Array.<Object> <optional>

The array of points. Each point should have the format {x: X, y: Y}. Defaults to [].

parameters Object <optional>

Further parameters.

Properties
Name Type Attributes Description
id String <optional>

Unique id for this set of points.

categoryName String <optional>

Name of the category for this set of points., eg. the source catalog item.

name String <optional>

Name for this set of points.

units String <optional>

Units of this set of points.

color String <optional>

CSS color code for this set of points.

yAxisMin Number <optional>

Minimum value for y axis to display, overriding minimum value in data.

yAxisMax Number <optional>

Maximum value for y axis to display, overriding maximum value in data.

type String <optional>

Chart type. If you want these points to be rendered with a certain way. Leave empty for auto detection.

onClick function <optional>

Click handler (called with (x, y) in data units) if some special behaviour is required on clicking.

showAll Boolean <optional>

Request that the chart be scaled so that this series can be shown entirely.

ColorMap(param)

Source:

A one-dimensional scale of colours used to visually represent a numerical value. Implemented as an Array of {color, offset} objects, where the first object has an offset of 0, the last has an offset of 1, and the others are ordered in between. It can be instantiated directly from three formats:

  • String, eg. 'red-black'
  • Array of strings, eg. ['red', 'black']
  • Array of objects with the properties 'color' and 'offset', eg. [{color: 'red', offset: 0}, ...].
Parameters:
Name Type Description
param String | Array.<String> | Array.<Object>

combineData(array) → {Array.<Number>|Array.<Date>}

Source:

Combines two data arrays, each with the format [[x1, y1], [x2, y2], ...] maintaining the order of the x's. The x and y can be anything with order (integers, floats, dates, etc)

Parameters:
Name Type Description
array Array

Array of arrays, eg. [[[x1, y1], [x2, y2]], [[a1, b1], [a2, b2]]]

Returns:

Combined array.

Type
Array.<Number> | Array.<Date>

combineFilters(filters) → {function}

Source:

Combines a number of functions that return a boolean into a single function that executes all of them and returns true only if all them do. Maintains an set of filter functions, so if the same function is combined more than once, it is only executed one time. This means that it is also safe to call combineFilter on its own result to combine the result with another filter - the set of filters from the previous result will simply be merged into that of the new result so that only individual filter functions are executed.

Parameters:
Name Type Description
filters Array

A number of functions to combine into one logical function.

Returns:

The resulting function.

Type
function

combineRepeated(sortedJulianDateOrValueArrays, firstColumnTypeopt) → {Array.<Array>}

Source:
Parameters:
Name Type Attributes Description
sortedJulianDateOrValueArrays Array.<Array>

The array of arrays of values to combine. These must be sortedByFirst. Dates must be JulianDates.

firstColumnType Integer <optional>

Eg. VarType.TIME.

Returns:

The values, with any repeats in the first column combined into one. Dates are converted to ISO8601 string representation.

Eg. var x = [['a', 'b', 'b', 'c'], [1, 2, undefined, 3], [4, undefined, 5, undefined]]; combineRepeated(x);

x is [['a', 'b', 'c'], [1, 2, 3], [4, 5, undefined]].

Type
Array.<Array>

combineValueArrays(valueArrays) → {Array.<Array>}

Source:

Create combined arrays from arrays of column values, eg. [[values1, values2, values3], [values4, values5]]. The first columns of each array must be of the same type (in the above example, values1 and values4). These are combined and sorted into a single column. Then the subsequent columns are added, filling with null where missing. (This could be an option in future.) Eg. if the values of each col are: values1=[1,3]; values2=[10,30]; values3=[100,300]; values4=[1,2]; values5=[-1,-2]; then the resulting array of column values are, in order, [1,2,3]; [10,null,30]; [100,null,300]; [-1,-2,null].

Parameters:
Name Type Description
valueArrays Array.<Array>

See description above.

Returns:

The synthesized values which could be passed to a table structure.

Type
Array.<Array>

computeRingWindingOrder(ring) → {WindingOrder}

Source:

Determine the winding order of a polygon ring. See https://github.com/mapbox/vector-tile-spec/tree/master/2.0#4344-polygon-geometry-type && https://en.wikipedia.org/wiki/Shoelace_formula

Parameters:
Name Type Description
ring Array.<Point>

The polygon ring as an array of '@mapbox/point-geometry' Points (or any points conforming to {x: number, y: number}).

Returns:

The winding order of the polygon ring.

Type
WindingOrder

containsAny(s, possibleStrings) → {Boolean}

Source:

Determins is a given string contains any of a number of possible strings.

Parameters:
Name Type Description
s String

The string to test.

possibleStrings Array.<String>

The possible strings to test s for.

Returns:

true if s contains any of the strings in possibleStrings; otherwise, false.

Type
Boolean

convertLuceneHit(locational, item)

Source:

Converts from the Lucene schema to a neater one better suited to addresses.

Parameters:
Name Type Description
locational boolean

Whether to set locational to true - this is set for results that came up within the bounding box passed to #geoCode.

item object

The lucene schema object to convert.

convertToDates(tableColumn) → {Object}

Source:

Simple check to try to guess date format, based on max value of first position. If dates are consistent with US format, it will use US format (mm-dd-yyyy).

Parameters:
Name Type Description
tableColumn TableColumn

The column.

Returns:

Object with keys: subtype: The identified subtype, or undefined. jsDates: The values as javascript dates. julianDates: The values as JulianDates.

Type
Object

correctEntityHeight()

Source:

Gets the most detailed height from terrainProvider at currentCartographicPosition and updates entity position. It starts querying at levelHint and makes its way down to level zero.

createCatalogItemFromFileOrUrl(terria, fileOrUrl, dataTypeopt, confirmConversionopt) → {Promise}

Source:

Asynchronously creates and loads a catalog item for a given file. The returned promise does not resolve until the catalog item is successfully loaded, and it rejects if the file is not in the expected format or another error occurs during loading. If the OGR-based conversion service needs to be invoked to convert the file or URL to a compatible format, the user

Parameters:
Name Type Attributes Default Description
terria Terria

The Terria instance in which to create the item.

fileOrUrl File | String

The file or URL for which to create a catalog item.

dataType String <optional>
'auto'

The type of catalog item to create. If 'auto', the type is deduced from the URL or filename. If 'other', the OGR-based conversion service is used. This can also be any valid catalog item CatalogItem#type.

confirmConversion Boolean <optional>
true

If true, and the OGR-based conversion service needs to be invoked, the user will first be asked for permission to upload the file to the conversion service. If false, the user will not be asked for permission. If the user denies the request, the promise will be rejected with the string 'The user declined to use the conversion service.'.

Returns:

A promise that resolves to the created catalog item.

Type
Promise

createCatalogItemFromUrl(url, terria, allowLoad) → {CatalogMember}

Source:

Creates a type derived from CatalogMember based on a given URL.

Parameters:
Name Type Description
url String

The derived type name.

terria Terria

The Terria instance.

allowLoad Boolean

Whether it's ok to attempt to load the URL and detect failures. We generally do this for WMS type services, but not for local files.

Returns:

The constructed data item or promise, or undefined if the URL is not supported.

Type
CatalogMember

createCatalogMemberFromType(type, terria)

Source:

Creates a type derived from CatalogMember based on a given type string.

Parameters:
Name Type Description
type String

The derived type name.

terria Terria

The Terria instance.

createLeafletCredit(attribution) → {String}

Source:

A convenient function for handling leaflet credit display

Parameters:
Name Type Description
attribution Credit

the original attribution object for leaflet to display as text or link

Returns:

The sanitized HTML for the credit.

Type
String

createParameterFromType(type, options)

Source:

Creates a type derived from FunctionParameter based on a given type string.

Parameters:
Name Type Description
type String

The derived type name.

options Object

Options to pass to the constructor.

createRegexDeserializer(fieldName) → {function}

Source:

Deserializes a regex like ".foo" into a case-insensitive regex /.foo/i.

Parameters:
Name Type Description
fieldName String

The name of the field to serialize.

Returns:

The deserialization function.

Type
function

createRegexSerializer(fieldName) → {function}

Source:

Serializes a regex like /.foo/i into ".foo".

Parameters:
Name Type Description
fieldName String

The name of the field to serialize.

Returns:

The deserialization function.

Type
function

createTimer(radius, containerId, elapsedTimeClass, backgroundClass)

Source:

Adds a new timer to the DOM. Call updateTimer() to make it start animating.

Parameters:
Name Type Description
radius number

Radius of timer.

containerId string

The id of the element to insert the timer into.

elapsedTimeClass string

A class for styling the animation that fills the timer as it runs.

backgroundClass string

A class for styling the timer's background circle.

d3Sync(parent, arrayData, childElementTagName, updateCallBack, transition)

Source:

Convenience wrapper that manages D3's enter/exit mechanics to synchronise an array of data with DOM elements.

Parameters:
Name Type Description
parent Element

HTML element which will contain the nodes

arrayData Array.<Object>

Data to be synchronised.

childElementTagName String

Name of HTML element to be created for each data point.

updateCallBack function

Function called with (d3object, isNewElement). If it returns the d3object, an opacity transition will be applied.

transition Boolean

Parameter passed to d3.transition().

deIndexWithDescendants(items, index)

Source:

Removes all passed items to the passed index, and all the children of those items recursively.

Parameters:
Name Type Description
items Array.<CatalogMember>
index Object

determineChartType(chartData)

Source:
Parameters:
Name Type Description
chartData ChartData

ChartData object for which chart type needs to be determined.

disposeSubscription(component)

Source:

Disposes of all subscriptions that a component currently has.

Parameters:
Name Type Description
component

The component to find and dispose subscriptions on.

EarthGravityModel1996(gridFileUrl)

Source:

The Earth Gravity Model 1996 (EGM96) geoid.

Parameters:
Name Type Description
gridFileUrl String

The URL of the WW15MGH.DAC file.

extendLoad(catalogMember, f)

Source:

Extends a catalog member's load method with another, potentially asynchronous. load function. The catalog member will not be fully loaded until both the original and the new load return and their promises resolve.

Parameters:
Name Type Description
catalogMember CatalogMember

The catalog member for which to extend the loading process.

f function

The additional load function. This function will be called with this set to the catalogMember.

featureDataToGeoJson(featureData) → {Object}

Source:

Converts feature data, such as from a WMS GetFeatureInfo or an Esri Identify, to GeoJSON. The set of feature data formats supported by this function can be extended by adding to featureDataToGeoJson#supportedFormats.

Parameters:
Name Type Description
featureData Object

The feature data to convert to GeoJSON.

Returns:

The GeoJSON representation of this feature data, or undefined if it cannot be converted to GeoJSON.

Type
Object

findKeyForGroupElement()

Source:

Finds the associated key string for the grouping element provided - e.g. a

flattenCatalog() → {Array}

Source:

Takes the hierarchy of serialized catalog members returned by serializeToJson and flattens it into an Array.

Returns:
Type
Array

formatDate(d, localeopt) → {string}

Source:

Formats a date according to the locale if provided, otherwise in a dd/mm/yyyy format.

Parameters:
Name Type Attributes Description
d Date

the date to format

locale Locale <optional>

the locale to use for formatting

Returns:

A formatted date.

Type
string

formatDateTime(d, localeopt) → {string}

Source:

Combines #formatDate and #formatTime.

Parameters:
Name Type Attributes Description
d Date

the date to format

locale Locale <optional>

the locale to use for formatting

Returns:

A formatted date and time with a comma separating them.

Type
string

formatNumberForLocale(number, optionsopt)

Source:

Format the number using the locale format. When Intl is not available (includes Safari), applies commas to separate thousands, eg. 912345.6789 => '912,345.6789'. Nulls are returned as an empty string, not 0.

Parameters:
Name Type Attributes Description
number Number

The number to format.

options Object <optional>

A subset of the options of Javascript's Intl NumberFormat, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString . Note we default useGrouping to false (not true) and maximumFractionDigits to 20 (not 3).

Properties
Name Type Attributes Description
useGrouping Boolean <optional>

A flag for whether to separate thousands. Defaults to false.

minimumFractionDigits Integer <optional>

Minimum number of decimal places. Defaults to 0.

maximumFractionDigits Integer <optional>

Maximum number of decimal places. Defaults to 20.

style String <optional>

Pass 'percent' to format 0.83 as 83%.

formatPropertyValue(value, optionsopt)

Source:

Format the value for the description, used by the Feature Info Panel. Strings have markdown applied to them. Anything else is returned as-is.

Parameters:
Name Type Attributes Description
value

The value to format.

options Object <optional>

Number formatting options, passed to formatNumberForLocale.

formatTime(d, localeopt) → {string}

Source:

Formats the time according to the locale if provided, otherwise in a hh:mm:ss format.

Parameters:
Name Type Attributes Description
d Date

the date to format

locale Locale <optional>

the locale to use for formatting

Returns:

A formatted time.

Type
string

geoRss2ToGeoJson(xml) → {Object}

Source:

Converts a GeoRss v2.0 document to GeoJSON.

Parameters:
Name Type Description
xml Document | String

The GML document.

Returns:

The GeoJSON object.

Type
Object

geoRssAtomToGeoJson(xml) → {Object}

Source:

Converts a GeoRss v2.0 document to GeoJSON.

Parameters:
Name Type Description
xml Document | String

The GML document.

Returns:

The GeoJSON object.

Type
Object

getAncestors(member) → {Array.<CatalogMember>}

Source:

Return the ancestors in the data catalog of the given catalog member, recursively using "member.parent". The "Root Group" is not included.

Parameters:
Name Type Description
member CatalogMember

The catalog member.

Returns:

The members' ancestors in its parent tree, starting at the top, not including this member.

Type
Array.<CatalogMember>

getColumnOptions(name, tableStructure, columnNumber) → {Object}

Source:

Return column options object, using defaults where appropriate.

Parameters:
Name Type Description
name String

Name of column

tableStructure TableStructure

TableStructure to use to calculate values.

columnNumber Int

Which column should be used as template for default column options

Returns:

Column options that TableColumn's constructor understands

Type
Object

getColumnWithNameIdOrIndex(nameIdOrIndex, columns) → {TableColumn}

Source:

Returns the first column with the given name, id or index, or undefined if none match (or null is passed in).

Parameters:
Name Type Description
nameIdOrIndex String | Integer | null

The column name, id or index.

columns Array.<TableColumn>

Test on these columns.

Returns:

The matching column.

Type
TableColumn

getDataUriFormat(dataUri) → {String}

Source:

Read the format from the start of a data uri, eg. data:attachment/csv,...

Parameters:
Name Type Description
dataUri String

The data URI.

Returns:

The format string, eg. 'csv', or undefined if none found.

Type
String

getGeometry(node)

Source:

GeoRss format support following geometries

  • GML geometry enclosed with where tag (i.e. georss:wheregml:......</gml:...></georss:where>)
  • simple geometry which can be enclosed with where tag but are often not (i.e. georss:point25 45</georss:point>)
  • W3C geometry (i.e. geo:Pointgeo:lat55.701</geo:lat>geo:long12.552</geo:long></geo:Point>)
Parameters:
Name Type Description
node *

getGroupChildren(isSmallScreen, groupElement) → {Array.<Element>}

Source:

Gets the children out of a grouping element and sanitises them - e.g. plain strings are converted to s and elements that need to know about whether we're in small screen configuration are provided with that prop.

Parameters:
Name Type Description
isSmallScreen boolean

Is the screen small?

groupElement Element

a grouping element to get children from.

Returns:

a collection of processed children.

Type
Array.<Element>

getShareData(terria, viewStateopt) → {Object}

Source:

Returns just the JSON that defines the current view.

Parameters:
Name Type Attributes Description
terria Object

The Terria object.

viewState ViewState <optional>

Current viewState.

Returns:
Type
Object

getTemporalFiltersContext(item, procedureopt, observablePropertyopt) → {Array.<Object>}

Source:

Return the Mustache template context "temporalFilters" for this item. If a "defaultDuration" parameter (eg. 60d or 12h) exists on either procedure or observableProperty, restrict to that duration from item.endDate.

Parameters:
Name Type Attributes Description
item SensorObservationServiceCatalogItem

This catalog item.

procedure Object <optional>

An element from the item.procedures array.

observableProperty Object <optional>

An element from the item.observableProperties array.

Returns:

An array of {index, startDate, endDate}, or undefined.

Type
Array.<Object>

gmlToGeoJson(xml) → {Object}

Source:

Converts a GML v3.1.1 simple features document to GeoJSON.

Parameters:
Name Type Description
xml Document | String

The GML document.

Returns:

The GeoJSON object.

Type
Object

hostInDomains(host, domains) → {boolean}

Source:

Determines whether this host is, or is a subdomain of, an item in the provided array.

Parameters:
Name Type Description
host String

The host to search for

domains Array.<String>

The array of domains to look in

Returns:

The result.

Type
boolean

initializeChartData()

Source:

singleton

initializeChartTypes()

Source:

Ensure that we have determined the chart type for every data item in our state.

isBrowserCompatible() → {Boolean}

Source:

Determines if this browser has any hope of running TerriaJS. Specifically, this function checks for the presence of the basic ECMAScript 5 function "Object.create".

Returns:

true if this web browser has a chance of running TerriaJS, or false if the browser is so old (pre-IE9) that there is no chance of a good result.

Type
Boolean

isCloseToEasternAntiMeridian()

Source:

Computes whether we're looking close to the east of the anti-meridian Our western viewing extent must be > 140 degrees

Returns:

boolean

isCloseToWesternAntiMeridian()

Source:

Computes whether we're looking close to the west of the anti-meridian Our eastern viewing extent must be < -140 degrees

Returns:

boolean

isCommonMobilePlatform(userAgentStringopt) → {Boolean}

Source:

Determines if this is a common mobile platform such as iOS, Android, or Windows Phone.

Parameters:
Name Type Attributes Description
userAgentString String <optional>

The user agent string to check. If this property is not specified, window.navigator.userAgent is used.

Returns:

[description]

Type
Boolean

Legend()

Source:

Legend object for generating and displaying a legend. Constructor: new Legend(props), where props is an object containing many properties. Other than the "items" property, it is preferable to leave other properties to their defaults for style consistency.

markdownToHtml(markdownString, allowUnsafeHtml, optionsopt) → {String}

Source:

Convert a String in markdown format (which includes html) into html format.

Parameters:
Name Type Attributes Description
markdownString String

String in markdown format.

allowUnsafeHtml Boolean

Pass true to allow unsafe html. Defaults to false.

options Object <optional>

Options to pass to DOMPurify, eg. {ADD_TAGS: ['ying', 'yang']} (https://github.com/cure53/DOMPurify).

Returns:

HTML-formatted string.

Type
String

markerVisible()

Source:

Determines whether the location marker is visible previously added in #addMarker.

NowViewing()

Source:

The model for the "Now Viewing" pane.

overrideProperty(owner, propertyName, descriptor)

Source:

Overrides a Knockout property definition. Change notification is raised on the old property, if any, to encourage listeners to subscribe to the new one.

Parameters:
Name Type Description
owner Object

The owner of the property.

propertyName String

The name of the property.

descriptor Object

The property descriptor, just like the one that would be passed to knockout.defineProperty or Object.defineProperty.

pad(s) → {string}

Source:

Puts a leading 0 in front of a number of it's less than 10.

Parameters:
Name Type Description
s number

A number to pad

Returns:

A string representing a two-digit number.

Type
string

parseCustomHtmlToReact(html, contextopt) → {ReactElement}

Source:

Return html as a React Element.

Parameters:
Name Type Attributes Description
html String
context Object <optional>

Provide any further information that custom components need to know here, eg. which feature and catalogItem they come from.

Returns:
Type
ReactElement

parseCustomMarkdownToReact(raw, contextopt) → {ReactElement}

Source:

Converts a string from markdown format (of which html is a subset) into a ReactElement.

Parameters:
Name Type Attributes Description
raw String

String in markdown or html.

context Object <optional>

Provide any further information that custom components need to know here, eg. which feature and catalogItem they come from.

Returns:
Type
ReactElement

PickedFeatures()

Source:

Holds the vector and raster features that the user picked by clicking the mouse on the map.

prettifyCoordinates(longitude, latitude, options)

Source:

Turns the longitude / latitude in degrees into a human readable pretty strings.

Parameters:
Name Type Description
longitude Number

The longitude to format.

latitude Number

The latitude to format.

options Object

Object with the following properties:

Properties
Name Type Description
height Number

The height.

errorBar Number

The error +/- for the height.

digits Number

The number of digits to fix the lat / lon to.

prettifyProjection()

Source:

Turns the longitude / latitude in degrees into a human readable pretty UTM zone representation.

printWindow(windowToPrint) → {Promise}

Source:

Tells the web browser to print a given window, which my be an iframe window, and returns a promise that resolves when printing is safely over so that, for example the window can be removed.

Parameters:
Name Type Description
windowToPrint Window

The window to print.

Returns:

A promise that resolves when printing is safely over. The prommise is rejected if there is no indication that the browser's print

Type
Promise

processAddress(address) → {string}

Source:

Processes a single address to make it more palatable for the search engine.

Parameters:
Name Type Description
address string

Address to process

Returns:

Processed address

Type
string

propertyGetTimeValues(properties, currentTime) → {Object}

Source:

Gets the values from a Entity's properties object for the time on the current clock.

Parameters:
Name Type Description
properties

An entity's property object

currentTime JulianDate

The current time if it is a time varying catalog item.

Returns:

a simple key-value object of properties.

Type
Object

readJson(file) → {Object}

Source:

Try to read the file as JSON. If that fails, try JSON5.

Parameters:
Name Type Description
file File

The file.

Returns:

The JSON or json5 object described by the file.

Type
Object

rectangleToLatLngBounds(rectangle) → {L.latLngBounds}

Source:

Converts a Cesium Rectangle into a Leaflet LatLngBounds.

Parameters:
Name Type Description
rectangle Rectangle

The rectangle to convert.

Returns:

The equivalent Leaflet latLngBounds.

Type
L.latLngBounds

RegionDataValue(regionCodes, columnHeadings, table, singleSelectValues)

Source:

Holds a collection of region data.

Parameters:
Name Type Description
regionCodes Array.<String>

The list of region codes.

columnHeadings Array.<String>

The list of column headings describing the values associated with each region.

table Array.<Array.<Number>>

An array of arrays where each array in the outer array corresponds to a single region in the regionCodes list and each inner array has a value corresponding to each colum in columnHeadings. For a RegionDataParameter#singleSelect parameter, this property should be undefined.

singleSelectValues Array.<Number>

The single value for each region. For a parameter that is not RegionDataParameter#singleSelect, this property should be undefined.

registerCustomComponentTypes()

Source:

Registers custom component types.

Here we define the following:

You can define your own by replacing this file with your own version.

displays a collapsible section (see Collapsible.jsx) around its children components. It has two allowed attributes:

  • title: The title of the section.
  • [open]: true or false (the default).

displays an interactive chart (see Chart.jsx), along with "expand" and "download" buttons (ChartExpandAndDownloadButtons.jsx). This button enables a catalog item based on the data, for display in the Chart Panel (ChartPanel.jsx). It also detects if it appears in the second column of a

and, if so, rearranges itself to span two columns.

It can have the following attributes. Currently URLs must point to csv (not json) data; but inline json data is supported. Note if you change any of these, also update the chartAttributes array above, or they won't make it here.

  • [title]: The title of the chart. If not supplied, defaults to the name of the context-supplied feature, if available, or else simply "Chart".
  • [x-column]: The x column name or number to show in the preview, if not the first appropriate column. NOT FULLY IMPLEMENTED YET.
  • [y-column]: The y column name or number to show in the preview, if not the first scalar column.
  • [y-columns]: Comma-separated list of y column names or numbers to show in the preview. Overrides "y-column" if provided.
  • [colors]: Comma-separated list of css colors to apply to data columns.
  • [column-names]: Comma-separated list of column names to override those in the source data; empty strings retain the original column name. Eg. column-names="Time,Height,Speed"
  • [column-units]: Comma-separated list of the units for each column. Empty strings are ok. Eg. column-units=",m,km/h"
  • [preview-x-label]: The preview chart x-axis label. Defaults to empty string. Eg. long-names="Last 24 hours,Last 5 days,Time".
  • [id]: An id for the chart; give different charts from the same feature different ids. The actual catalogItem.id used for the expanded chart will also incorporate the chart title and the catalog item name it came from.
  • [styling]: Defaults to 'feature-info'. Can also be 'histogram'. TODO: improve.
  • [highlight-x]: An x-coordinate to highlight.
  • [poll-seconds]: If present, the chart is updated from [poll-sources] every [poll-seconds] seconds. TODO: Returned data is merged into existing data and shown.
  • [poll-sources]: Comma-separated list of URLs to poll every [poll-seconds] seconds. Defaults to sources.
  • [poll-replace]: Either 'true' or 'false' (case sensitive). Pass 'true' to completely replace the data, 'false' to update the existing data. Defaults to false (updating).
  • [can-download]: 'false' to hide the Download button on the chart. By default true and for any other value, the download button is shown.
  • [hide-buttons]: 'true' to hide the Expand and Download buttons on the chart. By default and for any other value, the buttons are shown when applicable. Overrides can-download.

Provide the data in one of these four ways:

  • [sources]: Comma-separated URLs for data at each available time range. The first in the list is shown in the feature info panel preview. Eg. sources="http://example.com/series?offset=1d,http://example.com/series?offset=5d,http://example.com/series?all"
  • [source-names]: Comma-separated display names for each available time range, used in the expand-chart dropdown button. Eg. source-names="1d,5d,30d".
  • [downloads]: Same as sources, but for download only. Defaults to the same as sources. Eg. sources="http://example.com/series?offset=1d,http://example.com/series?offset=5d,http://example.com/series?all"
  • [download-names]: Same as source-names, but for download only. Defaults to the same as source-names. Eg. source-names="1d,5d,30d,max". Or:
  • [src]: The URL of the data to show in the chart panel, once "expand" is clicked. Eg. src="http://example.com/full_time_series.csv".
  • [src-preview]: The URL of the data to show in the feature info panel. Defaults to src. Eg. src-preview="http://example.com/preview_time_series.csv". Or:
  • [data]: csv-formatted data, with \n for newlines. Eg. data="time,a,b\n2016-01-01,2,3\n2016-01-02,5,6". or json-formatted string data, with \quot; for quotes, eg. data="[[\quot;a\quot;,\quot;b\quot;],[2,3],[5,6]]". Or:
  • None of the above, but supply csv or json-formatted data as the content of the chart data, with \n for newlines. Eg. time,a,b\n2016-01-01,2,3\n2016-01-02,5,6. or [["x","y","z"],[1,10,3],[2,15,9],[3,8,12],[5,25,4]].

See CustomComponentType for more details.

rememberRejections(filterFn) → {Object}

Source:

Wraps around a filter function and records all items that are excluded by it. Does not modify the function passed in.

Parameters:
Name Type Description
filterFn

The fn to wrap around

Returns:

The resulting filter function that remembers rejections, and an array array of the rejected items. As the filter function is used, the rejections array with be populated.

Type
Object

removeMarker()

Source:

Removes a marker previously added in #addMarker.

removeUserAddedData(the)

Source:

Remove a user added data item or group

Parameters:
Name Type Description
terria
the target

target to remove

replaceUnderscores(string)

Source:

Replace all underscores in the string with spaces. If the argument is not a string, return it unchanged.

Parameters:
Name Type Description
string

The string to replace. If the argument is not a string, does nothing.

Returns:

The argument with all underscores replaced with spaces. If the argument is not a string, returns the argument unchanged.

sanitiseAddressNumber()

Source:

Sanitises a number (e.g. flat number, unit number etc) from lucene - these are set to -1 if they don't exist, we'd prefer if they were undefined.

selectBaseMap(terria, baseMaps, defaultBaseMapName, useStoredPreference) → {BaseMapViewModel}

Source:

Selects a base map by name from a list of base map options. The name is specified by terria.baseMapName, or, if that property is undefined, by the specified defaultBaseMapName. In addition to setting terria.baseMap, this function subscribes to be notified when terria.baseMapName changes and updates terria.baseMap accordingly. If a base map with the name is not in the baseMaps list, this method leaves the terria.baseMap property unmodified.

Parameters:
Name Type Description
terria Terria

The TerriaJS application.

baseMaps Array.<BaseMapViewModel>

The list of possible base maps.

defaultBaseMapName string

The name of the base map to search for.

useStoredPreference boolean

If true, look for and use a localStorage preference instead.

Returns:

The matching base map, or undefined if not found.

Type
BaseMapViewModel

serializeToJson(target, filterFunction, optionsopt) → {Object}

Source:

Serializes an object to JSON.

Parameters:
Name Type Attributes Description
target Object

The object to serialize.

filterFunction function

A function that, when passed the name of a property as its only parameter, returns true if that property should be serialized and false otherwise.

options Object <optional>

Optional parameters to custom serializers.

Returns:

An object literal corresponding to the serialized object, ready to pass to JSON.stringify.

Type
Object

ServerConfig()

Source:

Provides information about the configuration of the Terria server, by querying /serverconfig

setClockCurrentTime(clock, initialTimeSource)

Source:

Sets the current time of the clock, using a string defined specification for the time point to use.

Parameters:
Name Type Description
clock DataSourceClock

clock to set the current time on.

initialTimeSource String

A string specifiying the value to use when setting the currentTime of the clock. Valid options are: ("present": closest to today's date, "start": start of time range of animation, "end": end of time range of animation, An ISO8601 date e.g. "2015-08-08": specified date or nearest if date is outside range).

shouldBeUpdated()

Source:

Determines whether this property is valid for updating.

sortByFirst(valueArrays) → {Array.<Array>}

Source:

Eg. sortByFirst([['b', 'a', 'c'], [1, 2, 3]]) = [['a', 'b', 'c'], [2, 1, 3]].

Parameters:
Name Type Description
valueArrays Array.<Array>

The array of arrays of values to sort.

Returns:

The values sorted by the first column.

Type
Array.<Array>

sortedIndices(array, compareFunctionopt) → {Array}

Source:

Returns indices such that array[indices[i]] = sortedArray[i]. Eg. sortedIndices(['c', 'a', 'b', 'd']) => [1, 2, 0, 3]. (The sorted array is [a, b, c, d], and "a" was in position 1, "b" in position 2, etc.)

Parameters:
Name Type Attributes Description
array Array

The array to sort.

compareFunction function <optional>

The usual compare function, eg. function(a, b) { return a - b }.

Returns:

The sorted indices, such that array[sortedIndices[0]] = sortedArray[0].

Type
Array

splitIntoBatches(arrayToSplit, batchSize)

Source:

Breaks an array into pieces, putting them in another array.

Parameters:
Name Type Description
arrayToSplit Array

array to split

batchSize number

maximum number of items in each array at end

Returns:

array containing other arrays, which contain a maxiumum number of items in each.

startTimer(radius, interval, containerId, elapsedTimeClass, backgroundClass, elapsedopt)

Source:

Start an existing timer. This will restart the animation if it is already running.

Parameters:
Name Type Attributes Default Description
radius number

Radius of timer.

interval number

Timer duration in seconds.

containerId string

The id of the element to insert the timer into.

elapsedTimeClass string

A class for styling the animation that fills the timer as it runs.

backgroundClass string

A class for styling the timer's background circle.

elapsed string <optional>
0

How much time (in seconds) has already passed.

supportsWebGL() → {Boolean|String}

Source:

Determines if the current browser supports WebGL.

Returns:

False if WebGL is not supported at all, 'slow' if WebGL is supported but it has a major performance caveat (e.g. software rendering), and True if WebGL is available without a major performance caveat.

Type
Boolean | String

TerriaViewer(terria, options)

Source:

The Terria map viewer, utilizing Cesium and Leaflet.

Parameters:
Name Type Description
terria Terria

The Terria instance.

options Object

Object with the following properties:

Properties
Name Type Attributes Description
developerAttribution Object <optional>

Attribution for the map developer, displayed at the bottom of the map. This is an object with two properties, text and link. link is optional and is the URL to open when the user clicks on the attribution.

terrain String | TerrainProvider <optional>

The terrain to use in the 3D view. This may be a string, in which case it is loaded using CesiumTerrainProvider, or it may be a TerrainProvider. If this property is undefined, STK World Terrain is used.

maximumLeafletZoomLevel Integer <optional>

The maximum level to which to allow Leaflet to zoom to. If this property is undefined, Leaflet defaults to level 18.

toArrayOfRows(columnValueArrays, columnNames) → {Array.<Array>}

Source:

Convert an array of column values, with column names, to an array of row values.

Parameters:
Name Type Description
columnValueArrays Array.<Array>

Array of column values, eg. [[1,2,3], [4,5,6]].

columnNames Array.<String>

Array of column names, eg ['x', 'y'].

Returns:

Array of rows, starting with the column names, eg. [['x', 'y'], [1, 4], [2, 5], [3, 6]].

Type
Array.<Array>

triggerResize()

Source:

Trigger a window resize event.

unionRectangleArray(rectangles) → {Rectangle}

Source:

Computes the union of an array of rectangles. This function is not 180-meridian safe.

Parameters:
Name Type Description
rectangles Array.<Rectangle>

The array of rectangles to union.

Returns:

The union of the rectangles, or undefined if the array of rectangles is empty.

Type
Rectangle

unionRectangles(first, second, resultopt) → {Rectangle}

Source:

Computes the union of two rectangles. This function is not 180-meridian safe.

Parameters:
Name Type Attributes Description
first Rectangle

The first rectangle to union.

second Rectangle

The second rectangle to union.

result Rectangle <optional>

The existing Rectangle to which to copy the result instead of creating and returning a new instance.

Returns:

The union of the two rectangles.

Type
Rectangle

updateApplicationOnHashChange(terria, window, urlShorteneropt)

Source:

Updates the Terria when the window's 'hashchange' event is raised. This allows new init files and "start=" URLs to be loaded just by changing the hash portion of the URL in the browser's address bar.

Parameters:
Name Type Attributes Description
terria Terria

The Terria instance to update.

window Window

The browser's window DOM object.

urlShortener UrlShortener <optional>

The URL shortener to use to expand short URLs. If this property is undefined, short URLs will not be expanded.

updateFromJson(target, json, optionsopt) → {Promise}

Source:

Updates an object from a JSON representation of the object. Only properties that actually exist on the object are read from the JSON, and the object has the opportunity to inject specialized deserialization logic by providing an updaters property.

Parameters:
Name Type Attributes Description
target Object

The object to update from the JSON.

json Object

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

options Object <optional>

Optional parameters to custom updaters.

Returns:

A promise that resolves when the update completes.

Type
Promise

updateRectangleFromRegion(catalogItem, regionProvider, region) → {Promise}

Source:

Updates the CatalogItem#rectangle property of a CatalogItem to be the bounding rectangle of a given region.

Parameters:
Name Type Description
catalogItem CatalogItem

The catalog item to update.

regionProvider RegionProvider

The region provider.

region Object

The region from which to update the rectangle. The region must be known to the region provider.

Returns:

A promise that resolves when the rectangle has been updated. This promise silently resolves if an error occurs while trying to update the rectangle.

Type
Promise

Type Definitions

CleanUpCallback()

Source:

Callback for when clean up is happening, i.e., for done or cancel.

MakeDialogMessageCallback() → {String}

Source:

Callback for when the dialog is displayed, to provide a custom message

Returns:

Message to add to dialog

Type
String

PointClickedCallback(customDataSource)

Source:

Callback for when a point is clicked.

Parameters:
Name Type Description
customDataSource CustomDataSource

Contains all point entities that user has selected so far

PointMovedCallback(customDataSource)

Source:

Callback for when a point is moved.

Parameters:
Name Type Description
customDataSource CustomDataSource

Contains all point entities that user has selected so far

PointMovedCallback(customDataSource)

Source:

Callback for when a point is moved.

Parameters:
Name Type Description
customDataSource CustomDataSource

Contains all point entities that user has selected so far

PointMovedCallback(customDataSource)

Source:

Callback for when a point is moved.

Parameters:
Name Type Description
customDataSource CustomDataSource

Contains all point entities that user has selected so far

PointMovedCallback(customDataSource)

Source:

Callback for when a point is moved.

Parameters:
Name Type Description
customDataSource CustomDataSource

Contains all point entities that user has selected so far

PostDisplayHookCallback(viewState)

Source:

Callback after screen is displayed.

Parameters:
Name Type Description
viewState Object

ViewState.

PreDisplayHookCallback(viewState)

Source:

Callback before screen is displayed.

Parameters:
Name Type Description
viewState Object

ViewState.