|
|
@ -1,4 +1,4 @@ |
|
|
var Map_QM, renderFrame = -1, pathCameraState, stats, stateTime, isJUZ = false, hasLine = false, dir = false, iot = false, shopTime, debug = false; //dir--自定义地图大小适应不同版本的地图大小
|
|
|
|
|
|
|
|
|
var Map_QM, renderFrame = -1, pathCameraState, stats, stateTime, isJUZ = false, hasLine = false, dir = false, iot = true, shopTime, debug = false; //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: '洗手间' }, |
|
|
@ -65,7 +65,7 @@ QMUtil = function () { |
|
|
g_col: "#ffffff", |
|
|
g_col: "#ffffff", |
|
|
a_int: 0.5 |
|
|
a_int: 0.5 |
|
|
}; |
|
|
}; |
|
|
this.m_zoom = 1.2; |
|
|
|
|
|
|
|
|
this.m_zoom = 1.2; //2D地图缩放大小
|
|
|
this._clock = new THREE.Clock(); |
|
|
this._clock = new THREE.Clock(); |
|
|
this._indexPathFloor = 0; // 遍历途径数据
|
|
|
this._indexPathFloor = 0; // 遍历途径数据
|
|
|
this.changeDist = { inner: 350, outner: 900 }; //室内外切换的极限值, 如果 inner小于minDis 则不支持缩放切换
|
|
|
this.changeDist = { inner: 350, outner: 900 }; //室内外切换的极限值, 如果 inner小于minDis 则不支持缩放切换
|
|
|
@ -2026,6 +2026,7 @@ MainMap_QM.prototype = { |
|
|
Map_QM.controls.object = Map_QM.camera; |
|
|
Map_QM.controls.object = Map_QM.camera; |
|
|
Map_QM.shawLight.castShadow = Map_QM.util.options.shadow; |
|
|
Map_QM.shawLight.castShadow = Map_QM.util.options.shadow; |
|
|
Map_QM.controls.maxPolarAngle = Math.PI / 2 - 0.2; |
|
|
Map_QM.controls.maxPolarAngle = Math.PI / 2 - 0.2; |
|
|
|
|
|
Map_QM.controls.setZoom(1); |
|
|
Map_QM.camera.updateProjectionMatrix(); //必须update
|
|
|
Map_QM.camera.updateProjectionMatrix(); //必须update
|
|
|
Map_QM.camera.position.set(Map_QM.util.guiOptions.cameraX, Map_QM.util.guiOptions.cameraY, Map_QM.util.guiOptions.cameraZ); |
|
|
Map_QM.camera.position.set(Map_QM.util.guiOptions.cameraX, Map_QM.util.guiOptions.cameraY, Map_QM.util.guiOptions.cameraZ); |
|
|
Map_QM.changeIconState(state); |
|
|
Map_QM.changeIconState(state); |
|
|
@ -2165,10 +2166,6 @@ MainMap_QM.prototype = { |
|
|
Map_QM.mapArr[t][i].labelObj.traverse((obj) => { |
|
|
Map_QM.mapArr[t][i].labelObj.traverse((obj) => { |
|
|
obj.visible = false; |
|
|
obj.visible = false; |
|
|
}); |
|
|
}); |
|
|
Map_QM.mapArr[t][i].iconLabel.traverse((obj) => { |
|
|
|
|
|
obj.visible = false; |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
Map_QM.mapArr[t][i].tagObj.traverse((obj) => { |
|
|
Map_QM.mapArr[t][i].tagObj.traverse((obj) => { |
|
|
obj.visible = false; |
|
|
obj.visible = false; |
|
|
}); |
|
|
}); |
|
|
@ -2189,9 +2186,6 @@ MainMap_QM.prototype = { |
|
|
Map_QM.mapArr[build][i].labelObj.traverse((obj) => { |
|
|
Map_QM.mapArr[build][i].labelObj.traverse((obj) => { |
|
|
obj.visible = true; |
|
|
obj.visible = true; |
|
|
}); |
|
|
}); |
|
|
Map_QM.mapArr[build][i].iconLabel.traverse((obj) => { |
|
|
|
|
|
obj.visible = true; |
|
|
|
|
|
}); |
|
|
|
|
|
Map_QM.mapArr[build][i].showTagObj.traverse((obj) => { |
|
|
Map_QM.mapArr[build][i].showTagObj.traverse((obj) => { |
|
|
obj.visible = true; |
|
|
obj.visible = true; |
|
|
}); |
|
|
}); |
|
|
@ -2323,15 +2317,7 @@ MainMap_QM.prototype = { |
|
|
if (Map_QM.util.initModelArr.length > 0 && Map_QM.util.changeDist.inner > Map_QM.util.options.minDis) { |
|
|
if (Map_QM.util.initModelArr.length > 0 && Map_QM.util.changeDist.inner > Map_QM.util.options.minDis) { |
|
|
Map_QM.controls.maxDistance = Map_QM.util.changeDist.inner; |
|
|
Map_QM.controls.maxDistance = Map_QM.util.changeDist.inner; |
|
|
} |
|
|
} |
|
|
if (Map_QM.camera == Map_QM.cameraOrtho) { |
|
|
|
|
|
Map_QM.util.setModelState('3d') |
|
|
|
|
|
Map_QM.camera = Map_QM.cameraPerspective |
|
|
|
|
|
Map_QM.controls.setZoom(zoom) |
|
|
|
|
|
Map_QM.shawLight.castShadow = Map_QM.util.options.shadow; |
|
|
|
|
|
Map_QM.controls.object = Map_QM.camera |
|
|
|
|
|
Map_QM.controls.enabled = true |
|
|
|
|
|
Map_QM.controls.enableRotate = true |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
Map_QM.controls.setZoom(zoom) |
|
|
let vat = Map_QM.mapBackToWorld(centerPoint.x, centerPoint.y, 0); |
|
|
let vat = Map_QM.mapBackToWorld(centerPoint.x, centerPoint.y, 0); |
|
|
TweenMax.to(Map_QM.controls.object.position, 0.1, { |
|
|
TweenMax.to(Map_QM.controls.object.position, 0.1, { |
|
|
x: vat.x, delay: 0.1, onComplete: function () { |
|
|
x: vat.x, delay: 0.1, onComplete: function () { |
|
|
@ -2362,6 +2348,7 @@ MainMap_QM.prototype = { |
|
|
* |
|
|
* |
|
|
*/ |
|
|
*/ |
|
|
onShowDeviceSite: function () { |
|
|
onShowDeviceSite: function () { |
|
|
|
|
|
this.changeMapModel("3D"); |
|
|
this.showFloor(this.util.deviceObj.floor); |
|
|
this.showFloor(this.util.deviceObj.floor); |
|
|
}, |
|
|
}, |
|
|
/** |
|
|
/** |
|
|
@ -2855,7 +2842,7 @@ MainMap_QM.prototype = { |
|
|
Map_QM.controls.update(); |
|
|
Map_QM.controls.update(); |
|
|
Map_QM.renderer.render(Map_QM.scene, Map_QM.camera); |
|
|
Map_QM.renderer.render(Map_QM.scene, Map_QM.camera); |
|
|
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]){ |
|
|
|
|
|
|
|
|
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 ); |
|
|
} |
|
|
} |
|
|
@ -3326,6 +3313,7 @@ MainMap_QM.prototype = { |
|
|
shopTime = setTimeout(() => { |
|
|
shopTime = setTimeout(() => { |
|
|
clearTimeout(shopTime); |
|
|
clearTimeout(shopTime); |
|
|
isJUZ = false; |
|
|
isJUZ = false; |
|
|
|
|
|
Map_QM.controls.setZoom(1) |
|
|
Map_QM.controls.reset() |
|
|
Map_QM.controls.reset() |
|
|
}, 3000); |
|
|
}, 3000); |
|
|
} |
|
|
} |
|
|
@ -3420,12 +3408,10 @@ MainMap_QM.prototype = { |
|
|
|
|
|
|
|
|
//内部碰撞检测
|
|
|
//内部碰撞检测
|
|
|
collLabel: function () { |
|
|
collLabel: function () { |
|
|
if (!Map_QM) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
if (!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); |
|
|
@ -3507,7 +3493,7 @@ MainMap_QM.prototype = { |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @api {方法} bounceIcon({type:"xsj"}) 图标弹跳 |
|
|
|
|
|
|
|
|
* @api {方法} bounceIcon("xsj") 图标弹跳 |
|
|
* @apiGroup 地图导航 |
|
|
* @apiGroup 地图导航 |
|
|
* @apiDescription 地图图标弹跳效果 |
|
|
* @apiDescription 地图图标弹跳效果 |
|
|
* @apiVersion 4.0.0 |
|
|
* @apiVersion 4.0.0 |
|
|
@ -3517,7 +3503,7 @@ MainMap_QM.prototype = { |
|
|
* |
|
|
* |
|
|
* @apiParamExample {String} 请求示例 |
|
|
* @apiParamExample {String} 请求示例 |
|
|
* |
|
|
* |
|
|
* Map_QM.bounceIcon({type:"xsj"}); |
|
|
|
|
|
|
|
|
* Map_QM.bounceIcon("xsj"); |
|
|
* |
|
|
* |
|
|
*/ |
|
|
*/ |
|
|
bounceIcon: function (iconType) { |
|
|
bounceIcon: function (iconType) { |
|
|
@ -4826,6 +4812,7 @@ MainMap_QM.prototype = { |
|
|
*/ |
|
|
*/ |
|
|
clearFloor: function (fIndex = -1, reSet = true) { |
|
|
clearFloor: function (fIndex = -1, reSet = true) { |
|
|
isJUZ = false; |
|
|
isJUZ = false; |
|
|
|
|
|
Map_QM.controls.setZoom(1) |
|
|
if (fIndex == -1) { |
|
|
if (fIndex == -1) { |
|
|
fIndex = Map_QM.util.deviceObj.floor; |
|
|
fIndex = Map_QM.util.deviceObj.floor; |
|
|
} |
|
|
} |
|
|
@ -5127,9 +5114,6 @@ FloorMap_QM = function (bIndex, fIndex, floorName) { |
|
|
this.allObj.rotation.x = Math.PI / -2; |
|
|
this.allObj.rotation.x = Math.PI / -2; |
|
|
this.labelObj = new THREE.Group(); |
|
|
this.labelObj = new THREE.Group(); |
|
|
this.labelObj.renderOrder = 100; |
|
|
this.labelObj.renderOrder = 100; |
|
|
this.iconLabel = new THREE.Group(); |
|
|
|
|
|
this.iconLabel.renderOrder = 100; |
|
|
|
|
|
|
|
|
|
|
|
this.floorOrder = fIndex; |
|
|
this.floorOrder = fIndex; |
|
|
this.buildOrder = bIndex |
|
|
this.buildOrder = bIndex |
|
|
this.floorName = floorName; |
|
|
this.floorName = floorName; |
|
|
@ -5151,7 +5135,6 @@ FloorMap_QM = function (bIndex, fIndex, floorName) { |
|
|
this.allObj.add(this.serObj); |
|
|
this.allObj.add(this.serObj); |
|
|
this.allObj.add(this.devObj); |
|
|
this.allObj.add(this.devObj); |
|
|
this.allObj.add(this.labelObj); |
|
|
this.allObj.add(this.labelObj); |
|
|
this.allObj.add(this.iconLabel); |
|
|
|
|
|
this.allObj.add(this.tagObj); |
|
|
this.allObj.add(this.tagObj); |
|
|
//标签
|
|
|
//标签
|
|
|
this.showTagObj = new THREE.Group(); |
|
|
this.showTagObj = new THREE.Group(); |
|
|
@ -6027,7 +6010,6 @@ MyModel_QM.prototype.MyModelShape = function (areaArr, howllowArr, opObj, entity |
|
|
} |
|
|
} |
|
|
// 创建模型
|
|
|
// 创建模型
|
|
|
let mesh = new THREE.Mesh(scanGeometry, meshMaterial); |
|
|
let mesh = new THREE.Mesh(scanGeometry, meshMaterial); |
|
|
|
|
|
|
|
|
if (!Map_QM.util.toMapModel && opObj.type != "wall") { |
|
|
if (!Map_QM.util.toMapModel && opObj.type != "wall") { |
|
|
let cubeEdges = new THREE.EdgesGeometry(scanGeometry, 60); |
|
|
let cubeEdges = new THREE.EdgesGeometry(scanGeometry, 60); |
|
|
let cubeLine = new THREE.LineSegments(cubeEdges, material); |
|
|
let cubeLine = new THREE.LineSegments(cubeEdges, material); |
|
|
@ -6258,7 +6240,8 @@ Facilities_QM = function () { |
|
|
shopDiv.dataset.nameEn = Map_QM.util.iconEn[obj.title]; |
|
|
shopDiv.dataset.nameEn = Map_QM.util.iconEn[obj.title]; |
|
|
let shopLabel = new THREE.CSS2DObject(shopDiv); |
|
|
let shopLabel = new THREE.CSS2DObject(shopDiv); |
|
|
shopLabel.position.set(obj.x, -1 * obj.y, 30); |
|
|
shopLabel.position.set(obj.x, -1 * obj.y, 30); |
|
|
_this.iconLabel.add(shopLabel); |
|
|
|
|
|
|
|
|
shopLabel.userData.mapShow = true; |
|
|
|
|
|
_this.labelObj.add(shopLabel); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|