var self = this;
this.map = map = self.map || window.map;
var pointList=new Array();
app.post_async(ctx+"/basedata/hiddenPointInfo/data",null,false,function (data) {
if (data.rows.length>0)
{
pointList=data.rows;
}
});
var features = new Array(pointList.length);
for (var i = 0; i < pointList.length; i++) {
var coordinate = ol.proj.gps2gcj(pointList[i].lng,pointList[i].lat);
features[i] = new ol.Feature({
geometry: new ol.geom.Point(coordinate),
weight:0.6
});
}
var heatMapLayer=new ol.layer.Heatmap({
title: "隐患点密度",
weight: weightFunction,
gradient: self.gradient,
blur: 15,
radius: 25 || 8,
renderModed:'image',
source: new ol.source.Vector({
features: features
}),
})
function weightFunction(feature) {
var weight = feature.get('weight');
weight = parseFloat(weight);
return weight;
}
this.map.addLayer(heatMapLayer);