var value = Math.floor(Math.random() * max);
var point = {
x: feature.properties.纬度._value,
y: feature.properties.经度._value,
value: value
};
points.push(point);
// 创建热力图
var heatmapInstance = h337.create({
container: document.querySelector('.div-heatmap')
});
var data = {
max: max,
data: points
};
heatmapInstance.setData(data);
// 将热力图添加到球体上(生成的热力图canvas元素类名为heatmap-canvas)
var canvas = document.getElementsByClassName('heatmap-canvas');
viewer.entities.add({
rectangle: {
name: 'heatmap',
//此句有错误
coordinates: Cesium.Rectangle.fromDegrees(lonMin, latMin, lonMax, latMax),
material: new Cesium.ImageMaterialProperty({
image: canvas[0],
transparent: true
})
}
});
data中存储的是经纬度坐标与value值,在coordinates: Cesium.Rectangle.fromDegrees(lonMin, latMin, lonMax, latMax)此句显示时出现偏移,不知道应该如何处理,请大神指点。