Class: HeatMapLayer

HeatMapLayer(displayName, measuredLocations, numLevels)

A HeatMap layer for visualising an array of measured locations.

Constructor

new HeatMapLayer(displayName, measuredLocations, numLevels)

Constructs a HeatMap Layer. The default implementation uses gradient circles to display measured locations. The measure of the locations define the colors of the gradient.
Parameters:
Name Type Description
displayName String This layer's display name.
measuredLocations Array.<MeasuredLocation> An array of locations with measures to visualise.
numLevels Number Optional. If provided it specifies the amount of levels that will be generated for this layer.
Source:

Extends

Members

crossOrigin :string

Indicates whether credentials are sent when requesting images from a different origin. Allowed values are anonymous and use-credentials.
Type:
  • string
Inherited From:
Default Value:
  • anonymous
Source:
See:

detailControl :Number

Controls the level of detail switching for this layer. The next highest resolution level is used when an image's texel size is greater than this number of pixels, up to the maximum resolution of this layer.
Type:
  • Number
Inherited From:
Default Value:
  • 1.75
Source:

displayName :String

This layer's display name.
Type:
  • String
Overrides:
Default Value:
  • "Layer"
Source:

enabled :Boolean

Indicates whether to display this layer.
Type:
  • Boolean
Inherited From:
Default Value:
  • true
Source:

gradient :Object

Gradient of colours used to draw the points and derived from the scale, intervalType and the data. The colors are stored in an object, which has as keys the percentage from which the given color should be applied. The default object based on the default scale and intervalType (in case of CONTINUOUS the data are irrelevant): { "0": "blue", "0.2": "cyan", "0.4": "lime", "o.6": "yellow", "0.8": "red" }
Type:
  • Object
Source:

(readonly) inCurrentFrame :Boolean

Indicates whether elements of this layer were drawn in the most recently generated frame.
Type:
  • Boolean
Inherited From:
Source:

intervalType :HeatMapIntervalType

Type of interval to apply between the minimum and maximum values in the data. Default value is CONTINUOUS. The supported values are CONTINUOUS and QUANTILES
Type:
  • HeatMapIntervalType
Source:

maxActiveAltitude :Number

The eye altitude below which this layer is displayed, in meters.
Type:
  • Number
Inherited From:
Default Value:
  • Number.MAX_VALUE (always displayed)
Source:

minActiveAltitude :Number

The eye altitude above which this layer is displayed, in meters.
Type:
  • Number
Inherited From:
Default Value:
  • -Number.MAX_VALUE (always displayed)
Source:

opacity :Number

This layer's opacity, which is combined with the opacity of shapes within layers. Opacity is in the range [0, 1], with 1 indicating fully opaque.
Type:
  • Number
Inherited From:
Default Value:
  • 1
Source:

pickEnabled :Boolean

Indicates whether this layer is pickable.
Type:
  • Boolean
Inherited From:
Default Value:
  • true
Source:

radius :Number

Radius of a point in pixels. The default value is 12.5.
Type:
  • Number
Source:

retrievalQueueSize :Number

Controls how many concurrent tile requests are allowed for this layer.
Type:
  • Number
Inherited From:
Default Value:
  • WorldWind.configuration.layerRetrievalQueueSize
Source:

scale :Array.<String>

Array of colors representing the scale used when generating the gradients. The default value is ['blue', 'cyan', 'lime', 'yellow', 'red'].
Type:
  • Array.<String>
Source:

time :Date

The time to display. This property selects the layer contents that represents the specified time. If null, layer-type dependent contents are displayed.
Type:
  • Date
Inherited From:
Source:

Methods

(protected) calculateExtendedSector(sector, extensionFactorWidth, extensionFactorHeight) → {Object}

Calculates the new sector for which the data will be filtered and which will be drawn on the tile. The standard version just applies extension factor to the difference between minimum and maximum. The extension factor may differ between latitude and longitude.
Parameters:
Name Type Description
sector Sector Sector to use as basis for the extension.
extensionFactorWidth Number The factor to be applied on the width to get sector representing the right geographical area.
extensionFactorHeight Number The factor to be applied on the height to get sector representing the right geographical area.
Source:
Returns:
.sector New extended sector. .extensionFactorHeight The factor by which the area is changed on the latitude. .extensionFactorWidth The factor by which the area is changed on the longitude.
Type
Object

