Hi! I'm having some issues with the viewPort area and the HTMLDrawable object. When I create the object I can see the "clickeable" area setting a background color. In all my objects the height is bigger than the real height for my DIV and also the background image is pixeled. How can I calculate the real viewPort and the SDU width? my DIV is 110x70 px. Thanks!
So It's not possible using the dynamic HTML and I need to use a external HTML?
D
Daniel Fernández
said
almost 11 years ago
Well, the external HTML option works very well but I never could make work the method evalJavascript to pass data inside of my html. For this reason I used this option and worked very well. First I create the HTMLDrawable:
var uri = "report.html?id=1&count=2";
var node = new AR.HtmlDrawable({uri:uri}, 4, {scale:1, updateRate:AR.HtmlDrawable.UPDATE_RATE.STATIC})
var geoLoc = new AR.GeoLocation(parseFloat(jsonObject.lat), parseFloat(jsonObject.lon));
new AR.GeoObject(geoLoc, {drawables: {cam: node}});
In this way I add some URL params and I can read them inside of my HTML (report.html) in this way:
<script>
var params = {};
if (location.search) {
var parts = location.search.substring(1).split('&');
And this works perfect. I also could thanks if you can provide me a sample for the evalJavascript (I can't find one). I tried to define a custom function in my report.html and call it using the evalJavascript with no successful.
Thanks!
W
Wolfgang Damm
said
almost 11 years ago
Great that you got it working.
Just a clarification: You don't need to use an external html (.uri="" ), it is still possible to define the html directly (.html="" ). However I find it clearer to have it in a separate file.
Calling evalJavascript only works for if you set the updateRate at construction to any of the DYNAMIC_ flags (see API reference for more details). Unfortunately as I mentioned in the previous post this introduces framerate jiggers and therefore is currently not recommended. Which means for evalJavascript that it is also not recommended at the moment.
Daniel Fernández