Class: heatMapLayer

L.supermap.heatMapLayer

HeatMapLayer class.

L.supermap.heatMapLayer(name, loadWhileAnimating, colors, options)

HeatMapLayer.js, line 14
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.

Name Type Default Description
map L.Map

The map object for Leaflet.

id string optional

Theme layer ID. The theme layer ID is created by default using CommonUtil.createUniqueID("heatMapLayer_").

alwaysMapCRS boolean false optional

Whether the feature coordinates are consistent with the map coordinate system, and the feature defaults to the latitude and longitude coordinates.

featureWeight string optional

Corresponds to the hotspot weight field name in the feature attribute, and the weight value type is float.

radius number 50 optional

The maximum radius of the hotspot rendering (hotspot pixel radius) in px. When the useGeoUnit parameter is true, the unit uses the current layer geographic coordinate unit. When the hotspot is displayed, the radiation attenuation is started to the periphery with the precise point as the center point, and the attenuation radius and the weight value are in a ratio.

opacity number 1 optional

The opacity.

useGeoUnit boolean false optional

Use the geographic unit, which is the default pixel radius by default. When set to true, the hotspot radius and the layer's geographic coordinates are consistent.

attribution string 'Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>' optional

Copyright Information.

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.