Browse Source

fix: ci

pull/1/head
高志龙 3 years ago
parent
commit
d8b272746e
  1. 43
      public/static/qm/MainMap_QM.js

43
public/static/qm/MainMap_QM.js

@ -1,4 +1,4 @@
var Map_QM, renderFrame = -1, pathCameraState, stats, stateTime, isJUZ = false, hasLine = false, dir = false, iot = true, shopTime, debug = false; //dir--自定义地图大小适应不同版本的地图大小
var Map_QM, renderFrame = -1, pathCameraState, stats, stateTime, isJUZ = false, hasLine = false, dir = false, iot = false, shopTime, debug = true; //dir--自定义地图大小适应不同版本的地图大小
//basePath 基础路径 graphPath最佳路径 ftPath 扶梯路径 dtPath 电梯路径 //basePath 基础路径 graphPath最佳路径 ftPath 扶梯路径 dtPath 电梯路径
var typeObj = [{ ft: 0, type: 0, code: 'ft', name: '扶梯' }, { upft: 1, type: 1, code: 'upft', name: '上扶梯' }, { downft: 2, type: 2, code: 'downft', name: '下扶梯' }, { mys: 3, type: 3, code: 'mys', name: '母婴室' }, { xsj: 4, type: 4, code: 'xsj', name: '洗手间' }, var typeObj = [{ ft: 0, type: 0, code: 'ft', name: '扶梯' }, { upft: 1, type: 1, code: 'upft', name: '上扶梯' }, { downft: 2, type: 2, code: 'downft', name: '下扶梯' }, { mys: 3, type: 3, code: 'mys', name: '母婴室' }, { xsj: 4, type: 4, code: 'xsj', name: '洗手间' },
@ -1389,14 +1389,14 @@ MainMap_QM.prototype = {
initOptions: function (options) { initOptions: function (options) {
//初始化参数 //初始化参数
if (this.util.allMap[this.util.selectBuild].playSpeed) { if (this.util.allMap[this.util.selectBuild].playSpeed) {
this.util.options.mapScale = this.util.allMap[this.util.selectBuild].hasOwnProperty("scale") ? parseInt(this.util.allMap[this.util.selectBuild].scale) : 18;
this.util.options.playSpeed = this.util.allMap[this.util.selectBuild].hasOwnProperty("playSpeed") ? parseInt(this.util.allMap[this.util.selectBuild].playSpeed) : 6;
this.util.options.collision = this.util.allMap[this.util.selectBuild].hasOwnProperty("collision") ? this.util.allMap[this.util.selectBuild].collision : true;
this.util.options.navColor = this.util.allMap[this.util.selectBuild].hasOwnProperty("navColor") ? this.util.allMap[this.util.selectBuild].navColor : 0xEE6A50;
this.util.options.aRadius = this.util.allMap[this.util.selectBuild].hasOwnProperty("aRadius") ? parseInt(this.util.allMap[this.util.selectBuild].aRadius) : 2;
this.util.options.boxShop = this.util.allMap[this.util.selectBuild].hasOwnProperty("boxShop") ? this.util.allMap[this.util.selectBuild].boxShop.split(",") : [];
this.util.options.shopStyle = this.util.allMap[this.util.selectBuild].hasOwnProperty("shopStyle") ? this.util.allMap[this.util.selectBuild].shopStyle : "shopName";
this.util.options.modelIcon = this.util.allMap[this.util.selectBuild].hasOwnProperty("modelIcon") ? this.util.allMap[this.util.selectBuild].modelIcon : true;
this.util.allMap[this.util.selectBuild].hasOwnProperty("scale") && (this.util.options.mapScale = parseInt(this.util.allMap[this.util.selectBuild].scale));
this.util.allMap[this.util.selectBuild].hasOwnProperty("playSpeed") && (this.util.options.playSpeed = parseInt(this.util.allMap[this.util.selectBuild].playSpeed));
this.util.allMap[this.util.selectBuild].hasOwnProperty("collision") && (this.util.options.collision = this.util.allMap[this.util.selectBuild].collision);
this.util.allMap[this.util.selectBuild].hasOwnProperty("navColor") && (this.util.options.navColor = this.util.allMap[this.util.selectBuild].navColor);
this.util.allMap[this.util.selectBuild].hasOwnProperty("aRadius") && (this.util.options.aRadius = parseInt(this.util.allMap[this.util.selectBuild].aRadius));
this.util.allMap[this.util.selectBuild].hasOwnProperty("boxShop") && (this.util.options.boxShop = this.util.allMap[this.util.selectBuild].boxShop.split(","));
this.util.allMap[this.util.selectBuild].hasOwnProperty("shopStyle") && (this.util.options.shopStyle = this.util.allMap[this.util.selectBuild].shopStyle);
this.util.allMap[this.util.selectBuild].hasOwnProperty("modelIcon") && (this.util.options.modelIcon = this.util.allMap[this.util.selectBuild].modelIcon);
this.hemiLight.color = new THREE.Color(this.util.allMap[this.util.selectBuild].s_col || "#fffff0"); this.hemiLight.color = new THREE.Color(this.util.allMap[this.util.selectBuild].s_col || "#fffff0");
this.hemiLight.groundColor = new THREE.Color(this.util.allMap[this.util.selectBuild].g_col || "#ffffff"); this.hemiLight.groundColor = new THREE.Color(this.util.allMap[this.util.selectBuild].g_col || "#ffffff");
@ -2164,13 +2164,13 @@ MainMap_QM.prototype = {
for (let i = 0; i < Map_QM.mapArr[t].length; i++) { for (let i = 0; i < Map_QM.mapArr[t].length; i++) {
Map_QM.mapArr[t][i].allObj.visible = t == build ? true : false; Map_QM.mapArr[t][i].allObj.visible = t == build ? true : false;
Map_QM.mapArr[t][i].labelObj.traverse((obj) => { Map_QM.mapArr[t][i].labelObj.traverse((obj) => {
obj.visible = false;
obj.element && (obj.element.style.visibility = "hidden");
}); });
Map_QM.mapArr[t][i].tagObj.traverse((obj) => { Map_QM.mapArr[t][i].tagObj.traverse((obj) => {
obj.visible = false;
obj.element && (obj.element.style.visibility = "hidden");
}); });
Map_QM.mapArr[t][i].showTagObj.traverse((obj) => { Map_QM.mapArr[t][i].showTagObj.traverse((obj) => {
obj.visible = false;
obj.element && (obj.element.style.visibility = "hidden");
}); });
} }
} }
@ -2179,15 +2179,14 @@ MainMap_QM.prototype = {
} else { } else {
return; return;
} }
for (let i = 0; i < Map_QM.mapArr[build].length; i++) { for (let i = 0; i < Map_QM.mapArr[build].length; i++) {
if (i == fIndex || (i == midIndex && Map_QM.util.options.overlap) || (i == endIndex && Map_QM.util.options.overlap)) { if (i == fIndex || (i == midIndex && Map_QM.util.options.overlap) || (i == endIndex && Map_QM.util.options.overlap)) {
Map_QM.mapArr[build][i].allObj.visible = true; Map_QM.mapArr[build][i].allObj.visible = true;
Map_QM.mapArr[build][i].labelObj.traverse((obj) => { Map_QM.mapArr[build][i].labelObj.traverse((obj) => {
obj.visible = true;
obj.element && (obj.element.style.visibility = "visible")
}); });
Map_QM.mapArr[build][i].showTagObj.traverse((obj) => { Map_QM.mapArr[build][i].showTagObj.traverse((obj) => {
obj.visible = true;
obj.element && (obj.element.style.visibility = "visible");
}); });
} else { } else {
Map_QM.mapArr[build][i].allObj.visible = false; Map_QM.mapArr[build][i].allObj.visible = false;
@ -2519,7 +2518,7 @@ MainMap_QM.prototype = {
*/ */
changeStateShopPro: function (isShow = false) { changeStateShopPro: function (isShow = false) {
Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].tagObj.traverse((obj) => { Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].tagObj.traverse((obj) => {
obj.visible = isShow;
obj.element && (obj.element.style.visibility = isShow?"visible":"hidden");
}); });
}, },
/** /**
@ -2818,7 +2817,7 @@ MainMap_QM.prototype = {
*/ */
startRender: function () { startRender: function () {
Map_QM.cancelRender(); Map_QM.cancelRender();
renderFrame = requestAnimationFrame(Map_QM.startRender);
let T = Map_QM.util._clock.getDelta(); let T = Map_QM.util._clock.getDelta();
Map_QM.util.timeObj.timeS = Map_QM.util.timeObj.timeS + T; Map_QM.util.timeObj.timeS = Map_QM.util.timeObj.timeS + T;
// requestAnimationFrame默认调用render函数60次,通过时间判断,降低renderer.render执行频率 // requestAnimationFrame默认调用render函数60次,通过时间判断,降低renderer.render执行频率
@ -2844,7 +2843,7 @@ MainMap_QM.prototype = {
Map_QM.labelRenderer.render(Map_QM.scene, Map_QM.camera); Map_QM.labelRenderer.render(Map_QM.scene, Map_QM.camera);
if(Map_QM.mapArr[Map_QM.util.selectBuild] && Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor]){ if(Map_QM.mapArr[Map_QM.util.selectBuild] && Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor]){
Map_QM.labelRenderer.renderObject( Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].labelObj, Map_QM.camera ); Map_QM.labelRenderer.renderObject( Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].labelObj, Map_QM.camera );
Map_QM.labelRenderer.renderObject( Map_QM.CSSObject, Map_QM.camera );
Map_QM.labelRenderer.renderObject( Map_QM.CSSObject, Map_QM.camera);
} }
for (let item of Map_QM.mixers) { for (let item of Map_QM.mixers) {
item.update(T); item.update(T);
@ -2859,6 +2858,7 @@ MainMap_QM.prototype = {
//timeS置0 //timeS置0
Map_QM.util.timeObj.timeS = 0; Map_QM.util.timeObj.timeS = 0;
} }
renderFrame = requestAnimationFrame(Map_QM.startRender);
}, },
/** /**
* @api {方法} cancelRender() 取消地图渲染 * @api {方法} cancelRender() 取消地图渲染
@ -3207,6 +3207,7 @@ MainMap_QM.prototype = {
Map_QM.labelRenderer.render(Map_QM.scene, Map_QM.camera); Map_QM.labelRenderer.render(Map_QM.scene, Map_QM.camera);
Map_QM.labelRenderer.renderObject( Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].labelObj, Map_QM.camera ); Map_QM.labelRenderer.renderObject( Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].labelObj, Map_QM.camera );
Map_QM.labelRenderer.zOrder( Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].labelObj ); Map_QM.labelRenderer.zOrder( Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].labelObj );
Map_QM.collLabel();
if (Map_QM.callBackLoadOver) { if (Map_QM.callBackLoadOver) {
let floorData = []; let floorData = [];
for (let i = 0; i < Map_QM.util.allMap.length; i++) { for (let i = 0; i < Map_QM.util.allMap.length; i++) {
@ -3230,7 +3231,7 @@ MainMap_QM.prototype = {
type: "changeFloorOver", type: "changeFloorOver",
data: Map_QM.selectFloor data: Map_QM.selectFloor
}); });
Map_QM.collLabel();
}, },
autoChangeEleAngle: function () { autoChangeEleAngle: function () {
@ -3293,6 +3294,7 @@ MainMap_QM.prototype = {
controlsChock: function () { controlsChock: function () {
Map_QM.autoChangeEleAngle(); Map_QM.autoChangeEleAngle();
Map_QM.collLabel(); Map_QM.collLabel();
/** /**
* @api {事件} MapAngleChange 地图的方向改变 * @api {事件} MapAngleChange 地图的方向改变
* @apiGroup 地图事件 * @apiGroup 地图事件
@ -3411,7 +3413,6 @@ MainMap_QM.prototype = {
if (!Map_QM || !Map_QM.util.options.collision) { if (!Map_QM || !Map_QM.util.options.collision) {
return; return;
} }
clearTimeout(Map_QM.util.timeObj.collTime); clearTimeout(Map_QM.util.timeObj.collTime);
Map_QM.util.timeObj.collTime = setTimeout(() => { Map_QM.util.timeObj.collTime = setTimeout(() => {
clearTimeout(Map_QM.util.timeObj.collTime); clearTimeout(Map_QM.util.timeObj.collTime);
@ -5198,7 +5199,7 @@ FloorMap_QM.prototype = {
obj.rotateY(Map_QM.util.modelArr[i].list[t].rot.y); obj.rotateY(Map_QM.util.modelArr[i].list[t].rot.y);
obj.rotateZ(Map_QM.util.modelArr[i].list[t].rot.z); obj.rotateZ(Map_QM.util.modelArr[i].list[t].rot.z);
sopce.allObj.add(obj); sopce.allObj.add(obj);
} showTagObj
}
}); });
} }
} }

Loading…
Cancel
Save