Class: isolineFeature

geo. isolineFeature

new geo.isolineFeature(arg){geo.isolineFeature}

Create a new instance of class isolineFeature.

Name Type Description
arg geo.isolineFeature.spec
Returns:
Type Description
geo.isolineFeature

Extends

Type Definitions

geo.isolineFeature.isolineInfoobject

Computed isoline information.

Properties:
Name Type Description
values Array.<geo.isolineFeature.valueEntry>

The values used to produce the isolines.

mesh geo.meshFeature.meshInfo

The normalized mesh.

lines Array.<array>

An array of arrays. Each entry is a list of vertices that also have a value property with the appropriate entry in values. If the line should show a label, it will also have a label property with the text of the label.

hasLabels boolean

true if there are any lines that have labels that need to be shown if there is enough resolution.

geo.isolineFeature.isolineSpecgeo.meshFeature.meshSpec

Isoline 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 isoline value. If unspecified, taken from the computed minimum of the value style.

max number <optional>

Maximum isoline value. If unspecified, taken from the computed maximum of the value style.

count number <optional>
15

Approximate number of isolines shown through the value range. Used if spacing or values is not specified.

autofit boolean <optional>
true

If count is used to determine the isolines, and this is truthy, the isoline values will be round numbers. If falsy, they will include the exact minimum and maximum values.

spacing number <optional>

Distance in value units between isolines. Used if specified and values is not specified.

values Array.<number> | Array.<geo.isolineFeature.valueEntry> <optional>

An array of explicit values for isolines.

levels Array.<number> <optional>
[5, 5]

If values is not used to explicitly set isoline levels, this determines the spacing of levels which can be used to style lines distinctly. Most isolines will be level 0. If levels is an array of [n0, n1, ...], every n0th line will be level 1, every n0 * n1th line will be level 2, etc.

label boolean | function <optional>

Truthy if a label should be shown for a isoline value. If a function, this is called with (geo.isolineFeature.valueEntry, index). This defaults to valueEntry.level >= 1.

labelText string | function <optional>

Text for a label. If a function, this is called with (geo.isolineFeature.valueEntry, index). This defaults to valueEntry.value.

labelSpacing number | function <optional>
200

Minimum distance between labels on an isoline in screen pixels. If a function, this is called with (geo.isolineFeature.valueEntry, index).

labelOffset number | function <optional>
0

Offset for labels along an isoline relative to where they would be placed by default on a scale of [-0.5, 0.5]. +/- 1 would move the text to the next repeated occurance of the label. If a function, this is called with (geo.isolineFeature.valueEntry, index).

labelViewport number | function <optional>
10000

If the main position of a label would be further than this many pixels from the current viewport, don't create it. This prevents creating an excessive number of labels when zoomed in, but requires regenerating labels occasionally when panning. If <= 0, all labels are generated regardless of location.

labelAutoUpdate boolean | function <optional>
true

If truthy, when the map is panned (including zoom, rotation, etc.), periodically regenerate labels. This uses an internal function that has a threshold based on a fixed change in zoom, size, and other parameters. Set labelAutoUpdate to false and handle the geo.event.pan elsewhere.

geo.isolineFeature.specgeo.feature.spec

Isoline feature specification.

Properties:
Name Type Argument Default Description
data Array.<object> <optional>
[]

An array of arbitrary objects used to construct the feature.

style geo.isolineFeature.styleSpec <optional>

An object that contains style values for the feature.

isoline geo.isolineFeature.isolineSpec <optional>

The isoline specification for the feature.

geo.isolineFeature.styleSpecgeo.feature.styleSpec

Style specification for an isoline feature. Extends geo.lineFeasture.styleSpec and geo.textFeasture.styleSpec.

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, and z 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 is null or undefined, the point and elements that use that point won't be included in the results.

strokeColor geo.geoColor | function <optional>
'black'

Color to stroke each line.

strokeWidth number | function <optional>

The weight of the line stroke in pixels. This defaults to the line value's level + 0.5.

rotateWithMap boolean | function <optional>
true

Rotate label text when the map rotates.

rotation number | function <optional>

Text rotation in radians. This defaults to the label oriented so that top of the text is toward the higher value. There is a utility function that can be used for common rotation preferences. See geo.isolineFeature#rotationFunction. For instance, rotation=geo.isolineFeature.rotationFunction('map').

fontSize string | function <optional>
'12px'

The font size.

textStrokeColor geo.geoColor | function <optional>
'white'

Text stroke color. This adds contrast between the label and the isoline.

textStrokeWidth geo.geoColor | function <optional>
2

Text stroke width in pixels.

strokeOpacity number | function <optional>

Opacity for each line stroke. The opacity can vary by point. Opacity is on a [0-1] scale.

strokeOffset number | function <optional>

This is a value from -1 (left) to 1 (right), with 0 being centered. This can vary by point.

lineCap string | function <optional>
'butt'

One of 'butt', 'square', or 'round'. This can vary by point.

lineJoin string | function <optional>
'miter'

One of 'miter', 'bevel', 'round', or 'miter-clip'. This can vary by point.

closed boolean | function <optional>
false

If true and the renderer supports it, connect the first and last points of a line if the line has more than two points. This applies per line (if a function, it is called with (lineEntry, lineEntryIndex).

miterLimit number | function <optional>
10

For lines of more than two segments that are mitered, if the miter length exceeds the strokeWidth divided by the sine of half the angle between segments, then a bevel join is used instead. This is a single value that applies to all lines. If a function, it is called with (data).

antialiasing number | function <optional>

Antialiasing distance in pixels. Values must be non-negative. A value greater than 1 will produce a visible gradient. This is a single value that applies to all lines.

debug string | function <optional>

If 'debug', render lines in debug mode. This is a single value that applies to all lines.

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 line's first vertex's position.

visible boolean | function <optional>
true

If falsy, don't show this data element.

font string | function <optional>

A css font specification. This is of the form [style] [variant] [weight] [stretch] size[/line-height] family. Individual font styles override this value if a style is specified in each. See the individual font styles for details.

fontStyle string | function <optional>
'normal'

The font style. One of normal, italic, or oblique.

fontVariant string | function <optional>
'normal'

The font variant. This can have values such as small-caps or slashed-zero.

fontWeight string | function <optional>
'normal'

The font weight. This may be a numeric value where 400 is normal and 700 is bold, or a string such as bold or lighter.

fontStretch string | function <optional>
'normal'

The font stretch, such as condensed.

lineHeight string | function <optional>
'normal'

The font line height.

fontFamily string | function <optional>

The font family.

textAlign string | function <optional>
'center'

The horizontal text alignment. One of start, end, left, right, or center.

textBaseline string | function <optional>
'middle'

The vertical text alignment. One of top, hanging, middle, alphabetic, ideographic, or bottom.

color geo.geoColor | function <optional>
'black'

Text color. May include opacity.

textOpacity number | function <optional>
1

The opacity of the text. If the color includes opacity, this is combined with that value.

textScaled number | function <optional>

If defined, the text is scaled when the map zooms and this is the basis zoom for the fontSize.

offset geo.screenPosition | function <optional>

Offset from the default position for the text. This is applied before rotation.

shadowColor geo.geoColor | function <optional>
'black'

Text shadow color. May include opacity.

shadowOffset geo.screenPosition | function <optional>

Offset for a text shadow. This is applied before rotation.

shadowBlur number | null | function <optional>

If not null, add a text shadow with this much blur.

shadowRotate boolean | function <optional>
false

If truthy, rotate the shadow offset based on the text rotation (the shadowOffset is the offset if the text has a 0 rotation).

renderThreshold number | function <optional>

If this is a positive number, text elements may not be rendered if their base position (before offset and font effects are applied) is more than this distance in pixels outside of the current viewport. If it is known that such text elements cannot affect the current viewport, setting this can speed up rendering. This is computed once for the whole feature.

geo.isolineFeature.valueEntryobject

Isoline value entry.

Properties:
Name Type Argument Description
value number

The value of the isoline.

level number

The level of the isoline.

position number <optional>

An index of the position of the isoline. For evenly spaced or autofit values, this is the value modulo the spacing. Otherwise, this is the index position within the list of values. This is computed when calculating isolines.

label string <optional>

The label to display on this value. This is computed from the label and labelText styles when calculating isolines.

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.

Static Methods

staticgeo.isolineFeature.rotationFunction(mode, map){function}

Return a function that will rotate text labels in a specified orientation. The results of this are intended to be used as the value of the rotation style.

Name Type Default Description
mode string 'higher' optional

The rotation mode. higher orients the top of the text to high values. lower orients the top of the text to lower values. map orients the top of the text so it is aligned to the isoline and biased toward the top of the map. screen orients the top of the text so it is aligned to the isoline and biased toward the top of the display screen.

map geo.map optional

The parent map. Required for screen mode.

Returns:
Type Description
function A function for the rotation style.

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. If null, 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){geo.feature.searchResult}

Search for features contained within a rectangular region.

Name Type Description
lowerLeft geo.geoPosition

Lower-left corner in gcs coordinates.

upperRight geo.geoPosition

Upper-right corner in gcs coordinates.

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.

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

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 to value. If undefined, 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

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.

draw(){object}

Redraw the object.

Returns:
Type Description
object The results of the superclass draw function.

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. If null, 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.

inherited geoIsOn(event, handler){boolean}

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 report true 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, or undefined to remove all events (in which case arg 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 a geo.event object.

Returns:
Type Description
this

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

inherited isoline(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 to value. If undefined, 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.

labelPositions(){this}

Compute the positions for labels on each line. This can be called to recompute label positions without needign to recompute isolines, for instance when the zoom level changes. Label positions are computed in the map gcs coordinates, not interface gcs coordinates, since the interface gcs may not be linear with the display space.

Returns:
Type Description
this

lastLabelPositions(){object}

Get the last map position that was used for generating labels.

Returns:
Type Description
object An object with the map zoom and center and the labelViewport used in generating labels. The object may have no properties if there are no labels.

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 to value. If undefined, 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.

modified(){object}

Update the timestamp to the next global timestamp value. Mark sub-features as modified, too.

Returns:
Type Description
object The results of the superclass modified function.

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.

inherited onIdle(handler){this}

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

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

Search for features containing the given point. This should be defined in relevant subclasses.

Name Type Description
geo geo.geoPosition

Coordinate in interface gcs.

Returns:
Type Description
geo.feature.searchResult An object with a list of features and feature indices that are located at the specified point.

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 optionally inner parameters. All coordinates are in map interface gcs.

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.

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

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, if direct 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 and arg2 is undefined, return the style associated with the specified key. If a string and arg2 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 a geo.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.geoColorObjects. 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 a true result.

Returns:
Type Description
boolean | this Either the visibility (if getting) or the feature (if setting).