Start a new topic

Remove AR objects in order to add others

Remove AR objects in order to add others


I have an AR view where I show some objects geolocated. When the user press a button inside the view, those objects disappear and I show other objects. The problem is that old objects do not disappear, ant i get this error: "Uncaught TypeError: Cannot read property 'drawables' of undefined at file:///android_asset/js/poiatlocation.js:30"

This is the code I use to remove objects from the list:

var tmp = markerList.length - 1;

while( markerList.length>0 ){


// Deleting cam elements (label and image)

markerList.markerObject.drawables.removeCamDrawable(0); //Here is where I get the error. I tried this line before when I had only one object (without list) and It worked fine, but not now



// Deleting indicator elements



// Deleting element from radar



markerList.markerObject = null;


tmp = tmp - 1;



Thank you in advance!

Solved! I clear the list and then I call AR.context.destroyAll();, but when I do this I never see the radar again. Any idea for a solution?
Login or Signup to post a comment