Commit b8bac284 authored by liyang's avatar liyang

fix:debug

parent b3961490
Pipeline #657 failed with stages
console.log("------ datav3.q.common.js debug ------")
var map = null;
var phyTopoin =null;
var phyInterRouter =null;
......
console.log("------ datav3.q.exportdata.js debug ------")
$('#logic-export').click(function(){
var inputValue = $(this).siblings('input').val();
......
console.log("------ datav3.q.initwebgl.js debug ------")
// 声明变量,用于存储渲染器、场景、相机、容器宽高、控制器和克隆相机
var renderer;
var scene;
......
console.log("------ datav3.q.left.js debug ------")
$(function(){
var leftinfo = $('.leftinfo');
var leftinfoR =$('.right');
......
This diff is collapsed.
//自动执行函数
(function () {
console.log("------ datav3.q.map debug ------")
console.log("------ datav3.q.map debug ------");
// 公共鼠标拾取变量
var raycaster = new THREE.Raycaster();
var mouse = new THREE.Vector2();
......@@ -492,7 +492,10 @@
transformSVGPathExposed(path(feature)),
extrudeSettings
),
new THREE.MeshLambertMaterial({ color: 0xffffff, depthTest: true })
new THREE.MeshLambertMaterial({
color: 0xffffff,
depthTest: true,
})
);
map_mesh.name = "map_" + country_code;
country_geomap_map.add(map_mesh);
......@@ -525,7 +528,7 @@
country_AScount_list.push(_.size(country_ASes));
}
var country_AScount_max = _.max(country_AScount_list);
console.log("------------")
console.log("------------");
// 点处理
var Land_points = new THREE.Geometry();
valid_country_names = []; // 实际有效的绘图国家列表
......
console.log("------ datav3.q.right.js debug ------");
//***********右侧信息展示中供index调用的接口封装***********/
// 右下按钮动画
$(function(){
var right_btm = $('.right-btm');
var content = right_btm.find('.content');
var content_list = content.find('.content-list');
right_btm.find('.rb-btn').each(function(){
rbBtnAnimate($(this));
})
// rbBtnAnimate(right_btm.find('.rb-btn2'));
function rbBtnAnimate($ele){
var btn_country = $ele.find('.rb-btn-center');
var rb_btn_outer = $ele.find('.rb-btn-outer');
var btn_transition_time = 500;
var img_len = rb_btn_outer.find('img').length;
var per_deg = 360/img_len;
// var init_rotate = 140;
if(img_len == 2){
btn_country.click(function(){
$_this = $(this);
var anim1 = scaleBtnCountry($_this);
anim1.then(function(){
resetBtnCountry($_this); ;
})
})
}else{
btn_country.click(function(){
$_this = $(this);
var anim1 = transiteBtnOuterDown($_this,-200);
anim1.then(function(){
resetBtnOuter($_this); ;
})
})
}
function scaleBtnCountry($_el){
var dtd = $.Deferred();
$_el.transition({
transform: 'scale(0.8) rotate(-40deg)'
},btn_transition_time,function(){
dtd.resolve();
})
return dtd.promise();
}
function resetBtnCountry($_el){
var dtd = $.Deferred();
$(function () {
var right_btm = $(".right-btm");
var content = right_btm.find(".content");
var content_list = content.find(".content-list");
right_btm.find(".rb-btn").each(function () {
rbBtnAnimate($(this));
});
// rbBtnAnimate(right_btm.find('.rb-btn2'));
function rbBtnAnimate($ele) {
var btn_country = $ele.find(".rb-btn-center");
var rb_btn_outer = $ele.find(".rb-btn-outer");
var btn_transition_time = 500;
var img_len = rb_btn_outer.find("img").length;
var per_deg = 360 / img_len;
// var init_rotate = 140;
if (img_len == 2) {
btn_country.click(function () {
$_this = $(this);
var anim1 = scaleBtnCountry($_this);
anim1.then(function () {
resetBtnCountry($_this);
});
});
} else {
btn_country.click(function () {
$_this = $(this);
var anim1 = transiteBtnOuterDown($_this, -200);
anim1.then(function () {
resetBtnOuter($_this);
});
});
}
$_el.transition({
transform: 'scale(1) rotate(-40deg)'
},btn_transition_time,function(){
dtd.resolve();
})
function scaleBtnCountry($_el) {
var dtd = $.Deferred();
return dtd.promise();
}
$_el.transition(
{
transform: "scale(0.8) rotate(-40deg)",
},
btn_transition_time,
function () {
dtd.resolve();
}
);
rb_btn_outer.find('img').each(function(i,d){
$(this).on('click.animate',function(){
var $_this = $(this);
var rotate_deg = i*per_deg;
var anim1 = transiteBtnOuterDown($_this);
anim1 .then(function(){
transiteBtnOuterUp($_this)
return rotateBtn($_this,rotate_deg);
}).then(function(){
resetBtnOuter($_this);
})
// $_this.addClass('active');
})
})
return dtd.promise();
}
function transiteBtnOuterDown($_el,transZ){
var dtd = $.Deferred();
var transZ = transZ || -40;
function resetBtnCountry($_el) {
var dtd = $.Deferred();
$_el.transition({
transform: 'translate3d(0px,0px,'+transZ+'px)'
},btn_transition_time,function(){
dtd.resolve();
})
$_el.transition(
{
transform: "scale(1) rotate(-40deg)",
},
btn_transition_time,
function () {
dtd.resolve();
}
);
return dtd.promise();
}
return dtd.promise();
}
function transiteBtnOuterUp($_el,transZ){
var dtd = $.Deferred();
var transZ = transZ || 50;
rb_btn_outer.find("img").each(function (i, d) {
$(this).on("click.animate", function () {
var $_this = $(this);
var rotate_deg = i * per_deg;
$_el.transition({
transform: 'translate3d(0px,0px,'+transZ+'px)'
},btn_transition_time,function(){
dtd.resolve();
var anim1 = transiteBtnOuterDown($_this);
anim1
.then(function () {
transiteBtnOuterUp($_this);
return rotateBtn($_this, rotate_deg);
})
.then(function () {
resetBtnOuter($_this);
});
// $_this.addClass('active');
});
});
function transiteBtnOuterDown($_el, transZ) {
var dtd = $.Deferred();
var transZ = transZ || -40;
$_el.transition(
{
transform: "translate3d(0px,0px," + transZ + "px)",
},
btn_transition_time,
function () {
dtd.resolve();
}
);
return dtd.promise();
}
return dtd.promise();
}
function rotateBtn($_el,rotate_deg){
var dtd = $.Deferred();
$_el.parent().transition({
transform: 'rotate(-'+rotate_deg+'deg)'
},btn_transition_time,function(){
dtd.resolve();
})
function transiteBtnOuterUp($_el, transZ) {
var dtd = $.Deferred();
var transZ = transZ || 50;
$_el.transition(
{
transform: "translate3d(0px,0px," + transZ + "px)",
},
btn_transition_time,
function () {
dtd.resolve();
}
);
return dtd.promise();
}
return dtd.promise();
}
function rotateBtn($_el, rotate_deg) {
var dtd = $.Deferred();
function resetBtnOuter($_el){
$_el.parent().transition(
{
transform: "rotate(-" + rotate_deg + "deg)",
},
btn_transition_time,
function () {
dtd.resolve();
}
);
$_el.transition({
transform: 'translate3d(0px,0px,0px)'
},btn_transition_time)
}
return dtd.promise();
}
function resetBtnOuter($_el) {
$_el.transition(
{
transform: "translate3d(0px,0px,0px)",
},
btn_transition_time
);
}
}
//右下信息中交互操作
$('.aslist .content-list').each(function(){
$(this).hover(function(){
$(this).addClass('active');
},function(){
$(this).removeClass('active')
})
})
})
$(".aslist .content-list").each(function () {
$(this).hover(
function () {
$(this).addClass("active");
},
function () {
$(this).removeClass("active");
}
);
});
});
This diff is collapsed.
console.log("------ q/json.js debug ------");
/** @license
* RequireJS plugin for loading JSON files
* - depends on Text plugin and it was HEAVILY "inspired" by it as well.
......@@ -5,68 +7,89 @@
* Version: 0.4.0 (2014/04/10)
* Released under the MIT license
*/
define(['text'], function(text){
var CACHE_BUST_QUERY_PARAM = 'bust',
CACHE_BUST_FLAG = '!bust',
jsonParse = (typeof JSON !== 'undefined' && typeof JSON.parse === 'function')? JSON.parse : function(val){
return eval('('+ val +')'); //quick and dirty
},
buildMap = {};
function cacheBust(url){
url = url.replace(CACHE_BUST_FLAG, '');
url += (url.indexOf('?') < 0)? '?' : '&';
return url + CACHE_BUST_QUERY_PARAM +'='+ Math.round(2147483647 * Math.random());
}
define(["text"], function (text) {
var CACHE_BUST_QUERY_PARAM = "bust",
CACHE_BUST_FLAG = "!bust",
jsonParse =
typeof JSON !== "undefined" && typeof JSON.parse === "function"
? JSON.parse
: function (val) {
return eval("(" + val + ")"); //quick and dirty
},
buildMap = {};
//API
return {
function cacheBust(url) {
url = url.replace(CACHE_BUST_FLAG, "");
url += url.indexOf("?") < 0 ? "?" : "&";
return (
url +
CACHE_BUST_QUERY_PARAM +
"=" +
Math.round(2147483647 * Math.random())
);
}
load : function(name, req, onLoad, config) {
if (( config.isBuild && (config.inlineJSON === false || name.indexOf(CACHE_BUST_QUERY_PARAM +'=') !== -1)) || (req.toUrl(name).indexOf('empty:') === 0)) {
//avoid inlining cache busted JSON or if inlineJSON:false
//and don't inline files marked as empty!
onLoad(null);
//API
return {
load: function (name, req, onLoad, config) {
if (
(config.isBuild &&
(config.inlineJSON === false ||
name.indexOf(CACHE_BUST_QUERY_PARAM + "=") !== -1)) ||
req.toUrl(name).indexOf("empty:") === 0
) {
//avoid inlining cache busted JSON or if inlineJSON:false
//and don't inline files marked as empty!
onLoad(null);
} else {
text.get(
req.toUrl(name),
function (data) {
var parsed;
if (config.isBuild) {
buildMap[name] = data;
onLoad(data);
} else {
text.get(req.toUrl(name), function(data){
var parsed;
if (config.isBuild) {
buildMap[name] = data;
onLoad(data);
} else {
try {
parsed = jsonParse(data);
} catch (e) {
onLoad.error(e);
}
onLoad(parsed);
}
},
onLoad.error, {
accept: 'application/json'
}
);
try {
parsed = jsonParse(data);
} catch (e) {
onLoad.error(e);
}
onLoad(parsed);
}
},
},
onLoad.error,
{
accept: "application/json",
}
);
}
},
normalize : function (name, normalize) {
// used normalize to avoid caching references to a "cache busted" request
if (name.indexOf(CACHE_BUST_FLAG) !== -1) {
name = cacheBust(name);
}
// resolve any relative paths
return normalize(name);
},
//write method based on RequireJS official text plugin by James Burke
//https://github.com/jrburke/requirejs/blob/master/text.js
write : function(pluginName, moduleName, write){
if(moduleName in buildMap){
var content = buildMap[moduleName];
write('define("'+ pluginName +'!'+ moduleName +'", function(){ return '+ content +';});\n');
}
}
normalize: function (name, normalize) {
// used normalize to avoid caching references to a "cache busted" request
if (name.indexOf(CACHE_BUST_FLAG) !== -1) {
name = cacheBust(name);
}
// resolve any relative paths
return normalize(name);
},
};
//write method based on RequireJS official text plugin by James Burke
//https://github.com/jrburke/requirejs/blob/master/text.js
write: function (pluginName, moduleName, write) {
if (moduleName in buildMap) {
var content = buildMap[moduleName];
write(
'define("' +
pluginName +
"!" +
moduleName +
'", function(){ return ' +
content +
";});\n"
);
}
},
};
});
var SvgHeader = function(el,textid){
var el = el;
var width = 180;
var height = 180;
var NS = "http://www.w3.org/2000/svg";
var xlinkNS = "http://www.w3.org/1999/xlink";
var svg = document.createElementNS(NS, "svg");
// var rec1 = document.createElementNS(NS, "path");
// var rec2 = document.createElementNS(NS, "path");
var circle= document.createElementNS(NS, "path");
var text = document.createElementNS(NS, "text");
var textPath = document.createElementNS(NS, "textPath");
svg.setAttribute("viewBox", "0 0"+' '+width+' '+height);
circle.setAttribute("d", "m 90,12 A 78,78 0 1,0 91,12");
circle.setAttribute("id", textid);
circle.setAttribute("class", "text_circle");
textPath.setAttributeNS(xlinkNS, "xlink:href", "#"+textid);
textPath.setAttribute('id','textpath'+textid);
text.appendChild(textPath);
svg.appendChild(circle);
svg.appendChild(text);
textPath.textContent = '';
el.appendChild(svg);
var textend_deg = 120;
var r_text = 80;
svg.querySelectorAll('.circle')
function setContent(content){
// textPath.textContent = '';
textPath.textContent = content;
// console.log('content')
// console.log(content)
// console.log(text.textLength)//暂不能删除
// console.log(text.getComputedTextLength())
// console.log(text.getNumberOfChars())
// var textstart_deg =text.textLength.animVal.value; //使用svg内部精确的计算值计算
var textstart_deg =186-content.length*9/2; // 每个字符按10度计算
// console.log(textstart_deg)
function degToArc(deg){
return deg*2*Math.PI*r_text/360;
}
// var m=document.querySelectorAll("circle")[3];
circle.setAttribute('transform','rotate(-'+textstart_deg+' 90 90)');
// midcircle.setAttribute('stroke-dasharray', arc_length+' '+(2*Math.PI*r_text-arc_length));
textstart_deg = 0;
}
return {
setContent: setContent
}
}
console.log("------ q/svgHeader2.js debug ------");
var SvgHeader = function (el, textid) {
var el = el;
var width = 180;
var height = 180;
var NS = "http://www.w3.org/2000/svg";
var xlinkNS = "http://www.w3.org/1999/xlink";
var svg = document.createElementNS(NS, "svg");
// var rec1 = document.createElementNS(NS, "path");
// var rec2 = document.createElementNS(NS, "path");
var circle = document.createElementNS(NS, "path");
var text = document.createElementNS(NS, "text");
var textPath = document.createElementNS(NS, "textPath");
svg.setAttribute("viewBox", "0 0" + " " + width + " " + height);
circle.setAttribute("d", "m 90,12 A 78,78 0 1,0 91,12");
circle.setAttribute("id", textid);
circle.setAttribute("class", "text_circle");
textPath.setAttributeNS(xlinkNS, "xlink:href", "#" + textid);
textPath.setAttribute("id", "textpath" + textid);
text.appendChild(textPath);
svg.appendChild(circle);
svg.appendChild(text);
textPath.textContent = "";
el.appendChild(svg);
var textend_deg = 120;
var r_text = 80;
svg.querySelectorAll(".circle");
function setContent(content) {
// textPath.textContent = '';
textPath.textContent = content;
// console.log('content')
// console.log(content)
// console.log(text.textLength)//暂不能删除
// console.log(text.getComputedTextLength())
// console.log(text.getNumberOfChars())
// var textstart_deg =text.textLength.animVal.value; //使用svg内部精确的计算值计算
var textstart_deg = 186 - (content.length * 9) / 2; // 每个字符按10度计算
// console.log(textstart_deg)
function degToArc(deg) {
return (deg * 2 * Math.PI * r_text) / 360;
}
// var m=document.querySelectorAll("circle")[3];
circle.setAttribute("transform", "rotate(-" + textstart_deg + " 90 90)");
// midcircle.setAttribute('stroke-dasharray', arc_length+' '+(2*Math.PI*r_text-arc_length));
textstart_deg = 0;
}
return {
setContent: setContent,
};
};
// var circular_as = $('.circular').eq(0).get()[0];
// var svgHeaderAs = new SvgHeader(circular_as,'textcircleas');
// svgHeaderAs.setContent('333333333333')
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment