# Shape Flicker Flash when making CallbackProperty constant.

**URL:** <https://community.cesium.com/t/shape-flicker-flash-when-making-callbackproperty-constant/4762>\
**Category:** CesiumJS\
**Created:** [October 28, 2016, 10:35pm UTC](https://community.cesium.com/t/shape-flicker-flash-when-making-callbackproperty-constant/4762 "2016-10-28T22:35:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tkmoto17](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@tkmoto17](https://community.cesium.com/u/tkmoto17)\
**Post date:** [October 28, 2016, 10:35pm UTC](https://community.cesium.com/t/shape-flicker-flash-when-making-callbackproperty-constant/4762/1 "2016-10-28T22:35:35Z")

</div>

I am implementing a shape drawer for Cesium. It was suggested on another forum post to utilize a CesiumCallback property when creating the dynamic shapes so that they can be smoothly drawn. I have this part figured out. For performance reasons, I am assuming it is better to make the CallbackProperty a constant property after finishing drawing. I am not sure the proper way to do this though. Each way that I have tried results in a flickering or flashing of the shape once.

As an exmaple, below is a code snipets of what I've done.

//Creation of polyline  
var polyline = new Cesium.Entity({  
&nbsp;&nbsp;&nbsp;&nbsp;polyline : {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;positions : new Cesium.CallbackProperty(getPolylinePositions, false),  
&nbsp;&nbsp;&nbsp;&nbsp;}  
});

The getPolylinePositions callback function returns an array of vector3 values, which polyline.positions is expecting.

When it comes to changing the polyline's position array from being populated by a async callback property to a constant value, how can this be done without the shape flickering?

I can provide a sandcastle example of the flickering if necessary, but if someone else has been able to solve this issue let me know. Thanks!

---

<div class="post-metadata">

**Author:** ![hannah](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/hannah/32/4509_2.png) [@hannah](https://community.cesium.com/u/hannah)\
**Post date:** [October 31, 2016, 2:48pm UTC](https://community.cesium.com/t/shape-flicker-flash-when-making-callbackproperty-constant/4762/2 "2016-10-31T14:48:13Z")

</div>

Hello,

There currently isn’t a way to avoid this. The polyline flickers when you make the positions constant because the constant value makes the polyline draw asynchronously. It draws synchronously when using a CallbackProperty

Best,

Hannah
