new geo.contourFeature(arg){geo.contourFeature}
Create a new instance of class contourFeature.
Name | Type | Description |
---|---|---|
arg |
geo.contourFeature.spec |
Returns:
Type | Description |
---|---|
geo.contourFeature |
Extends
Type Definitions
-
geo.contourFeature.contourInfogeo.meshFeature.meshColoredInfo
-
Computed contour information.
Properties:
Name Type Description value
Array.<number> An array of values that have been normalized to a range of [0, steps]. There is one value per vertex or element.
opacity
Array.<number> An array of opacities per vertex or element.
minValue
number the minimum value used for the contour. If
rangeValues
was specified, this is the first entry of that array.maxValue
number the maximum value used for the contour. If
rangeValues
was specified, this is the last entry of that array.factor
number If linear value scaling is used, this is the number of color values divided by the difference between the maximum and minimum values. It is ignored if non-linear value scaling is used.
minColor
geo.geoColorObject The color used for values below minValue. Includes opacity.
maxColor
geo.geoColorObject The color used for values above maxValue. Includes opacity.
colorMap
Array.<geo.geoColorObject> The specified
colorRange
andopacityRange
converted into objects that include opacity.elementValues
boolean Truthy if the
value
andopacity
are for elements, falsy for vertices.shape
string One of
'triangle'
or'square'
. Ifsquare
, each pair of elements is one square. These elements have vertices v00, v01, v02, v10, v11, v12. The square is formed via v00-v01-v10-v11-v00. Fortriangle
, each element stands alone.elements
Array.<number> A packed array of indices into the
pos
array defining the elements. Each sequential three values forms a triangle.elementIndex
Array.<number> An array that has one value for each triplet of values in the
elements
array. The value is the 0-based index of the element that can be used to correspond it to element-based parameters.index
Array.<number> An array that references which data index is associated with each vertex.
pos
Array.<number> A packed array of coordinates in the interface gcs for the vertices. This is in the order x0, y0, z0, x1, y1, z2, x2, ...
numberVertices
number the number of vertices in the mesh.
numberElementsthe
number number of elements (squares or triangles) in the mesh.
verticesPerElement
number 3 for triangles, 6 for squares.
-
geo.contourFeature.contourSpecgeo.meshFeature.meshSpec
-
Contour specification. All of these properties can be functions, which get passed the
geo.meshFeature.meshInfo
object.Properties:
Name Type Argument Default Description min
number <optional>
Minimum contour value. If unspecified, taken from the computed minimum of the
value
style.max
number <optional>
Maximum contour value. If unspecified, taken from the computed maximum of the
value
style.minColor
geo.geoColor <optional>
'black' Color used for any value below the minimum.
minOpacity
number <optional>
0 Opacity used for any value below the minimum.
maxColor
geo.geoColor <optional>
'black' Color used for any value above the maximum.
maxOpacity
number <optional>
0 Opacity used for any value above the maximum.
stepped
boolean <optional>
If falsy but not
undefined
, smooth transitions between colors.colorRange
Array.<geo.geoColor> <optional>
<color table> An array of colors used to show the range of values. The default is a 9-step color table.
opacityRange
Array.<number> <optional>
An array of opacities used to show the range of values. If unspecified, the opacity is 1. If this is a shorter list than the
colorRange
, an opacity of 1 is used for the entries near the end of the color range.rangeValues
Array.<number> <optional>
An array used to map values to the
colorRange
. By default, values are spaced linearly. If specified, the entries must be increasing weakly monotonic, and there must be one more entry then the length ofcolorRange
if the contour is stepped, or the same length as thecolorRange
if unstepped.elements
Array.<number> | Array.<Array.<number>> <optional>
If specified, a list of indices into the data array that form elements. If this is an array of arrays, each subarray must have at least either 3 values for triangular elements or 4 values for square elements. If this is a single array, the data indices are of all elements are packed one after another and the
elementPacking
property is used to determine element shape. If thisnull
orundefined
, a rectangular grid of squares is used based ongridWidth
andgridHeight
or an implicit version of those parameters.elementPacking
string <optional>
'auto' If
elements
is provided as a single array, this determines the shape of the elements. It is one ofauto
,triangle
, orsquare
.triangle
uses triplets of values to define elements.square
uses quads of values.auto
is identical totriangle
unlesselements
's length is a multiple of 4 and not a multiple of 3, in which case it is the same assquare
.gridWidth
number <optional>
The number of data columns in the grid. If this is not specified and
gridHeight
is given, this is the number of data elements divided bygridHeight
. If neithergridWidth
norgridHeight
are specified, the squareroot of the number of data elements is used. If both are specified, some data could be unused. Ignored ifelements
is used.gridHeight
number <optional>
The number of data rows in the grid. If this is not specified and
gridWidth
is given, this is the number of data elements divided bygridWidth
. If neithergridWidth
notgridHeight
are specified, the squareroot of the number of data elements is used. If both are specified, some data could be unused. Ignored ifelements
is used.x0
number <optional>
The x coordinate of the 0th data point. If
null
orundefined
, the coordinate is taken from theposition
style. Ignored ifelements
is used.y0
number <optional>
The y coordinate of the 0th data point. If
null
orundefined
, the coordinate is taken from theposition
style. Ignored ifelements
is used.dx
number <optional>
The distance in the x direction between the 0th and 1st data point. This may be positive or negative. If 0,
null
, orundefined
, the coordinate is taken from theposition
style. Ignored ifelements
is used.dy
number <optional>
The distance in the y direction between the 0th and
gridWidth
th data point. This may be positive or negative. If 0,null
, orundefined
, the coordinate is taken from theposition
style. Ignored ifelements
is used.wrapLongitude
boolean <optional>
true If truthy and
position
is not used (elements
is not used andx0
,y0
,dx
, anddy
are all set appropriately), assume the x coordinates are longitude and should be adjusted to be within -180 to 180. If the data spans 180 degrees, the points or squares that straddle the meridian will be duplicated to ensure that the map is covered from -180 to 180 as appropriate. Set this tofalse
if using a non-longitude x coordinate. -
geo.contourFeature.specgeo.feature.spec
-
Contour feature specification.
Properties:
Name Type Argument Default Description data
Array.<object> <optional>
[] An array of arbitrary objects used to construct the feature.
style
geo.contourFeature.styleSpec <optional>
An object that contains style values for the feature.
contour
geo.contourFeature.contourSpec <optional>
The contour specification for the feature.
layer
geo.layer <optional>
the parent layer associated with the feature.
selectionAPI
boolean | 'auto' <optional>
'auto' If
'auto'
, enable selection events if anygeo.event.feature
events are bound to the feature. Otherwise, if truthy, enable selection events on the feature. Selection events are those ingeo.event.feature
. They can be bound via a call likefeature.geoOn(geo.event.feature.mousemove, function (evt) { // do something with the feature });
where the handler is passed a
geo.event.feature
object.visible
boolean <optional>
true If truthy, show the feature. If falsy, hide the feature and do not allow interaction with it.
gcs
string <optional>
The interface gcs for this feature. If
undefined
ornull
, this uses the layer's interface gcs. This is a string used bygeo.transform
.bin
number <optional>
null The bin number is used to determine the order of multiple features on the same layer. It has no effect except on the webgl renderer. A negative value hides the feature without stopping interaction with it. Otherwise, more features with higher bin numbers are drawn above those with lower bin numbers. If two features have the same bin number, their order relative to one another is indeterminate and may be unstable. A value of
null
will use the current position of the feature within its parent's list of children as the bin number.renderer
geo.renderer <optional>
A reference to the renderer used for the feature. If
null
or unset or identical tolayer.renderer()
, the layer's renderer is used. -
geo.contourFeature.styleSpecgeo.feature.styleSpec
-
Style specification for a contour feature.
Properties:
Name Type Argument Default Description position
geo.geoPosition | function <optional>
data The position of each data element. This defaults to just using
x
,y
, andz
properties of the data element itself. The position is in the feature's gcs coordinates.value
number | function <optional>
data.z The value of each data element. This defaults to the
z
property of the data elements. If the value of a grid point isnull
orundefined
, the point and elements that use that point won't be included in the results.opacity
number | function <optional>
1 The opacity for the whole feature on a scale of 0 to 1.
origin
Array.<number> | function <optional>
Origin in map gcs coordinates used for to ensure high precision drawing in this location. When called as a function, this is passed the vertex positions as a single continuous array in map gcs coordinates. It defaults to the first vertex used in the contour.
Members
-
inherited idle
-
Getter for the idle state. Read only.
Properties:
Name Type Description idle
boolean true
if the object is idle (onIdle
would call a handler immediately). -
inherited ready
-
Properties:
Name Type Description ready
boolean true
if this feature has been initialized,false
if it was destroyed,undefined
if it was created but not initialized.
Methods
-
inherited addChild(child){this}
-
Add a child (or an array of children) to the object.
Name Type Description child
geo.object | Array.<geo.object> A child object or array of child objects.
Returns:
Type Description this -
inherited addPromise(promise){this}
-
Add the promise here and also propagate up the scene tree.
Name Type Description promise
Promise A promise object.
Returns:
Type Description this -
inherited bin(val, actualValue){number|this}
-
Get/Set bin of the feature. The bin number is used to determine the order of multiple features on the same layer. It has no effect except on the webgl renderer. A negative value hides the feature without stopping interaction with it. Otherwise, features with higher bin numbers are drawn above those with lower bin numbers. If two features have the same bin number, their order relative to one another is indeterminate and may be unstable.
Name Type Description val
number optional The new bin number. If
undefined
, return the current bin number. Ifnull
, the bin is dynamically computed based on order within the parent. If children are nested, this may not be what is desired.actualValue
boolean optional If truthy and
val
is undefined, return the actual value of bin, rather than the dynamically computed value.Returns:
Type Description number | this The current bin number or a reference to this
. -
inherited boxSearch(lowerLeft, upperRight, opts, gcs){geo.feature.searchResult}
-
Search for features contained within a rectangular region.
Name Type Description lowerLeft
geo.geoPosition Lower-left corner.
upperRight
geo.geoPosition Upper-right corner.
opts
object optional Additional search options.
Name Type Default Description partial
boolean false optional If truthy, include features that are partially in the box, otherwise only include features that are fully within the region.
gcs
string | geo.transform | null optional Input gcs.
undefined
to use the interface gcs,null
to use the map gcs, or any other transform.Returns:
Type Description geo.feature.searchResult An object with a list of features and feature indices that are located at the specified point. -
inherited buildTime(val){geo.timestamp|this}
-
Get/Set timestamp of last time a build happened.
Name Type Description val
geo.timestamp optional The new build timestamp object or
undefined
to get the current build timestamp object.Returns:
Type Description geo.timestamp | this -
inherited children(){Array.<geo.object>}
-
Get an array of the child objects.
Returns:
Type Description Array.<geo.object> A copy of the array of child objects. -
inherited contour(specOrProperty, value){geo.meshFeature.meshSpec|object|this}
-
Get/Set mesh accessor.
Name Type Description specOrProperty
string | geo.meshFeature.meshSpec optional If
undefined
, return the current mesh specification. If a string is specified, either get or set the named mesh property. If an object is given, set or update the specification with the specified parameters.value
object optional If
specOrProperty
is a string, set that property tovalue
. Ifundefined
, return the current value of the named property.Returns:
Type Description geo.meshFeature.meshSpec | object | this The current mesh specification, the value of a named mesh property, or this mesh object. -
inherited data(data){array|this}
-
Get/Set the data array for the feature. This is equivalent to getting or setting the
data
style, except that setting the data array via this method updates the data timestamp, whereas setting it via the style does not.Name Type Description data
array optional A new data array or
undefined
to return the existing array.Returns:
Type Description array | this -
inherited dataTime(val){geo.timestamp|this}
-
Get/Set timestamp of data change.
Name Type Description val
geo.timestamp optional The new data timestamp object or
undefined
to get the current data timestamp object.Returns:
Type Description geo.timestamp | this -
inherited dependentFeatures(arg){Array.<geo.feature>|this}
-
Get/Set a list of dependent features. Dependent features have their visibility changed at the same time as the feature.
Name Type Description arg
Array.<geo.feature> optional If specified, the new list of dependent features. Otherwise, return the current list of dependent features.
Returns:
Type Description Array.<geo.feature> | this The current list of dependent features or a reference to this
. -
inherited draw(arg){this}
-
Force redraw of a scene object, to be implemented by subclasses. Base class just calls draw of child objects.
Name Type Description arg
object Options to pass to the child draw functions.
Returns:
Type Description this -
inherited featureGcsToDisplay(c){geo.screenPosition}
-
Convert from the feature's gcs coordinates to display coordinates.
Name Type Description c
geo.geoPosition The input coordinate to convert.
Returns:
Type Description geo.screenPosition Display space coordinates. -
inherited gcs(val){string|this}
-
Get/Set the projection of the feature.
Name Type Description val
string optional nullable If
undefined
, return the current gcs. Ifnull
, use the map's interface gcs. Otherwise, set a new value for the gcs.Returns:
Type Description string | this A string used by geo.transform
. If the map interface gcs is in use, that value will be returned. If the gcs is set, return the current class instance. -
Report if an event handler is bound to this object.
Name Type Description event
string | Array.<string> An event or list of events to check.
handler
function optional A function that might be bound. If
undefined
, this will reporttrue
if there is any handler for the specified event.Returns:
Type Description boolean true if any of the specified events are bound to the specified handler. -
inherited geoOff(event, arg){this}
-
Remove handlers from one event or an array of events. If no event is provided all handlers will be removed.
Name Type Description event
string | Array.<string> optional An event or a list of events from
geo.event
or defined by the user, orundefined
to remove all events (in which casearg
is ignored).arg
function | Array.<function()> optional nullable A function or array of functions to remove from the events or a falsy value to remove all handlers from the events.
Returns:
Type Description this -
inherited geoOn(event, handler){this}
-
Bind an event handler to this object.
Name Type Description event
string An event from
geo.event
or a user-defined value.handler
function A function that is called when
event
is triggered. The function is passed ageo.event
object.Returns:
Type Description this -
Bind an event handler to this object that will fire once and then deregister itself.
Name Type Description event
string An event from
geo.event
or a user-defined value.handler
function A function that is called when
event
is triggered. The function is passed ageo.event
object.Returns:
Type Description function The actual bound handler. This is a wrapper around the handler that was passed to the function. -
inherited geoTrigger(event, args, childrenOnly){this}
-
Trigger an event (or events) on this object and call all handlers.
Name Type Description event
string The event to trigger.
args
object Arbitrary argument to pass to the handler.
childrenOnly
boolean optional If truthy, only propagate down the tree.
Returns:
Type Description this -
Get the layer referenced by the feature.
Returns:
Type Description geo.layer The layer associated with the feature. -
inherited mesh(specOrProperty, value){geo.meshFeature.meshSpec|object|this}
-
Get/Set mesh accessor.
Name Type Description specOrProperty
string | geo.meshFeature.meshSpec optional If
undefined
, return the current mesh specification. If a string is specified, either get or set the named mesh property. If an object is given, set or update the specification with the specified parameters.value
object optional If
specOrProperty
is a string, set that property tovalue
. Ifundefined
, return the current value of the named property.Returns:
Type Description geo.meshFeature.meshSpec | object | this The current mesh specification, the value of a named mesh property, or this mesh object. -
inherited mesh.get(key){object|function}
-
A uniform getter that always returns a function even for constant values. If undefined input, return all the mesh values as an object.
Name Type Description key
string | undefined The name of the mesh key or
undefined
to return an object with all keys as functions.Returns:
Type Description object | function A function related to the key, or an object with all mesh keys, each of which is a function. -
inherited modified(){this}
-
Update the timestamp to the next global timestamp value.
Returns:
Type Description this -
inherited mouseOverOrderHighestIndex(evt)
-
If the selectionAPI is on, then setting
this.geoOn(geo.event.feature.mouseover_order, this.mouseOverOrderHighestIndex)
will make it so that the mouseon events prefer the highest index feature.Name Type Description evt
geo.event The event; this should be triggered from
geo.event.feature.mouseover_order
. -
Bind a handler that will be called one time when all internal promises are resolved. If there are no outstanding promises, this is invoked synchronously.
Name Type Description handler
function A function taking no arguments.
Returns:
Type Description this -
inherited parent(arg){this|geo.sceneObject}
-
Get/set parent of the object.
Name Type Description arg
geo.sceneObject optional The new parant or
undefined
to get the current parent.Returns:
Type Description this | geo.sceneObject -
inherited pointSearch(geo, gcs){geo.feature.searchResult}
-
Search for features containing the given point. This should be defined in relevant subclasses.
Name Type Description geo
geo.geoPosition Coordinate.
gcs
string | geo.transform | null optional Input gcs.
undefined
to use the interface gcs,null
to use the map gcs, or any other transform.Returns:
Type Description geo.feature.searchResult An object with a list of features and feature indices that are located at the specified point. -
inherited polygonSearch(poly, opts, gcs){geo.feature.searchResult}
-
Search for features contained within a polygon. This should be defined in relevant subclasses.
Name Type Description poly
geo.polygonObject A polygon as an array of coordinates or an object with
outer
and optionallyinner
parameters.opts
object optional Additional search options.
Name Type Default Description partial
boolean false optional If truthy, include features that are partially in the polygon, otherwise only include features that are fully within the region.
gcs
string | geo.transform | null optional Input gcs.
undefined
to use the interface gcs,null
to use the map gcs, or any other transform.Returns:
Type Description geo.feature.searchResult An object with a list of features and feature indices that are located at the specified point. -
inherited position(val){array|function|this}
-
Get/Set position accessor. This is identical to getting or setting the
position
style.Name Type Description val
array | function optional If specified, set the position style. If
undefined
, return the current value.Returns:
Type Description array | function | this Either the position style or this. -
inherited removeChild(child){this}
-
Remove a child (or array of children) from the object.
Name Type Description child
geo.object | Array.<geo.object> A child object or array of child objects.
Returns:
Type Description this -
inherited removePromise(promise){this}
-
Remove the promise here and also propagate up the scene tree.
Name Type Description promise
Promise A promise object.
Returns:
Type Description this -
inherited renderer(){geo.renderer}
-
Get the renderer used by the feature.
Returns:
Type Description geo.renderer The renderer used to render the feature. -
inherited selectionAPI(arg, direct){boolean|string|this}
-
Get/Set if the selection API is enabled for this feature.
Name Type Description arg
boolean | string optional undefined
to return the selectionAPI state, a boolean to change the state, or'auto'
to set the state based on the existence of event handlers. When getting the state, ifdirect
is not specified,'auto'
is never returned.direct
boolean optional If
true
, when getting the selectionAPI state, disregard the state of the parent layer, and when setting, refresh the state regardless of whether it has changed or not.Returns:
Type Description boolean | string | this Either the selectionAPI state or the feature instance. -
inherited style(arg1, arg2){object|this}
-
Get/Set style used by the feature. Styles can be constant values or functions. If a function, the style is typically called with parameters such as
(dataElement, dataIndex)
or, if the specific style of a feature has a subfeature style, with(subfeatureElement, subfeatureIndex, dataElement, dataIndex)
.See the style specification
styleSpec
for available styles.Name Type Description arg1
string | object optional If
undefined
, return the current style object. If a string andarg2
is undefined, return the style associated with the specified key. If a string andarg2
is defined, set the named style to the specified value. Otherwise, extend the current style with the values in the specified object.arg2
* optional If
arg1
is a string, the new value for that style.Returns:
Type Description object | this Either the entire style object, the value of a specific style, or the current class instance. -
inherited style.get(key){function|object}
-
A uniform getter that always returns a function even for constant styles. This can also return all defined styles as functions in a single object.
If the style
key
is a color, the returned function will also coerce the result to be ageo.geoColorObject
.Name Type Description key
string optional If defined, return a function for the named style. Otherwise, return an object with a function for all defined styles.
Returns:
Type Description function | object Either a function for the named style or an object with functions for all defined styles. -
inherited timestamp(){number}
-
Get time.
Returns:
Type Description number The timestamp. This is 0 if the timestamp has never been modified. -
inherited updateStyleFromArray(keyOrObject, styleArray, refresh){this}
-
Set style(s) from array(s). For each style, the array should have one value per data item. The values are not converted or validated. Color values should be
geo.geoColorObject
s. If invalid values are given the behavior is undefined. For some feature styles, if the first entry of an array is itself an array, then each entry of the array is expected to be an array, and values are used from these subarrays. This allows a style to apply, for instance, per vertex of a data item rather than per data item.Name Type Default Description keyOrObject
string | object Either the name of a single style or an object where the keys are the names of styles and the values are each arrays.
styleArray
array If keyOrObject is a string, an array of values for the style. If keyOrObject is an object, this parameter is ignored.
refresh
boolean false optional true
to redraw the feature when it has been updated. If an object with styles is passed, the redraw is only done once.Returns:
Type Description this The feature instance. -
inherited updateTime(val){geo.timestamp|this}
-
Get/Set timestamp of last time an update happened.
Name Type Description val
geo.timestamp optional The new update timestamp object or
undefined
to get the current update timestamp object.Returns:
Type Description geo.timestamp | this -
inherited visible(val, direct){boolean|this}
-
Get/Set the visibility of the feature.
Name Type Description val
boolean optional A boolean to change the visibility, or
undefined
to return the visibility.direct
boolean optional If
true
, when getting the visibility, disregard the visibility of the parent layer, and when setting, refresh the state regardless of whether it has changed or not. Otherwise, the functional visibility is returned, where both the feature and the layer must be visible for atrue
result.Returns:
Type Description boolean | this Either the visibility (if getting) or the feature (if setting).