Start a new topic

2d tracking and geo create marker

Hi Wikitude team:

I used 2dtrackingandgeo javascript demo sample.

for some reasons, I need to create marker after 1s, if I create marker in doMoreStuff function, create marker will be failed, but if I create marker immediately in setupScene , it will succeed. 

Can I ask about the possibility? thanks!

IrAndGeo.setupScene = function(lat, lon, alt) {
setTimeout(doMoreStuff, 1000);
IrAndGeo.createMarker(25.1703898,121.43921262082, "name");

// create appearing animation
IrAndGeo.showMarkersAnimation = new AR.AnimationGroup('parallel', IrAndGeo.markerAnimations);
function doMoreStuff(){
IrAndGeo.createMarker(25.1703898,121.43921262082, "name");}

Maybe this has to do with the timer. Does it work if you don't work with the Timeout?

Please make sure you read the documentation very carefully and try out the sample app to understand the functionality of the SDK.



I realize that createMarker need to be called before IrAndGeo.showMarkersAnimation = new AR.AnimationGroup('parallel', IrAndGeo.markerAnimations);

if I set timer and timeout with period time, the createMarker is called after  IrAndGeo.showMarkersAnimation = new AR.AnimationGroup('parallel', IrAndGeo.markerAnimations); 

so the markers will not be shown successfully after 

IrAndGeo.stores.forEach(function(x, idx) { console.log("showStores_"+x+" "+idx) x.enabled = true; });


So this topic is sovled now? Please change the status of the thread to solved if this is the case.



1 person likes this
Login or Signup to post a comment