-
Notifications
You must be signed in to change notification settings - Fork 14
Description
let heat = new CesiumHeat( viewer, { autoMaxMin: false, max: 2000, min: 400, data: data, }, [-180, -90, 180, 90 ], // cesium矩形大小 { radius: 2, }, { enabled: false, // 是否开启,关闭的话不会自动更新 min: 6375000, // 最低高度,对应高度的辐射为minRadius max: 10000000, // 最大高度,对应高度的辐射为maxRadius maxRadius: 20 * 2, minRadius: 5 * 2, }, // auto resize canvas | 自动按bbox形状控制canvas形状,默认值如下,canvas面积越大越清晰,也越卡 { autoResize: false, // 是否自动调整canvas totalArea: 1440 * 720, // 总面积,如果自动,必填,如果不自动,无效 width: 1440 * 2, // canvas宽度,如果不自动,必填,如果自动,无效 height: 720 * 2, // canvas高度,如果不自动,必填,如果自动,无效 } )
结果只能显示一半。原始数据是没问题的。
数据片段:
{ "x": -79.75, "y": 125.25, "value": 665.85125 }, { "x": -79.75, "y": 125.5, "value": 666.2352500000001 }, { "x": -79.75, "y": 125.75, "value": 666.58725 }, { "x": -79.75, "y": 126.0, "value": 666.89125 }, { "x": -79.75, "y": 126.25, "value": 667.08325 }, { "x": -79.75, "y": 126.5, "value": 667.21125 }, { "x": -79.75, "y": 126.75, "value": 667.33925 }, { "x": -79.75, "y": 127.0, "value": 667.4352500000001 },
看了下源码:
` /**
- 更新cesium显示
- @param {*} updateHeat
*/
async _updateCesium(updateHeat) {
if (this.layer) {
this.viewer.scene.imageryLayers.remove(this.layer)
}
updateHeat && this.updateHeatmap()
let provider = await Cesium.SingleTileImageryProvider.fromUrl(
this.heatmap.getDataURL(),
{
rectangle: Cesium.Rectangle.fromDegrees(...this.bbox)
}
)
this.layer = this.viewer.scene.imageryLayers.addImageryProvider(provider)
}`
貌似也没啥问题,挺郁闷的。搞了一天半~