# How to track a moving billboard?

**URL:** <https://community.cesium.com/t/how-to-track-a-moving-billboard/2869>\
**Category:** CesiumJS\
**Created:** [July 30, 2015, 3:16pm UTC](https://community.cesium.com/t/how-to-track-a-moving-billboard/2869 "2015-07-30T15:16:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chad\_liu](https://avatars.discourse-cdn.com/v4/letter/c/f04885/32.png) [@chad\_liu](https://community.cesium.com/u/chad_liu)\
**Post date:** [July 30, 2015, 3:16pm UTC](https://community.cesium.com/t/how-to-track-a-moving-billboard/2869/1 "2015-07-30T15:16:56Z")

</div>

hi,  
I have made a moving billboard,and I want to track this moving billboard and observer it in a certain view.I can obtain the billboard’s position,then what shoud I do next?Who can tell me ?Appreciate it very much!

---

<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:** [July 30, 2015, 5:23pm UTC](https://community.cesium.com/t/how-to-track-a-moving-billboard/2869/2 "2015-07-30T17:23:42Z")

</div>

Hello,

One way to do this is to set the viewer.trackedEntity property with your billboard. The camera will lock onto the billboard and follow it.

Here’s a code example:

var viewer = new Cesium.Viewer(‘cesiumContainer’, {timeline : false, animation : false});

var pinBuilder = new Cesium.PinBuilder();

var lon = -70;

var lat = -39;

var bluePin = viewer.entities.add({

name : ‘Blank blue pin’,

position : Cesium.Cartesian3.fromDegrees(lon, lat),

billboard : {

image : pinBuilder.fromColor(Cesium.Color.ROYALBLUE, 48).toDataURL(),

verticalOrigin : Cesium.VerticalOrigin.BOTTOM

}

});

viewer.trackedEntity = bluePin;

setInterval(function(){

lon += 0.00001;

bluePin.position = Cesium.Cartesian3.fromDegrees(lon, lat);

}, 30);

``

Best,

Hannah

---

<div class="post-metadata">

**Author:** ![chad\_liu](https://avatars.discourse-cdn.com/v4/letter/c/f04885/32.png) [@chad\_liu](https://community.cesium.com/u/chad_liu)\
**Post date:** [July 31, 2015, 2:07am UTC](https://community.cesium.com/t/how-to-track-a-moving-billboard/2869/3 "2015-07-31T02:07:06Z")

</div>

It’s awesome,thanks very much!

在 2015年7月31日星期五 UTC+8上午1:23:42，Hannah Pinkos写道：
