# CallbackProperty for entity.position in typescript

**URL:** <https://community.cesium.com/t/callbackproperty-for-entity-position-in-typescript/12649>\
**Category:** CesiumJS\
**Created:** [March 16, 2021, 7:33pm UTC](https://community.cesium.com/t/callbackproperty-for-entity-position-in-typescript/12649 "2021-03-16T19:33:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ruediger\_Brand](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ruediger_brand/32/4004_2.png) [@Ruediger\_Brand](https://community.cesium.com/u/Ruediger_Brand)\
**Post date:** [March 16, 2021, 7:33pm UTC](https://community.cesium.com/t/callbackproperty-for-entity-position-in-typescript/12649/1 "2021-03-16T19:33:24Z")

</div>

I use the following code

```
var windowPosition = new Cesium.Cartesian2(viewer.container.clientWidth / 2, viewer.container.clientHeight / 2);
		  var pickPosition = viewer.camera.pickEllipsoid(windowPosition);

		  // var position = Cesium.Cartesian3.fromDegrees(11.35463381710764, 49.063505);
		  var position = pickPosition;
		  var positionCBP = function(){
			return position;
		  };
		  myTarget = viewer.entities.add({
			name : 'Target on surface',
			position: new Cesium.CallbackProperty(positionCBP, false),
			
			billboard: {
				 image: 'Images/target.png',
				 heightReference: Cesium.HeightReference.NONE
				}
				
			});

```

for dynamically picking. there also exists an example as sandcastle [Cesium Sandcastle](https://sandcastle.cesium.com/index.html?src=Picking.html)

But in typescript I get errors similar:

TS2322: Type ‘CallbackProperty’ is not assignable to type ‘Cartesian3 | PositionProperty | undefined’.  
Type ‘CallbackProperty’ is missing the following properties from type ‘PositionProperty’: referenceFrame, getValueInReferenceFrame

In [Various TS issues/questions · Issue #8927 · CesiumGS/cesium · GitHub](https://github.com/CesiumGS/cesium/issues/8927) Matthew talks about this for Cesium 1.71 but I didn’t found it. There is also [CallbackProperty and positions · Issue #8944 · CesiumGS/cesium · GitHub](https://github.com/CesiumGS/cesium/issues/8944) concerning this topic.

Is there a solution ?

Rüdiger
