new MagdaCatalogItem(terria)
- Source:
A CatalogItem
that queries a MAGDA server for a dataset or distribution, and then accesses
that the as WMS, GeoJSON, etc. depending on what it finds.
Parameters:
Name | Type | Description |
---|---|---|
terria |
Terria | The Terria instance. |
Extends
Members
(static) defaultSerializers :Object
- Source:
Gets or sets the set of default serializer functions to use in CatalogMember#serializeToJson
. Types derived from this type
should expose this instance - cloned and modified if necesary - through their CatalogMember#serializers
property.
Type:
- Object
(static) defaultUpdaters :Object
- Source:
Gets or sets the set of default updater functions to use in CatalogMember#updateFromJson
. Types derived from this type
should expose this instance - cloned and modified if necesary - through their CatalogMember#updaters
property.
Type:
- Object
(static) shortHumanReadableTypeNames :Object
- Source:
Maps catalog item type
to a short, human-readable identifier of the
type of distribution accessed (e.g. wms
maps to WMS
and esri-mapServer
maps to MapServer
).
Type:
- Object
_memoizedInfoItemsSourceLookup
- Source:
- Inherited From:
Lookup table for _sourceInfoItemNames, access through CatalogMember#_infoItemsWithSourceInfoLookup
allowAnyDistributionIfDistributionIdNotFound :Boolean
- Source:
- Default Value:
- true
Gets or sets a value indicating whether any supported distribution may be used if both {@see MagdaCatalogItem#datasetId} and {@see MagdaCatalogItem#distributionId} are specified and the {@see MagdaCatalogItem#distributionId} is not found.
Type:
- Boolean
allowCsv :Boolean
- Source:
- Default Value:
- true
Gets or sets a value indicating whether this may be a CSV distribution.
Type:
- Boolean
allowCzml :Boolean
- Source:
- Default Value:
- true
Gets or sets a value indicating whether this may be a CZML distribution.
Type:
- Boolean
allowEsriFeatureServer :Boolean
- Source:
- Default Value:
- true
Gets or sets a value indicating whether this may be an Esri FeatureServer distribution.
Type:
- Boolean
allowEsriMapServer :Boolean
- Source:
- Default Value:
- true
Gets or sets a value indicating whether this may be an Esri MapServer distribution.
Type:
- Boolean
allowGeoJson :Boolean
- Source:
- Default Value:
- true
Gets or sets a value indicating whether this may be a GeoJSON distribution.
Type:
- Boolean
allowKml :Boolean
- Source:
- Default Value:
- true
Gets or sets a value indicating whether this may be a KML distribution.
Type:
- Boolean
allowWfs :Boolean
- Source:
- Default Value:
- true
Gets or sets a value indicating whether this may be a WFS distribution.
Type:
- Boolean
allowWms :Boolean
- Source:
- Default Value:
- true
Gets or sets a value indicating whether this may be a WMS distribution.
Type:
- Boolean
attribution :Credit
- Source:
- Inherited From:
Gets or sets an attribution displayed on the map when this catalog item is enabled. This property is observable.
Type:
- Credit
cacheDuration :String
- Source:
- Inherited From:
Gets or sets the cache duration to use for proxied URLs for this catalog member. If undefined, proxied URLs are effectively cachable forever. The duration is expressed as a Varnish-like duration string, such as '1d' (one day) or '10000s' (ten thousand seconds).
Type:
- String
canZoomTo :Boolean
- Source:
- Inherited From:
Returns true if this item currently has a rectangle to zoom to. Depends on observable properties, and so updates once loaded.
Type:
- Boolean
clampedDiscreteTime :Date
- Source:
- Inherited From:
Gets the CatalogItems current time as the discrete time that the CatalogItem has information for. Returns the nearest time in-range if the clock is beyond the range of the intervals specified by the layer. Returns undefined if it is not possible to query the time (i.e. the item doesn't have a clock, availableDates or intervals).
See also discreteTime if you want the discrete time that is undefined if the current time is beyond the range of the intervals specified by the item.
Type:
- Date
clock :DataSourceClock
- Source:
- Inherited From:
Gets or sets the clock parameters for this data item. If this property is undefined, this data item does not have any time-varying data. This property is observable.
Type:
- DataSourceClock
csvDistributionFormat :RegExp
- Source:
Gets or sets a regular expression that, when it matches a distribution's format, indicates that the distribution is a CSV distribution.
Type:
- RegExp
currentTime :JulianDate
- Source:
- Inherited From:
Gets / sets the CatalogItems current time.
This property is an observable version of clock.currentTime, they will always have the same value.
When setting the currentTime through this property the correct clock (terria.clock or this.clock) is updated depending on whether .useOwnClock is true or false so that the catalog items state will reflect the new time correctly.
The get component of this property is effectively an interface adapter for clock.definitionChanged which changes the structure from an Event when the current time changes to a knockout property which can be observed.
Type:
- JulianDate
customProperties :Object
- Source:
- Inherited From:
Gets or sets the dictionary of custom item properties. This property is observable.
Type:
- Object
czmlDistributionFormat :RegExp
- Source:
Gets or sets a regular expression that, when it matches a distribution's format, indicates that the distribution is a CZML distribution.
Type:
- RegExp
dataCustodian :String
- Source:
- Inherited From:
Gets or sets a description of the custodian of this data item. This property is an HTML string that must be sanitized before display to the user. This property is observable.
Type:
- String
datasetId :String
- Source:
Gets or sets the ID of the MAGDA dataset referred to by this catalog item. Either this property is {@see MagdaCatalogItem#distributionId} must be specified. The first distribution of a supported type in this dataset will be used.
Type:
- String
dataUrl :String
- Source:
- Inherited From:
Gets or sets the URL from which this data item's raw data can be retrieved, or undefined if raw data for this data item is not available. This property is observable.
Type:
- String
dataUrlType :String
- Source:
- Inherited From:
Gets or sets the type of the CatalogItem#dataUrl
, or undefined if raw data for this data
source is not available. This property is observable.
Valid values are:
direct
- A direct link to the data.wfs
- A Web Feature Service (WFS) base URL. IfCatalogItem#dataUrl
is not specified, the base URL will be this data item's URL.wfs-complete
- A complete, ready-to-use link to download features from a WFS server.none
- There is no data link.
Type:
- String
dateFormat :Object
- Source:
- Inherited From:
Options for formatting current time and timeline tic labels. Options are: currentTime // Current time in time slider will be shown in this format. For example "mmmm yyyy" for Jan 2016. timelineTic // Timeline tics will have this label. For example "yyyy" will cause each tic to be labelled with the year.
Type:
- Object
description :String
- Source:
- Inherited From:
Gets or sets the description of the item. This property is observable.
Type:
- String
disablePreview
- Source:
- Inherited From:
Gets or sets a flag indicating whether the preview on the Add Data panel should be disabled. This is useful when the preview will be very slow to load.
discreteTime :Date
- Source:
- Inherited From:
Gets the CatalogItems current time as the discrete time that the CatalogItem has information for. Returns undefined if the clock is beyond the range of the intervals specified by the layer. Returns undefined if it is not possible to query the time (i.e. the item doesn't have a clock, availableDates or intervals).
See also clampedDiscreteTime if you want the discrete time that is clamped to the first / last value if the current time is beyond the range of the intervals specified by the item.
Type:
- Date
displayChoicesBeforeLegend :Boolean
- Source:
- Inherited From:
Gets or sets a flag which determines whether the legend comes before (false) or after (true) the display variable choice. Default false.
Type:
- Boolean
distributionId :String
- Source:
Gets or sets the ID of the MAGDA distribution referred to by this catalog item. Either this property or {@see MagdaCatalogItem#datasetId} must be specified. If {@see MagdaCatalogItem#datasetId} is specified too, and this distribution is not found, any supported distribution may be used instead, depending on the value of {@see MagdaCatalogItem#allowAnyDistributionIfDistributionIdNotFound}.
Type:
- String
esriFeatureServerDistributionFormat :RegExp
- Source:
Gets or sets a regular expression that, when it matches a distribution's format, indicates that the distribution is an Esri
MapServer or FeatureServer distribution. A valid FeatureServer distribution must also have FeatureServer
in its URL.
Type:
- RegExp
esriMapServerDistributionFormat :RegExp
- Source:
Gets or sets a regular expression that, when it matches a distribution's format, indicates that the distribution is an Esri MapServer distribution.
A valid MapServer distribution must also have MapServer
in its URL.
Type:
- RegExp
featureInfoTemplate :String|Object
- Source:
- Inherited From:
Gets or sets a template to display message in a info box. May be a string or an object with template, name and/or partials properties.
Type:
- String | Object
forceProxy :Boolean
- Source:
- Inherited From:
Gets or sets whether or not this member should be forced to use a proxy. This property is not observable.
Type:
- Boolean
geoJsonDistributionFormat :RegExp
- Source:
Gets or sets a regular expression that, when it matches a distribution's format, indicates that the distribution is a GeoJSON distribution.
Type:
- RegExp
hasDescription :Boolean
- Source:
- Inherited From:
Tests whether a description is available, either in the 'description' property or as a member of the 'info' array.
Type:
- Boolean
hasLegend :Boolean
- Source:
- Inherited From:
Gets a value indicating whether this data item has a legend.
Type:
- Boolean
hideSource :boolean
- Source:
- Inherited From:
Indicates that the source of this data should be hidden from the UI (obviously this isn't super-secure as you can just look at the network requests).
Type:
- boolean
id :String
- Source:
- Inherited From:
An optional unique id for this member, that is stable across renames and moves. Use uniqueId to get the canonical unique id for this CatalogMember, which is present even if there is no id.
Type:
- String
info :Array.<Object>
- Source:
- Inherited From:
- Default Value:
- []
Gets or sets the array of section titles and contents for display in the layer info panel. In future this may replace 'description' above - this list should not contain sections named 'description' or 'Description' if the 'description' property is also set as both will be displayed. The object is of the form {name:string, content:string}. Content will be rendered as Markdown with HTML. This property is observable.
Type:
- Array.<Object>
infoSectionOrder :Array.<String>
- Source:
- Inherited From:
Gets or sets the array of section titles definining the display order of info sections. If this property
is not defined, DataPreviewSections
's DEFAULT_SECTION_ORDER is used. This property is observable.
Type:
- Array.<String>
initialMessage :Object
- Source:
- Inherited From:
A message object that is presented to the user when an item or group is initially clicked The object is of the form {title:string, content:string, key: string, confirmation: boolean, confirmText: string, width: number, height: number}. This property is observable.
Type:
- Object
isEnabled :Boolean
- Source:
- Inherited From:
Gets or sets a value indicating whether this data item is enabled. An enabled data item appears in the "Now Viewing" pane, but is not necessarily shown on the map. This property is observable.
Type:
- Boolean
isGroup :Boolean
- Source:
- Inherited From:
Gets a value that tells the UI whether this is a group. Groups, when clicked, expand to show their constituent items.
Type:
- Boolean
isHidden :Boolean
- Source:
- Inherited From:
- Default Value:
- false
Gets or sets a value indicating whether this item is hidden from the catalog. This property is observable.
Type:
- Boolean
isLegendVisible :Boolean
- Source:
- Inherited From:
Gets or sets a value indicating whether the legend for this data item is currently visible. This property is observable.
Type:
- Boolean
isLoading :Boolean
- Source:
- Inherited From:
Gets or sets a value indicating whether this data source is currently loading. This property is observable.
Type:
- Boolean
isMappable :Boolean
- Source:
- Inherited From:
Gets or sets a value indicating whether this data source can be shown on the map (as opposed to a time-series dataset, for instance, which can only be shown in a chart). This property is observable.
Type:
- Boolean
isPromoted :Boolean
- Source:
- Inherited From:
- Default Value:
- false
Gets or sets a value indicating whether this item is kept above other non-promoted items. This property is observable.
Type:
- Boolean
isShown :Boolean
- Source:
- Inherited From:
Gets or sets a value indicating whether this data item is currently shown on the map. In order to be shown, the item must also be enabled. This property is observable.
Type:
- Boolean
isUserSupplied :Boolean
- Source:
- Inherited From:
- Default Value:
- true
Gets or sets a value indicating whether this member was supplied by the user rather than loaded from one of the
Terria#initSources
. User-supplied members must be serialized completely when, for example,
serializing enabled members for sharing. This property is observable.
Type:
- Boolean
isWaitingForDisclaimer :boolean
- Source:
- Inherited From:
Whether this catalog member is waiting for a disclaimer to be accepted before showing itself.
Type:
- boolean
itemProperties :Object
- Source:
Gets or sets a hash of properties that will be set on the item created from the MAGDA distribution. For example, { "treat404AsError": false }
Type:
- Object
kmlDistributionFormat :RegExp
- Source:
Gets or sets a regular expression that, when it matches a distribution's format, indicates that the distribution is a KML distribution.
Type:
- RegExp
legendUrl :LegendUrl
- Source:
- Inherited From:
Gets or sets the URL of the legend to show when this catalog item is enabled. If there is more than one legend URL, this property returns the first one.
Type:
legendUrls :LegendUrl
- Source:
- Inherited From:
Gets or sets the URLs of the legends to show when this catalog item is enabled.
Type:
maximumShownFeatureInfos :Number
- Source:
- Inherited From:
The maximum number of features whose information can be shown at one time in the Feature Info Panel, from this item. Defaults to terria.configParameters.defaultMaximumShownFeatureInfos
Type:
- Number
metadata :Metadata
- Source:
- Overrides:
Gets the metadata associated with this data source and the server that provided it, if applicable.
Type:
metadataUrl :String
- Source:
- Inherited From:
Gets or sets the URL from which this data item's metadata description can be retrieved, or undefined if metadata is not available for this data item. The format of the metadata depends on the type of data item. For example, Web Map Service (WMS) data items provide their metadata via their GetCapabilities document. This property is observable.
Type:
- String
name :String
- Source:
- Inherited From:
Gets or sets the name of the item. This property is observable.
Type:
- String
nameInCatalog :String
- Source:
- Inherited From:
Gets or sets the name of this catalog member in the catalog. By default this is just name
, but can be overridden.
Type:
- String
nowViewingMessage :String
- Source:
- Inherited From:
Gets or sets a message to show when this item is enabled for the first time in order to call attention to the Now Viewing panel.
Type:
- String
parent :CatalogGroup
- Source:
- Inherited From:
The parent CatalogGroup
of this member.
Type:
path :String
- Source:
- Inherited From:
The complete path of this member's location.
Type:
- String
propertiesForSharing :Array.<String>
- Source:
- Inherited From:
Gets the set of names of the properties to be serialized for this object for a share link.
Type:
- Array.<String>
rectangle :Rectangle
- Source:
- Inherited From:
Gets or sets the geographic rectangle (extent or bounding box) containing this data item. This property is observable.
Type:
- Rectangle
serializers :Object
- Source:
- Overrides:
Gets the set of functions used to serialize individual properties in CatalogMember#serializeToJson
.
When a property name on the model matches the name of a property in the serializers object literal,
the value will be called as a function and passed a reference to the model, a reference to the destination
JSON object literal, and the name of the property.
Type:
- Object
shareKeys :Array.<String>
- Source:
- Inherited From:
An array of all possible keys that can be used to match to this catalog member when specified in a share link -
used for maintaining backwards compatibility when adding or changing CatalogMember#id
.
Type:
- Array.<String>
shortReport :String
- Source:
- Inherited From:
A short report to show on the now viewing tab. This property is observable.
Type:
- String
shortReportSections :Array.<ShortReportSection>
- Source:
- Inherited From:
The list of collapsible sections of the short report. Each element of the array is an object literal
with a name
and content
property.
Type:
- Array.<ShortReportSection>
showsInfo :Boolean
- Source:
- Inherited From:
Gets or sets a value indicating whether this data source should show an info icon. This property is observable.
Type:
- Boolean
supportsOpacity :Boolean
- Source:
- Inherited From:
Gets a value indicating whether the opacity of this data item can be changed.
Type:
- Boolean
supportsReordering :Boolean
- Source:
- Inherited From:
Gets a value indicating whether this data item, when enabled, can be reordered with respect to other data items. Data items that cannot be reordered are typically displayed above reorderable data items.
Type:
- Boolean
supportsSplitting
- Source:
- Inherited From:
Gets a value indicating whether this layer can be split so that it is only shown on the left or right side of the screen.
supportsToggleShown :Boolean
- Source:
- Inherited From:
Gets a value indicating whether the visibility of this data item can be toggled.
Type:
- Boolean
terria :Terria
- Source:
- Inherited From:
Gets the Terria instance.
Type:
type :String
- Source:
- Overrides:
Gets the type of data member represented by this instance.
Type:
- String
typeName :String
- Source:
- Overrides:
Gets a human-readable name for this type of data source, 'MAGDA Distribution'.
Type:
- String
uniqueId :String
- Source:
- Inherited From:
The canonical unique id for this CatalogMember. Will be the id property if one is present, otherwise it will fall back to the uniqueId of this item's parent + this item's name. This means that if no id is set anywhere up the tree, the uniqueId will be a complete path of this member's location.
Type:
- String
updaters :Object
- Source:
- Overrides:
Gets the set of functions used to update individual properties in CatalogMember#updateFromJson
.
When a property name in the returned object literal matches the name of a property on this instance, the value
will be called as a function and passed a reference to this instance, a reference to the source JSON object
literal, and the name of the property.
Type:
- Object
url :String
- Source:
- Inherited From:
Gets or sets the URL of this data. This property is observable.
Type:
- String
useOwnClock :Boolean
- Source:
- Inherited From:
Gets or sets a flag indicating whether imagery should be displayed using this item's own clock (currentTime, multiplier), or, if false, the terria clock (whose current time is shown in the timeline UI). Default false. This property is observable.
Type:
- Boolean
wfsDistributionFormat :RegExp
- Source:
Gets or sets a regular expression that, when it matches a distribution's format, indicates that the distribution is a WFS distribution.
Type:
- RegExp
wmsDistributionFormat :RegExp
- Source:
Gets or sets a regular expression that, when it matches a distribution's format, indicates that the distribution is a WMS distribution.
Type:
- RegExp
zoomOnEnable :Boolean
- Source:
- Inherited From:
- Default Value:
- false
Gets or sets a value indicating whether the map will automatically zoom to this catalog item when it is enabled.
Note that within a single init source:
- Catalog items with both
isEnabled
andzoomOnEnable
set to true will override the top-levelinitialCamera
property. - If multiple catalog items have both
isEnabled
andzoomOnEnable
set to true, it is undefined which one will affect the camera.
In the case of multiple init sources, however, the camera will reflect whatever happens in the last init source, whether
it is a result of a zoomOnEnable
or an initialCamera
,
Type:
- Boolean
Methods
(static) createCatalogItemFromDistribution() → {Promise.<CatalogMember>}
- Source:
Creates a catalog item from a MAGDA distribution.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options.terria |
Terria | The Terria instance. |
||
options.distribution |
Object | The MAGDA distribution JSON. |
||
options.magdaBaseUrl |
String | The base URL of the MAGDA server. |
||
options.parent |
String |
<optional> |
The parent of this catalog item. |
|
options.wmsDistributionFormat |
RegExp |
<optional> |
A regular expression that, when it matches a distribution's format, indicates that the distribution is a WMS distribution. If undefined, WMS distributions will not be returned. |
|
options.wfsDistributionFormat |
RegExp |
<optional> |
A regular expression that, when it matches a distribution's format, indicates that the distribution is a WFS distribution. If undefined, WFS distributions will not be returned. |
|
options.esriMapServerDistributionFormat |
RegExp |
<optional> |
A regular expression that, when it matches a distribution's format, indicates that the distribution is an Esri MapServer distribution. If undefined, Esri MapServer distributions will not be returned. |
|
options.esriFeatureServerDistributionFormat |
RegExp |
<optional> |
A regular expression that, when it matches a distribution's format, indicates that the distribution is an Esri FeatureServer distribution. If undefined, Esri FeatureServer distributions will not be returned. |
|
options.kmlDistributionFormat |
RegExp |
<optional> |
A regular expression that, when it matches a distribution's format, indicates that the distribution is a KML distribution. If undefined, KML distributions will not be returned. |
|
options.geoJsonDistributionFormat |
RegExp |
<optional> |
A regular expression that, when it matches a distribution's format, indicates that the distribution is a GeoJSON distribution. If undefined, GeoJSON distributions will not be returned. |
|
options.csvDistributionFormat |
RegExp |
<optional> |
A regular expression that, when it matches a distribution's format, indicates that the distribution is a CSV distribution. If undefined, CSV distributions will not be returned. |
|
options.czmlDistributionFormat |
RegExp |
<optional> |
A regular expression that, when it matches a distribution's format, indicates that the distribution is a CZML distribution. If undefined, CZML distributions will not be returned. |
|
options.allowWmsGroups |
Boolean |
<optional> |
false
|
True to allow this function to return WMS groups in addition to items. For example if the distribution refers to a WMS server but no layer is available, a {@see WebMapServiceCatalogGroup} for the server will be returned. |
options.allowWfsGroups |
Boolean |
<optional> |
false
|
True to allow this function to return WFS groups in addition to items. For example if the distribution refers to a WFS server but no layer is available, a {@see WebFeatureServiceCatalogGroup} for the server will be returned. |
options.useDistributionName |
Boolean |
<optional> |
false
|
True to use the name of the distribution for the name of the catalog item; false to use the name of the dataset. |
options.dataCustodian |
String |
<optional> |
The data custodian to use, overriding any that might be inferred from the MAGDA dataset. |
|
options.itemProperties |
Object |
<optional> |
Additional properties to apply to the item once created. |
Returns:
A promise to the created catalog member, or a promise to undefined if no catalog member could be created from the distribution.
- Type
- Promise.<CatalogMember>
(protected) _disable()
- Source:
- Inherited From:
Disables this data item on the globe or map. This method:
- Should not be called directly. Instead, set the
CatalogItem#isEnabled
property to false. - Will not be called if
CatalogItem#_enable
was not called (for example, because the previous call was deferred while the data item loaded, and the user disabled the data item before the load completed). - Will only be called after
CatalogItem#_hide
when a shown data item is disabled. - Calls
CatalogItem#_disableInCesium
orCatalogItem#_disableInLeaflet
in the base-class implementation, depending on which viewer is active. Derived classes that have identical disable logic for both viewers may override this method instead of the viewer-specific ones.
(abstract, protected) _disableInCesium()
- Source:
- Inherited From:
When implemented in a derived class, disables this data item on the Cesium globe. You should not call this
directly, but instead set the CatalogItem#isEnabled
property to false. See
CatalogItem#_disable
for more information.
(abstract, protected) _disableInLeaflet()
- Source:
- Inherited From:
When implemented in a derived class, disables this data item on the Leaflet map. You should not call this
directly, but instead set the CatalogItem#isEnabled
property to false. See
CatalogItem#_disable
for more information.
(protected) _enable()
- Source:
- Inherited From:
Enables this data item on the globe or map. This method:
- Should not be called directly. Instead, set the
CatalogItem#isEnabled
property to true. - Will not necessarily be called immediately when
CatalogItem#isEnabled
is set to true; it will be deferred untilCatalogItem#isLoading
is false. - Should NOT also show the data item on the globe/map (see
CatalogItem#_show
), so in some cases it may not do anything at all. - Calls
CatalogItem#_enableInCesium
orCatalogItem#_enableInLeaflet
in the base-class implementation, depending on which viewer is active. Derived classes that have identical enable logic for both viewers may override this method instead of the viewer-specific ones.
(abstract, protected) _enableInCesium()
- Source:
- Inherited From:
When implemented in a derived class, enables this data item on the Cesium globe. You should not call this
directly, but instead set the CatalogItem#isEnabled
property to true. See
CatalogItem#_enable
for more information.
(abstract, protected) _enableInLeaflet()
- Source:
- Inherited From:
When implemented in a derived class, enables this data item on the Leaflet map. You should not call this
directly, but instead set the CatalogItem#isEnabled
property to true. See
CatalogItem#_enable
for more information.
(protected) _getValuesThatInfluenceLoad() → {Array}
- Source:
- Inherited From:
When implemented in a derived class, gets an array containing the current value of all properties that
influence this item's load process. See CatalogItem#load
for more information on when and
how this is used. The base class implementation returns an empty array.
Returns:
The array of values that influence the load process.
- Type
- Array
(protected) _hide()
- Source:
- Inherited From:
Hides this data item on the globe or map. This method:
- Should not be called directly. Instead, set the
CatalogItem#isShown
property to false. - Will not be called if
CatalogItem#_show
was not called (for example, because the previous call was deferred while the data item loaded, and the user hid the data item before the load completed). - Calls
CatalogItem#_hideInCesium
orCatalogItem#_hideInLeaflet
in the base-class implementation, depending on which viewer is active. Derived classes that have identical hide logic for both viewers may override this method instead of the viewer-specific ones.
(abstract, protected) _hideInCesium()
- Source:
- Inherited From:
When implemented in a derived class, hides this data item on the Cesium globe. You should not call this
directly, but instead set the CatalogItem#isShown
property to false. See
CatalogItem#_hide
for more information.
(abstract, protected) _hideInLeaflet()
- Source:
- Inherited From:
When implemented in a derived class, hides this data item on the Leaflet map. You should not call this
directly, but instead set the CatalogItem#isShown
property to false. See
CatalogItem#_hide
for more information.
(protected) _load() → {Promise}
- Source:
- Overrides:
When implemented in a derived class, this method loads the item. The base class implementation does nothing.
This method should not be called directly; call CatalogItem#load
instead.
Returns:
A promise that resolves when the load is complete.
- Type
- Promise
(protected) _show()
- Source:
- Inherited From:
Shows this data item on the globe or map. This method:
- Should not be called directly. Instead, set the
CatalogItem#isShown
property to true. - Will only be called after
CatalogItem#_enable
; you can count on that method having been called first. - Will not necessarily be called immediately when
CatalogItem#isShown
is set to true; it will be deferred untilCatalogItem#isLoading
is false. - Calls
CatalogItem#_showInCesium
orCatalogItem#_showInLeaflet
in the base-class implementation, depending on which viewer is active. Derived classes that have identical show logic for both viewers may override this method instead of the viewer-specific ones.
(abstract, protected) _showInCesium()
- Source:
- Inherited From:
When implemented in a derived class, shows this data item on the Cesium globe. You should not call this
directly, but instead set the CatalogItem#isShown
property to true. See
CatalogItem#_show
for more information.
(abstract, protected) _showInLeaflet()
- Source:
- Inherited From:
When implemented in a derived class, shows this data item on the Leaflet map. You should not call this
directly, but instead set the CatalogItem#isShown
property to true. See
CatalogItem#_show
for more information.
connectsWithRoot()
- Source:
- Inherited From:
Goes up the hierarchy and determines if this CatalogMember is connected with the root in terria.catalog, or whether it's part of a disconnected sub-tree.
enableWithParents()
- Source:
- Inherited From:
"Enables" this catalog member in a way that makes sense for its implementation (e.g. isEnabled for items, isOpen for groups, and all its parents and ancestors in the tree.
findInfoSection(sectionName) → {Object}
- Source:
- Inherited From:
Finds an CatalogMember#info
section by name.
Parameters:
Name | Type | Description |
---|---|---|
sectionName |
String | The name of the section to find. |
Returns:
The section, or undefined if no section with that name exists.
- Type
- Object
handleTileError(detailsRequestPromise, imageryProvider, x, y, level) → {Promise}
- Source:
- Inherited From:
Handles an error in loading a tile. If this function returns a promise that resolves successfully,
the tile request will be retried. If the returned promise rejects, it must reject with an instance
of RequestErrorEvent
with the details of the failure, and the default handling of tile
failures will be used. The default handling takes into account the treat404AsError
, treat403AsError
,
and ignoreUnknownTileErrors
properties. The default implementation simply returns detailsRequestPromise
.
Parameters:
Name | Type | Description |
---|---|---|
detailsRequestPromise |
Promise | A promise which is the result of a simple call to |
imageryProvider |
ImageryProvider | The imagery provider that generated the failed request. |
x |
Number | The x coordinate of the failed tile. |
y |
Number | The y coordinate of the failed tile. |
level |
Number | The level of the failed tile. |
Returns:
A promise, as described above.
- Type
- Promise
isNextTimeAvaliable() → {Boolean}
- Source:
- Inherited From:
Whether it is possible to move to a time interval after the current time.
Returns:
True if it is possible.
- Type
- Boolean
isPreviousTimeAvaliable() → {Boolean}
- Source:
- Inherited From:
Whether it is possible to move to a time interval before the current time.
Returns:
True if it is possible.
- Type
- Boolean
load() → {Promise}
- Source:
- Inherited From:
Loads this catalog item, if it's not already loaded. It is safe to
call this method multiple times. The CatalogItem#isLoading
flag will be set while the load is in progress.
Derived classes should implement CatalogItem#_load
to perform the actual loading for the item.
Derived classes may optionally implement CatalogItem#_getValuesThatInfluenceLoad
to provide an array containing
the current value of all properties that influence this item's load process. Each time that CatalogItem#load
is invoked, these values are checked against the list of values returned last time, and CatalogItem#_load
is
invoked again if they are different. If CatalogItem#_getValuesThatInfluenceLoad
is undefined or returns an
empty array, CatalogItem#_load
will only be invoked once, no matter how many times
CatalogItem#load
is invoked.
Returns:
A promise that resolves when the load is complete, or undefined if the item is already loaded.
- Type
- Promise
loadAndEnable() → {Promise}
- Source:
- Inherited From:
Enables this catalog item, and returns a promise that resolves when the load process, if any, completes.
Returns:
The promise.
- Type
- Promise
moveToNextTime()
- Source:
- Inherited From:
Move the current time to the next time interval.
moveToPreviousTime()
- Source:
- Inherited From:
Move the current time to the previous time interval.
serializeToJson(optionsopt) → {Object}
- Source:
- Inherited From:
Serializes the data item to JSON.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Object with the following properties: Properties
|
Returns:
The serialized JSON object-literal.
- Type
- Object
toggleEnabled() → {Boolean}
- Source:
- Inherited From:
Toggles the CatalogItem#isEnabled
property of this item. If it is enabled, calling this method
will disable it. If it is disabled, calling this method will enable it.
Returns:
true if the item is now enabled, false if it is now disabled.
- Type
- Boolean
toggleLegendVisible() → {Boolean}
- Source:
- Inherited From:
Toggles the CatalogItem#isLegendVisible
property of this item. If it is visible, calling this
method will hide it. If it is hidden, calling this method will make it visible.
Returns:
true if the legend is now visible, false if it is now hidden.
- Type
- Boolean
toggleShown() → {Boolean}
- Source:
- Inherited From:
Toggles the CatalogItem#isShown
property of this item. If it is shown, calling this method
will hide it. If it is hidden, calling this method will show it.
Returns:
true if the item is now shown, false if it is now hidden.
- Type
- Boolean
updateFromJson(json, optionsopt) → {Promise}
- Source:
- Inherited From:
Updates the catalog member from a JSON object-literal description of it. Existing collections with the same name as a collection in the JSON description are updated. If the description contains a collection with a name that does not yet exist, it is created. Because parts of the update may happen asynchronously, this method returns at Promise that will resolve when the update is completely done.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
json |
Object | The JSON description. The JSON should be in the form of an object literal, not a string. |
|||||||||||||
options |
Object |
<optional> |
Object with the following properties: Properties
|
Returns:
A promise that resolves when the update is complete.
- Type
- Promise
useClock() → {Promise}
- Source:
- Inherited From:
Uses the CatalogItem#clock
settings from this data item. If this data item
has no clock settings, or has the useOwnClock property true, this method does nothing.
Because the clock update may happen asynchronously (for example, if the item's clock parameters are not yet known),
this method returns a Promise that resolves when the clock has been updated.
Returns:
A promise that resolves when the clock has been updated.
- Type
- Promise
zoomTo() → {Promise}
- Source:
- Inherited From:
Moves the camera so that the item's bounding rectangle is visible. If CatalogItem#rectangle
is
undefined or covers more than about half the world in the longitude direction, or if the data item is not enabled
or not shown, this method does nothing. Because the zoom may happen asynchronously (for example, if the item's
rectangle is not yet known), this method returns a Promise that resolves when the zoom animation starts.
Returns:
A promise that resolves when the zoom animation starts.
- Type
- Promise
zoomToAndUseClock() → {Promise}
- Source:
- Inherited From:
Moves the camera so that the data item's bounding rectangle is visible, and updates the TerriaJS clock according to this
data item's clock settings. This method simply calls CatalogItem#zoomTo
and
CatalogItem#useClock
. Because the zoom and clock update may happen asynchronously (for example, if the item's
rectangle is not yet known), this method returns a Promise that resolves when the zoom animation starts and the clock
has been updated.
Returns:
A promise that resolves when the clock has been updated and the zoom animation has started.
- Type
- Promise