Showing results for 
Search instead for 
Did you mean: 
Showing results for 
Search instead for 
Did you mean: 

The PTC Community email address has changed to Learn more.

Javascript Example: Dynamically control Tracking Indicator

No ratings

You can control the Tracking Indicator that is used to mark the ThingMark position. The Tracking Indicator is a green hexagon, in the screenshot below the red arrow points to it.


You can control the display of this tracking indicator via the Display Tracking Indicator property of the ThingMark widget:


But you can also get fancier. Here is an exmaple that shows the tracking indicator for 3 seconds when the tracking has started and then hides it automatically. To achieve such a behavior you'll have to use a bit of Javascript. We'll first create a function hideIn3Sec() in the javascript section of our view and then add it to the javascript handler of the Tracking Acquired event of the ThingMark widget.

Step 1:


Here is the code for copy/paste convenience:


  // The $timeout function has two arguments: the function to execute (defined inline here)

  // and the time in msec after which the function is invoked.

  $timeout( function hide(){

    // you may have to change 'thingMark-1' by the id of the ThingMark in your own experience





Step 2:


That's it. Have fun!


Hi Moritz von Hasselbach,

Thank you for the post. I was wondering if it is possible to send some alert to the composer when tracking is successful. If in an experience someone tracks a thingmark, then is it possible to update some value of a thing...

Thanx & regards,

Dipika Sengupta

Yeah that is possible. For example, in Moritz's project, on tracking acquired there is a function (hideIn3Sec), within that function we can execute a thingworx service that inturn updates the property of a thing. FYI, $['<thingname>'].svc['<servicename>']; can be used to execute the thingworx service.

Thanks giri... It works!!

Version history
Last update:
‎Dec 30, 2016 10:09 AM
Updated by:
Labels (2)