(protected) createHeatMapTile(data, options) → {HeatMapTile}

Overwrite this method if you want to use a custom implementation of tile used for displaying the data. In the default version the tile draws points as blurring circles coloured based on the gradient.
Parameters:
Name Type Description
data Array.<Object> Array of information constituting points in the map.
options Object
Properties
Name Type Description
sector Sector Sector with the geographical information for tile representation.
width Number Width of the Canvas to be created in pixels.
height Number Height of the Canvas to be created in pixels.
radius Number Radius of the data point in pixels.
incrementPerIntensity Number The ratio representing the 1 / measure for the maximum measure.
intensityGradient Object Gradient of colours used to draw the points and derived from the scale, intervalType and the data.
extendedWidth Number Minimal width that needs to be valid in the resulting object.
extendedHeight Number Minimal height that needs to be valid in the resulting object.
Source:
Returns:
Instance of the implementation of the HeatMapTile used for this instance of the layer.
Type
HeatMapTile

(protected) doRender(dc)

Subclass method called to display this layer. Subclasses should implement this method rather than the render method, which determines enable, pick and active altitude status and does not call this doRender method if the layer should not be displayed.
Parameters:
Name Type Description
dc DrawContext The current draw context.
Inherited From:
Source:

(protected) isLayerInView(dc) → {boolean}

Indicates whether this layer is within the current view. Subclasses may override this method and when called determine whether the layer contents are visible in the current view frustum. The default implementation always returns true.
Parameters:
Name Type Description
dc DrawContext The current draw context.
Inherited From:
Source:
Returns:
true If this layer is within the current view, otherwise false.
Type
boolean

isPrePopulated(wwd) → {Boolean}

Indicates whether this layer's level 0 tile images have been retrieved and associated with the tiles. Use prePopulate to initiate retrieval of level 0 images.
Parameters:
Name Type Description
wwd WorldWindow The WorldWindow associated with this layer.
Inherited From:
Source:
Throws:
If the specified WorldWindow is null or undefined.
Type
ArgumentError
Returns:
true if all level 0 images have been retrieved, otherwise false.
Type
Boolean

prePopulate(wwd)

Initiates retrieval of this layer's level 0 images. Use isPrePopulated to determine when the images have been retrieved and associated with the level 0 tiles. Pre-populating is not required. It is used to eliminate the visual effect of loading tiles incrementally, but only for level 0 tiles. An application might pre-populate a layer in order to delay displaying it within a time series until all the level 0 images have been retrieved and added to memory.
Parameters:
Name Type Description
wwd WorldWindow The WorldWindow for which to pre-populate this layer.
Inherited From:
Source:
Throws:
If the specified WorldWindow is null or undefined.
Type
ArgumentError

prePopulateCurrentTiles(wwd)

Initiates retrieval of this layer's tiles that are visible in the specified WorldWindow. Pre-populating is not required. It is used to eliminate the visual effect of loading tiles incrementally.
Parameters:
Name Type Description
wwd WorldWindow The WorldWindow for which to pre-populate this layer.
Inherited From:
Source:
Throws:
If the specified WorldWindow is null or undefined.
Type
ArgumentError

refresh()

Refreshes the data associated with this layer. The behavior of this function varies with the layer type. For image layers, it causes the images to be re-retrieved from their origin.
Inherited From:
Source:

render(dc)

Displays this layer. Subclasses should generally not override this method but should instead override the doRender method. This method calls that method after verifying that the layer is enabled, the eye point is within this layer's active altitudes and the layer is in view.
Parameters:
Name Type Description
dc DrawContext The current draw context.
Inherited From:
Source:

(protected) resourceUrlForTile(tile, imageFormat) → {String}

Returns the URL string for the resource.
Parameters:
Name Type Description
tile ImageTile The tile whose image is returned
imageFormat String The mime type of the image format desired.
Inherited From:
Source:
Returns:
The URL string, or null if the string can not be formed.
Type
String

(protected) retrieveTileImage(dc, tile, suppressRedraw)

Retrieves the image for the specified tile. Subclasses should override this method in order to retrieve, compute or otherwise create the image.
Parameters:
Name Type Description
dc DrawContext The current draw context.
tile ImageTile The tile for which to retrieve the resource.
suppressRedraw Boolean true to suppress generation of redraw events when an image is successfully retrieved, otherwise false.
Overrides:
Source: