Could you please refer to the forum post here and let me know if this solves your issue?
Thanks
Eva
Nimeshka Srimal has said :
What I actually want to do is to connect to the database, then read what overlays has been created and load them into the world, so that they can be tracked. I already have the db object created and I want to be able to access them inside the world.js file. But it's not practical because the world is opened in a new webview.
Hey Nimeshka,
I think that the best for you would be to load all the info from your database directly in world.js (in the new webview). The loadARchitectWorld is just here to instantiate the AR webview, and from this new webview you can do some XHR request to your server/db, and create new overlays dynamically based on the result.
To wikitude team : this double webview architecture is a bit limitating :
- it is confusing for beginners.
- the ways of passing data between the cordova and AR webview are limited, only small strings can be used as parameter (in particular with the architectsdk:// urls).
- moreover it makes thing difficult when we want to integrate js framework like ionic.
Are you planning something new to overcome these limitations ?! Or even better a proper ionic 2 plugin ? That would be great :-)
To wikitude team : also I cannot find these two functions in the new forum :
- a "quote" function
- a "edit my message" function (!!)
Nimeshka Srimal
I'm developing an AR app using wikitude phonegap plugin.
It has been working well so far, but I got struck in this step where I want to create the overlays & world dynamically and pass it to loadARchitectWorld(), rather than calling a html.
This is what I have at the moment. Here I load the www/world.html file as the world. In that file I have no html tags. It's just the Javascript functions to create the overlays.
Content of world.html:
However, I noticed that when I call this loadARchitectWorld() function, it starts a new webview and I'm not able to access any of my Js variables inside the world.js file.
What I actually want to do is to connect to the database, then read what overlays has been created and load them into the world, so that they can be tracked. I already have the db object created and I want to be able to access them inside the world.js file. But it's not practical because the world is opened in a new webview.
Is there anyway to create the overlays dynamically and pass it to loadARchitectWorld() function? Something like, instead of giving a url of the world.html file,can I create a js object with overlays and pass it to loadARchitectWorld(),
I hope this is clear? I'm using the version 5.3 of the SDK. I'm sorry if I'm not clear enough. Please ask me if you want any further clarifications. Thanks in advance!