// JavaScript Document
function rdVvirtual_includes() {
if (typeof(jQuery) == 'undefined')
rdVvirtual_includeLibreria('https://ruralesdata.com/js/jquery-1.11.1.min.js','js',function(){jQuery.noConflict();});
rdVvirtual_includeLibreria('https://ruralesdata.com/api/vvirtual/style.css','css',null);
rdVvirtual_includeLibreria('https://ruralesdata.com/include/pannellum/pannellum.css','css',null);
}
function rdVvirtual_includeLibreria(ruta,tipo,callbackFunc){
var head = document.getElementsByTagName('head')[0];
if(tipo=='js')
{
var se1 = document.createElement('script');
se1.src = ruta;
if(callbackFunc!=null) se1.onload=callbackFunc;
head.appendChild(se1);
}
if(tipo=='css')
{
var cssNode_jquery = document.createElement('link');
cssNode_jquery.type = 'text/css';
cssNode_jquery.rel = 'stylesheet';
cssNode_jquery.href = ruta;
cssNode_jquery.media = 'screen';
head.appendChild(cssNode_jquery);
}
}
function rdVvirtual_load() {
if(jQuery("#vvv0").length) jQuery("#vvv0").before("
");
else if(jQuery("#vva9052").length) jQuery("#vva9052").before("");
rdVvirtual_includeLibreria('https://ruralesdata.com/include/pannellum/pannellum.js','js',function(){
jQuery.ajax( "https://ruralesdata.com/api/vvirtual/load.php",
{ type: 'POST', data : { ida:'9052', idv:'0', rand:1991531340}} )
.done(function(html) {
jQuery('#rdVvirtual1991531340').html(html);
rdVvirtual_visita(0);
})
.fail(function() {
jQuery('#rdVvirtual1991531340').html("Error cargando datos");
})
});
}
function rdVvirtual_visita(i){
pannellum.viewer('rdVV_panorama1991531340', {
"autoLoad": true,
"type": "equirectangular",
"panorama": "https://www.ruralesdata.com/api/vvirtual/"+vvs[i][1]+"."+vvs[i][2]+".jpg",
"hfov": vvs[i][3],
"minYaw": vvs[i][4],
"maxYaw": vvs[i][5],
"minPitch": vvs[i][6],
"maxPitch": vvs[i][7],
"haov": vvs[i][5]-vvs[i][4],
"vaov": vvs[i][7]-vvs[i][6],
"vOffset": 1.17,
"autoRotate": vvs[i][8],
"yaw": vvs[i][9],
"pitch": vvs[i][10]
});
}
rdVvirtual_includes();
rdVvirtual_load();