##
- /static/js/kr/uhweb.js
- /static/js/kr/main_edit.js
- /tour/tour.js
##
- 全景设置
预览
previewPano
1 2 3
| function previewPano() { window.open("/tour/"+works_view_uuid); }
|
场景编辑-main_edit
初始化场景数据
通过ajax获取数据
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| function init() { // var id = $("#modelatlasid").val(); var sb = _U.getSubmit("/edit/pic", null, "ajax", false); // var name = $("#modelatlasname").val(); sb.pushData("pid", pk_works_main); sb.pushData("act","update_init"); sb.submit(function () { }, function (data) { initSceneGroupContainerHeight();//设置场景前端容器高度 initPage(data);// }); }
|
页面数据初始化-initPage
主要实现在 initPage(data) 函数中
读取工程设置,并对应显示在页面中
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| worksmain = data.worksmain; panoConfig = data.panoConfig; works_view_uuid = worksmain.view_uuid; $("#worksnameshow").text($.trim(worksmain.name)); $("#worksname").val($.trim(worksmain.name)); $("#workcomment").val(worksmain.profile); $("#user_viewNum").text(worksmain.browsing_num); $("#thumbpath").attr("src", worksmain.thumb_path+"?imageView2/1/w/250/h/250"); $("#thumbpath").error(function(){ $(this).attr("src","/static/images/kr/default2-120x120.png"); }); $("#flag_publish").bootstrapSwitch('state', worksmain.flag_publish == '1' ? true : false); var atlasmain = data.atlasmain; $("#atlasname").text(atlasmain.name); //是否允许显示到首页 $("#flag_allowed_recomm").bootstrapSwitch('state', worksmain.flag_allowed_recomm=='1'?true:false);
|
初始化标签框
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| var tag_list = data.tag_list; var tags = data.tags; var pic_chosen_html = ""; for(var i =0 ; i<tag_list.length;i++){ var flag = false; for(var j=0 ;j<tags.length;j++){ if (tags[j].tag_id==tag_list[i].id) { flag = true; break; } } pic_chosen_html +='<option value="'+tag_list[i].id+'" '+(flag?"selected=\"selected\"":"")+'>'+tag_list[i].name+'</option>'; } $("#pic_chosen").html(pic_chosen_html); $("#pic_chosen").trigger('chosen:updated');
|
加载工程场景列表
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| var imgsmain = data.imgsmain; imgsmain.forEach(function (row, num) { var location = row.location; var picname = row.filename; var html = '<div class="col-md-3" flag="nostatus" id="' + row.pk_img_main + '" data-viewuuid="' + row.view_uuid + '">' + '<div class="card">' + '<div class="media-wrapper"><img alt="" src="' + row.thumb_path + '"></div>' + '<div class="card-heading">' + '<span class="pull-right"><a href="javascript:void(0);" onclick="deletepic(this);"><i class="icon-remove-circle"></i>' + '删除' + '</a></span>' + '<span class="card-scene-name">' + picname + '</span>' + '</div>' + '</div>' + '</div>'; $("#pics").append(html); // if(row.lng && row.lat){ // $("#pics > div:last").data('locationdata',{lng:row.lng,lat:row.lat}); // } });
|
初始化工程配置
initPanoConfig(data.panoConfig);
1 2 3 4 5 6 7 8 9 10 11 12
| function initPanoConfig(panoConfig) { $("#gyro").bootstrapSwitch('state', panoConfig.gyro=='1'?true:false); $("#littleplanet").bootstrapSwitch('state', panoConfig.littleplanet=='1'?true:false); $("#scenechoose").bootstrapSwitch('state', panoConfig.scenechoose=='1'?true:false); $("#autorotate").bootstrapSwitch('state', panoConfig.autorotate=='1'?true:false); initAngleOfView(panoConfig.angle_of_view); initSpecialEffect(panoConfig.special_effects); initHotSpot(panoConfig.hotspot); initSandTable(panoConfig.sand_table); initTourGuide(panoConfig.tour_guide); initSceneGroup(panoConfig.scene_group); }
|
initWorkUseAndShare();
initSelect(data);
可视化编辑
主要实现在openPanoSetting函数中
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| function openPanoSetting() { var settings = {}; settings["onstart"] = 'js(initPanoSetting());'; embedpano({ id: "panoSettingObject", swf: "/tour/tour.swf", xml: "/tour/tour.xml.php?view="+works_view_uuid , target: "settingPano", html5:'auto', // flash:'only', wmode:'opaque-flash', mobilescale:0.7, vars:settings, webglsettings:{preserveDrawingBuffer:true} }); initPanoSettingSceneChoose(); $("#panoSettingModal").modal('show'); }
|
initHotSpotDataToPage
krpano-js模块功能
vrshow.js
initPano
/static/js/kr/