# .js willReadFrequently

**URL:** <https://community.cesium.com/t/js-willreadfrequently/32765>\
**Category:** CesiumJS\
**Created:** [June 7, 2024, 8:01pm UTC](https://community.cesium.com/t/js-willreadfrequently/32765 "2024-06-07T20:01:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pastorjeff](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/pastorjeff/32/14000_2.png) [@pastorjeff](https://community.cesium.com/u/pastorjeff)\
**Post date:** [June 7, 2024, 8:01pm UTC](https://community.cesium.com/t/js-willreadfrequently/32765/1 "2024-06-07T20:01:26Z")

</div>

I just started adding count(s) labels to the top of arrows on my globe, and when I did, I started getting these warnings

Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true. See:   
Cesium.js:1 Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true. See: [HTML Standard](https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently)

This is the code I am using to produce the arrows and labels:

```
                            // Calculate position for the arrow and label
                            const position = Cesium.Cartesian3.fromDegrees(stateLongitude, stateLatitude, 600000); // Set height with offset
                            
                            // Create black arrow representing the outage
                            const arrowEntity = viewer.entities.add({
                                position: position,
                                polyline: {
                                    positions: [position, Cesium.Cartesian3.fromDegrees(stateLongitude, stateLatitude, 0)], // Set height to 0 for the arrow's base
                                    width: 2, // Set width to 2px
                                    material: new Cesium.ColorMaterialProperty(Cesium.Color.BLACK) // Set color to black
                                },
                                name: 'Outage Arrow',
                                description: `State: ${state}<br>Outage Count: ${outageCount}`
                            });

                            
                            // Add label to display outage count aligned with the arrow
                            viewer.entities.add({
                                position: position,
                                label: {
                                    text: `${outageCount}`,
                                    font: '14px sans-serif',
                                    fillColor: Cesium.Color.YELLOW,
                                    style: Cesium.LabelStyle.FILL_AND_OUTLINE,
                                    outlineWidth: 2,
                                    outlineColor: Cesium.Color.RED,
                                    horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
                                    verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
                                    pixelOffset: new Cesium.Cartesian2(0, 0), // Offset to position the label above the arrow
                                    pixelOffsetScaleByDistance: new Cesium.NearFarScalar(1.0e3, 1.0, 1.5e6, 0.2),
                                    willReadFrequently: true
                                }

                            });

```

And it is the second part which triggers the warnings. It’s pretty understandable with the globe turning, that remapping the labels or arrows is beyond my understanding graphically. But all I am asking is simply, is there a fix for this other than removing the count labels over the arrows?

I’ve read enough guesses on the web. If someone has actually found a fix, I’d love to read it.  
Thanks tons

---

<div class="post-metadata">

**Author:** ![Gabby\_Getz](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/gabby_getz/32/7838_2.png) [@Gabby\_Getz](https://community.cesium.com/u/Gabby_Getz)\
**Post date:** [June 18, 2024, 1:34pm UTC](https://community.cesium.com/t/js-willreadfrequently/32765/2 "2024-06-18T13:34:03Z")

</div>

Hi, what version of CesiumJS are you using? This should not occur when using the most recent versions, but can occur in older versions.

---

<div class="post-metadata">

**Author:** ![Sergio\_Paredes](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/sergio_paredes/32/22839_2.png) [@Sergio\_Paredes](https://community.cesium.com/u/Sergio_Paredes)\
**Post date:** [July 4, 2024, 9:51am UTC](https://community.cesium.com/t/js-willreadfrequently/32765/3 "2024-07-04T09:51:56Z")

</div>

did you solve it? it due to the labels for sure, when i remove the labels, the warning disappear
