L.supermap.heatMapLayer(name, loadWhileAnimating, colors, options)
Name | Type | Default | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
string |
The layer name. |
|||||||||||||||||||||||||||||||||||||
loadWhileAnimating |
boolean | true |
optional
Whether to redraw in real time. (It will occur when drawing large data elements, it is recommended to set this parameter to false). |
||||||||||||||||||||||||||||||||||||
colors |
Array.<string> | ['blue', 'cyan', 'lime', 'yellow', 'red'] |
optional
Color linear gradient array, the color value must be supported by canvas. |
||||||||||||||||||||||||||||||||||||
options |
Object |
Construction parameters.
|
Fires
Extends
Events
-
changelayer
HeatMapLayer.js, line 475 -
Triggered after the layer transparency update is successful.
Properties:
Name Type Description layer
L.supermap.heatMapLayer Layer.
property
string Changed layer properties.
-
featuresremoved
HeatMapLayer.js, line 428 -
Triggered after deleting features successfully.
Properties:
Name Type Description features
Array.<SuperMap.Feature.Vector> Event object.
succeed
boolean Whether the deletion is successful, false is a failure, and true is a success.
Methods
-
addFeatures(features)
HeatMapLayer.js, line 122 -
Add heat point information.
Name Type Description features
GeoJSONObject | L.supermap.heatMapFeature The array of features to be added, supporting the GeoJOSN specification data type and the HeatMapFeature format.
Example
var geojson = { "type": "FeatureCollection", "features": [ { "type": "feature", "geometry": { "type": "Point", //Only support point type "coordinates": [0, 0] }, "properties": { "height": Math.random()*9, "geoRadius": useGeoRadius?radius:null } } ] }; var heatMapLayer = new L.supermap.heatMapLayer("heatmaplayer",{"id":"heatmap"}); heatMapLayer.addFeatures(geojson);
-
getLocalXY(coordinate)
HeatMapLayer.js, line 358 -
Convert geographic coordinates to pixel coordinates.
Name Type Description coordinate
Array Geographic coordinates.
-
refresh()
HeatMapLayer.js, line 151 -
Forces the current hotspot display to be refreshed. It is called after the layer hotspot array has changed, and the display is updated.
-
removeAllFeatures()
HeatMapLayer.js, line 438 -
Remove all heat point features information.
-
removeFeatures(features)
HeatMapLayer.js, line 399 -
Remove the specified heatpoint features information.
Name Type Description features
Array.<SuperMap.Feature.Vector> An array of heatpoint features information.
-
setOpacity(opacity)
HeatMapLayer.js, line 383 -
Set the opacity of the layer, between values [0-1].
Name Type Description opacity
number opacity.
-
toiClientFeature(features){SuperMap.Feature.Vector}
HeatMapLayer.js, line 504 -
Convert to the iClient features.
Name Type Description features
GeoJSONObject | L.supermap.heatMapFeature The array of features to be added, supporting the GeoJOSN specification data type and the HeatMapFeature format.
Returns:
Type Description SuperMap.Feature.Vector The converted iClient features. -
update()
HeatMapLayer.js, line 335 -
Update layer.
-
updateHeatPoints(bounds)
HeatMapLayer.js, line 165 -
Refresh the heatmap display.
Name Type Description bounds
L.LngLatBounds The current display bounds.