heatmapFeature

geo. heatmapFeature

new heatmapFeature(arg) → {geo.heatmapFeature}

Description:
  • Create a new instance of class heatmapFeature.

Source:
Parameters:
Name Type Description
arg geo.heatmapFeature.spec

Feature specification.

Returns:
Type
geo.heatmapFeature

Extends

Members

idle

Description:
  • Getter for the idle state. Read only.

Source:
Inherited From:
Properties:
Name Type Description
idle boolean

true if the object is idle (onIdle would call a handler immediately).

Getter for the idle state. Read only.

ready

Source:
Inherited From:
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

addChild(child) → {this}

Description:
  • Add a child (or an array of children) to the object.

Source:
Inherited From:
Parameters:
Name Type Description
child geo.object | Array.<geo.object>

A child object or array of child objects.

Returns:
Type
this

addPromise(promise) → {this}

Description:
  • Add the promise here and also propagate up the scene tree.

Source:
Inherited From:
Parameters:
Name Type Description
promise Promise

A promise object.

Returns:
Type
this

bin(valopt, actualValueopt) → {number|this}

Description:
  • 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.

Source:
Inherited From:
Parameters:
Name Type Attributes 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:

The current bin number or a reference to this.

Type
number | this

binned(valopt) → {boolean|number|'auto'|this}

Description:
  • Get/Set binned value.

Source:
Parameters:
Name Type Attributes Description
val boolean | number | 'auto' <optional>

If not specified, return the current binned value. If true or a number, spatially bin data as part of producing the heatmap. If falsy, each datapoint stands on its own. If 'auto', bin data if there are more data points than there would be bins. Using true or auto uses bins that are max(Math.floor((radius + blurRadius) / 8), 3).

Returns:
Type
boolean | number | 'auto' | this

boxSearch(lowerLeft, upperRight, optsopt, gcsopt) → {geo.feature.searchResult}

Description:
  • Search for features contained within a rectangular region.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
lowerLeft geo.geoPosition

Lower-left corner.

upperRight geo.geoPosition

Upper-right corner.

opts object <optional>

Additional search options.

Properties
Name Type Attributes Default Description
partial boolean <optional>
false

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:

An object with a list of features and feature indices that are located at the specified point.

Type
geo.feature.searchResult

buildTime(valopt) → {geo.timestamp|this}

Description:
  • Get/Set timestamp of last time a build happened.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
val geo.timestamp <optional>

The new build timestamp object or undefined to get the current build timestamp object.

Returns:
Type
geo.timestamp | this

children() → {Array.<geo.object>}

Description:
  • Get an array of the child objects.

Source:
Inherited From:
Returns:

A copy of the array of child objects.

Type
Array.<geo.object>

data(dataopt) → {array|this}

Description:
  • 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.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
data array <optional>

A new data array or undefined to return the existing array.

Returns:
Type
array | this

dataTime(valopt) → {geo.timestamp|this}

Description:
  • Get/Set timestamp of data change.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
val geo.timestamp <optional>

The new data timestamp object or undefined to get the current data timestamp object.

Returns:
Type
geo.timestamp | this

dependentFeatures(argopt) → {Array.<geo.feature>|this}

Description:
  • Get/Set a list of dependent features. Dependent features have their visibility changed at the same time as the feature.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
arg Array.<geo.feature> <optional>

If specified, the new list of dependent features. Otherwise, return the current list of dependent features.

Returns:

The current list of dependent features or a reference to this.

Type
Array.<geo.feature> | this

draw(arg) → {this}

Description:
  • Force redraw of a scene object, to be implemented by subclasses. Base class just calls draw of child objects.

Source:
Inherited From:
Parameters:
Name Type Description
arg object

Options to pass to the child draw functions.

Returns:
Type
this

featureGcsToDisplay(c) → {geo.screenPosition}

Description:
  • Convert from the feature's gcs coordinates to display coordinates.

Source:
Inherited From:
Parameters:
Name Type Description
c geo.geoPosition

The input coordinate to convert.

Returns:

Display space coordinates.

Type
geo.screenPosition

gcs(valopt, nullable) → {string|this}

Description:
  • Get/Set the projection of the feature.

Source:
Inherited From:
Parameters:
Name Type Attributes 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:

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.

Type
string | this

gcsPosition() → {geo.heatmap}

Description:
  • Get pre-computed gcs position accessor.

Source:
Returns:
Type
geo.heatmap

geoIsOn(event, handleropt) → {boolean}

Description:
  • Report if an event handler is bound to this object.

Source:
Inherited From:
Parameters:
Name Type Attributes 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:

true if any of the specified events are bound to the specified handler.

Type
boolean

geoOff(eventopt, argopt, nullable) → {this}

Description:
  • Remove handlers from one event or an array of events. If no event is provided all handlers will be removed.

Source:
Inherited From:
Parameters:
Name Type Attributes 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
this

geoOn(event, handler) → {this}

Description:
  • Bind an event handler to this object.

Source:
Inherited From:
Parameters:
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
this

geoOnce(event, handler) → {function}

Description:
  • Bind an event handler to this object that will fire once and then deregister itself.

Source:
Inherited From:
Parameters:
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:

The actual bound handler. This is a wrapper around the handler that was passed to the function.

Type
function

geoTrigger(event, args, childrenOnlyopt) → {this}

Description:
  • Trigger an event (or events) on this object and call all handlers.

Source:
Inherited From:
Parameters:
Name Type Attributes 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
this

intensity(valopt) → {function|this}

Description:
  • Get/Set intensity.

Source:
Parameters:
Name Type Attributes Description
val function <optional>

If not specified, the current intensity accessor. Otherwise, a function that returns the intensity of each data point.

Returns:
Type
function | this

layer() → {geo.layer}

Description:
  • Get the layer referenced by the feature.

Source:
Inherited From:
Returns:

The layer associated with the feature.

Type
geo.layer

maxIntensity(valopt) → {number|null|this}

Description:
  • Get/Set maxIntensity.

Source:
Parameters:
Name Type Attributes Description
val number | null <optional>

If not specified, return the current value. If a number, use this as the maximum intensity. If null, compute the maximum intensity.

Returns:
Type
number | null | this

minIntensity(valopt) → {number|null|this}

Description:
  • Get/Set minIntensity.

Source:
Parameters:
Name Type Attributes Description
val number | null <optional>

If not specified, return the current value. If a number, use this as the minimum intensity. If null, compute the minimum intensity.

Returns:
Type
number | null | this

modified() → {this}

Description:
  • Update the timestamp to the next global timestamp value.

Source:
Inherited From:
Returns:
Type
this

mouseOverOrderHighestIndex(evt)

Description:
  • 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.

Source:
Inherited From:
Parameters:
Name Type Description
evt geo.event

The event; this should be triggered from geo.event.feature.mouseover_order.

onIdle(handler) → {this}

Description:
  • 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.

Source:
Inherited From:
Parameters:
Name Type Description
handler function

A function taking no arguments.

Returns:
Type
this

parent(argopt) → {this|geo.sceneObject}

Description:
  • Get/set parent of the object.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
arg geo.sceneObject <optional>

The new parent or undefined to get the current parent.

Returns:
Type
this | geo.sceneObject

pointSearch(geo, gcsopt) → {geo.feature.searchResult}

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

Source:
Inherited From:
Parameters:
Name Type Attributes 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:

An object with a list of features and feature indices that are located at the specified point.

Type
geo.feature.searchResult

polygonSearch(poly, optsopt, gcsopt) → {geo.feature.searchResult}

Description:
  • Search for features contained within a polygon. This should be defined in relevant subclasses.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
poly geo.polygonObject

A polygon as an array of coordinates or an object with outer and optionally inner parameters.

opts object <optional>

Additional search options.

Properties
Name Type Attributes Default Description
partial boolean <optional>
false

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:

An object with a list of features and feature indices that are located at the specified point.

Type
geo.feature.searchResult

position(valopt) → {geo.geoPosition|function|this}

Description:
  • Get/Set position accessor.

Source:
Parameters:
Name Type Attributes Description
val geo.geoPosition | function <optional>

If not specified, return the current position accessor. If specified, use this for the position accessor and return this. If a function is given, this is called with (dataElement, dataIndex).

Returns:

The current position or this feature.

Type
geo.geoPosition | function | this

removeChild(child) → {this}

Description:
  • Remove a child (or array of children) from the object.

Source:
Inherited From:
Parameters:
Name Type Description
child geo.object | Array.<geo.object>

A child object or array of child objects.

Returns:
Type
this

removePromise(promise) → {this}

Description:
  • Remove the promise here and also propagate up the scene tree.

Source:
Inherited From:
Parameters:
Name Type Description
promise Promise

A promise object.

Returns:
Type
this

renderer() → {geo.renderer}

Description:
  • Get the renderer used by the feature.

Source:
Inherited From:
Returns:

The renderer used to render the feature.

Type
geo.renderer

selectionAPI(argopt, directopt) → {boolean|string|this}

Description:
  • Get/Set if the selection API is enabled for this feature.

