在Cesium for WebGL中添加广告牌后,前端疯狂报Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true. 报警告数量和添加信息数量有关系
加载代码如下:
viewer.entities.add({
id: billboarddata.id,
name: billboarddata.name,
content: billboarddata,
position: Cesium.Cartesian3.fromDegrees(Number(billboarddata.longitude), Number(billboarddata.latitude), 0),
label: {
text: billboarddata.work_name,
font: '14px sans-serif',
fillColor: Cesium.Color.WHITE,
style: Cesium.LabelStyle.FILL_AND_OUTLINE,
outlineWidth: 2,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
pixelOffset: new Cesium.Cartesian2(0, -20),
// distanceDisplayCondition: new DistanceDisplayCondition(...[0, 1000000]),
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
},
billboard: {
image: billboardurl,
show: true,
scale: 1,
width: 20,
height: 20,
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
// distanceDisplayCondition: new DistanceDisplayCondition(...[0, 10000000]),
// disableDepthTestDistance: [0, 10000000],
},
})