Sorry I didn't have time to check it yet. I did a quick test, but encountered some issues. Some quick code to look at (sea level placement):
var world,igc,vehicle;
function ll2xyz(lon,lat) {
const R = 6378135;
const rad = Math.PI/180.0;
var fc = Math.cos(lon*rad);
var fs = Math.sin(lon*rad);
var ac = Math.cos(lat*rad);
return [R*fc*ac, R*fs*ac, R*Math.sin(lat*rad)];
}
if(!world) world = $eview.$query_interface("ot::js::world.get");
if(!igc) igc = $eview.$query_interface("ot::js::igc.get");
if(world && !vehicle) {
var c = map.getBounds().getCenter(); //this is from google maps object
var pos = ll2xyz(c.lng(), c.lat());
vehicle = world.create_instance("outerra/ddg/ddg", pos, {x:0, y:0, z:0, w:1}, false);
}