Start a new topic

Remove objects from Aug View

Remove objects from Aug View

Hi All,

Using the WTSimpleARBrower example provided in the Wikitude SDK I incorporating the AR view into my own iOS application.  One action I perform in my app is calling the Javascript function newData() everytime I receive a set of new coordinates for a POI.

What happens when calling newData() multiple times is that all items become duplicated in the AR view.  What I want to be able to do is remove all current POIs on screen and load up a new set in the JSON data passed.

I dont not want to have to reset the architectView on the iOS side everytime as this causes a slight delay in the app and if the footer is open in the ARbrowser it is automatically closed.

is there a javascript call on a jsonObject argument i can perform that will clear it from the current drawable view before proceeding to next step?  I have include the newData() javascript code for reference.

//function called from the native app fia callJavascript method            //receives json-data as string and processes the contained information            function newData(jsonData){               
jsonObject = JSON.parse(jsonData);               
document.getElementById("statusElement").innerHTML='Loading JSON objects';                                               
for(var i = 0; i //..Perform necessary tasks

poidrawables.push(label);                   
poidrawables.push(img);                   
geoLoc = new AR.GeoLocation(jsonObject.Point.latitude,jsonObject.Point.longitude,jsonObject.Point.altitude);                   
jsonObject.poiObj = new AR.GeoObject(geoLoc, {drawables: {cam: poidrawables}});
}
}
even a simple function call like clearCanvas().  Is something like that available?
Looks like I found the answer

AR.context.destroyAll();

If anyone curious.

Thank you! It works but it does not remove objects from the list
Login or Signup to post a comment