Source:
Inherited From:
Parameters:
Name Type Attributes 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:

Either the selectionAPI state or the feature instance.

Type
boolean | string | this

style(arg1opt, arg2opt) → {object|this}

Description:
  • 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.

Source:
Inherited From:
Parameters:
Name Type Attributes 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:

Either the entire style object, the value of a specific style, or the current class instance.

Type
object | this

style.get(keyopt) → {function|object}

Description:
  • 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.

Source:
Inherited From:
Parameters:
Name Type Attributes 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:

Either a function for the named style or an object with functions for all defined styles.

Type
function | object

timestamp() → {number}

Description:
  • Get time.

Source:
Inherited From:
Returns:

The timestamp. This is 0 if the timestamp has never been modified.

Type
number

updateDelay(valopt) → {number|this}

Description:
  • Get/Set updateDelay.

Source:
Parameters:
Name Type Attributes Description
val number <optional>

If not specified, return the current update delay. If specified, this is the delay in milliseconds after a zoom, rotate, or pan event before recomputing the heatmap. If 0, this is double the last render time. If negative, it is roughly the last render time plus the absolute value of the specified number of refresh intervals.

Returns:
Type
number | this

updateStyleFromArray(keyOrObject, styleArray, refreshopt) → {this}

Description:
  • 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.

Source:
Inherited From:
Parameters:
Name Type Attributes 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 <optional>
false

true to redraw the feature when it has been updated. If an object with styles is passed, the redraw is only done once.

Returns:

The feature instance.

Type
this

updateTime(valopt) → {geo.timestamp|this}

Description:
  • Get/Set timestamp of last time an update happened.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
val geo.timestamp <optional>

The new update timestamp object or undefined to get the current update timestamp object.

Returns:
Type
geo.timestamp | this

visible(valopt, directopt) → {boolean|this}

Description:
  • Get/Set the visibility of the feature.

Source:
Inherited From:
Parameters:
Name Type Attributes 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:

Either the visibility (if getting) or the feature (if setting).

Type
boolean | this

Type Definitions

spec

Description:
  • Heatmap feature specification.

Source:
Properties:
Name Type Attributes Default Description
position geo.geoPosition | function <optional>

Position of the data. Default is (data).

intensity function <optional>

Scalar value of each data point. The scalar value must be a positive real number and is used to compute the weight for each data point.

maxIntensity number <optional>
null

Maximum intensity of the data. Maximum intensity must be a positive real number and is used to normalize all intensities within a dataset. If null, it is computed.

minIntensity number <optional>
null

Minimum intensity of the data. Minimum intensity must be a positive real number and is used to normalize all intensities within a dataset. If null, it is computed.

updateDelay number <optional>
-1

Delay in milliseconds after a zoom, rotate, or pan event before recomputing the heatmap. If 0, this is double the last render time. If negative, it is roughly the last render time plus the absolute value of the specified number of refresh intervals. compute a delay based on the last heatmap render time.

binned boolean | number | 'auto' <optional>
'auto'

If true or a number, spatially bin data as part of producing the heatmap. If falsy, each datapoint stands on its own. If 'auto', bin data if there are more data points than there would be bins. Using true or auto uses bins that are max(Math.floor((radius + blurRadius) / 8), 3).

style.color object <optional>

An object where the keys are numbers from [0-1] and the values are geo.geoColor. This is used to transform normalized intensity.

style.radius number <optional>
10

Radius of a point in pixels.

style.blurRadius number <optional>
10

Blur radius for each point in pixels.

style.gaussian boolean <optional>
true

If truthy, approximate a gaussian distribution for each point using a multi-segment linear radial approximation. The total weight of the gaussian area is approximately the 9/16 r^2. The sum of radius + blurRadius is used as the radius for the gaussian distribution.

scaleWithZoom boolean <optional>
false

If truthy, the value for radius and blurRadius scale with zoom. In this case, the values for radius and blurRadius are the values at zoom-level zero. If the scaled radius is less than 0.5 or more than 8192 screen pixels, the heatmap will not render.

layer geo.layer <optional>

the parent layer associated with the feature.

selectionAPI boolean | 'auto' <optional>
'auto'

If 'auto', enable selection events if any geo.event.feature events are bound to the feature. Otherwise, if truthy, enable selection events on the feature. Selection events are those in geo.event.feature. They can be bound via a call like

feature.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 or null, this uses the layer's interface gcs. This is a string used by geo.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 to layer.renderer(), the layer's renderer is used.

style geo.feature.styleSpec <optional>

An object that contains style values for the feature.

Heatmap feature specification.

Type: