热点权重图可以将颜色手动配置。
SuperMap. |
热点权重图可以将颜色手动配置。 |
Properties | |
items | {Array} 权重数组 |
Constructor | |
SuperMap. |
创建一个热点权重图层。 |
Functions | |
destroy | 销毁图层,释放资源。 |
{Array} 权重数组
用于表示数据权重的渐变,此参数不设置的情况颜色由绿(低权重)到红(高权重)。 如需要设置可以为如下两种方式: //例1: //feature.attributes中表示权重的字段为height,则在HeatMapWeight的featureWeight参数赋值为"height" feature1.attributes.height = 4.0; feature2.attributes.height = 1.0; var heatMapLayer = new SuperMap.Layer.HeatMapWeight("heatmaplayer",{"featureWeight":"height"}); //items数组形如: var items = [ { start:0, end:2, startColor:new SuperMap.REST.ServerColor(255,0,0), endColor:new SuperMap.REST.ServerColor(200,0,0) }, { start:2, end:4, startColor:new SuperMap.REST.ServerColor(200,0,0), endColor:new SuperMap.REST.ServerColor(100,0,0) } ]; heatMapLayer.items = items; heatMapLayer.addFeatures([feature1,feature2]); //例2: //feature.attributes中表示权重的字段为 temperature ,则在HeatMapWeight的featureWeight参数赋值为"temperature" feature1.attributes.temperature = 3.0; feature2.attributes.temperature = 0.0; var heatMapLayer = new SuperMap.Layer.HeatMapWeight("heatmaplayer",{"featureWeight":"temperature"}); //startColor和endColor可以为任意的object对象,但是必须有red、green、blue三个属性。 var items = [ { start:0, end:2, startColor:{red:0,green:0,blue:0}, endColor:{red:100,green:0,blue:0} }, { start:2, end:4, startColor:{red:100,green:0,blue:0}, endColor:{red:200,green:0,blue:0} } ]; heatMapLayer.items = items; heatMapLayer.addFeatures([feature1,feature2]);
创建一个热点权重图层。
var layer = new SuperMap.Layer.HeatMapWeight(); var items=[ { start:0, end:2, startColor:{red:0,green:0,blue:0} , endColor:{red:100,green:0,blue:0} } ,{ start:2, end:4, startColor:{red:100,green:0,blue:0}, endColor:{red:200,green:0,blue:0} } ]; layer.items=items
name | 此图层的图层名 {String} |
options | {Object} 设置此类上没有默认值的属性。 |
{SuperMap.Layer.HeatMapWeight} 新的热点权重图层。
销毁图层,释放资源。
destroy: function()