|
@@ -245,3 +245,66 @@ function registerEvent() {
|
|
|
}
|
|
|
} else {
|
|
|
$('#horizontalExpansion').css({ 'display': 'none' });
|
|
|
+ $('#verticalExpansion').css({ 'display': 'none' });
|
|
|
+ // 进入园区层级
|
|
|
+ if (ev.object.type == 'Campus') {
|
|
|
+ if (building != null) {
|
|
|
+ exitBuildingCloseFloor(building);
|
|
|
+ $('#horizontalExpansion').removeClass('active');
|
|
|
+ $('#verticalExpansion').removeClass('active');
|
|
|
+ building = null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (skyBox != null) {
|
|
|
+ app.skyBox = skyBox;
|
|
|
+ }
|
|
|
+ // 重新创建小地图
|
|
|
+ if ($('#miniMap').hasClass('active')) {
|
|
|
+ destoryMiniMap();
|
|
|
+ createMiniMap();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // 行走按钮的鼠标点击事件
|
|
|
+ $('#moveByFps').on('click', function () {
|
|
|
+ stopRotate();
|
|
|
+ if ($(this).hasClass('active')) {
|
|
|
+ $(this).removeClass('active');
|
|
|
+ if (box != null) {
|
|
|
+ // 恢复默认双击进入层级事件
|
|
|
+ app.resumeEvent(THING.EventType.DBLClick, '*', THING.EventTag.LevelEnterOperation);
|
|
|
+ // 恢复默认右键退出层级事件
|
|
|
+ app.resumeEvent(THING.EventType.Click, '*', THING.EventTag.LevelBackOperation);
|
|
|
+ box.destroy();
|
|
|
+ box = null;
|
|
|
+ }
|
|
|
+ if (fpsCtrl != null) {
|
|
|
+ exitFps();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $(this).addClass('active');
|
|
|
+ // 禁用默认双击进入层级事件
|
|
|
+ app.pauseEvent(THING.EventType.DBLClick, '*', THING.EventTag.LevelEnterOperation);
|
|
|
+ // 禁用默认右键退出层级事件
|
|
|
+ app.pauseEvent(THING.EventType.Click, '*', THING.EventTag.LevelBackOperation);
|
|
|
+ // 记录摄像机当前位置
|
|
|
+ cameraInitPos = [app.camera.position, app.camera.target];
|
|
|
+ createBox();
|
|
|
+ }
|
|
|
+ checkBtnActives(['#mapBg', '#sceneSetting']);
|
|
|
+ });
|
|
|
+ // 全屏按钮的鼠标抬起事件
|
|
|
+ $('#fullScreen').mouseup(function () {
|
|
|
+ if (!fullScreenState) {
|
|
|
+ $('.btn-full-screen').css('display', 'none');
|
|
|
+ $('.btn-narrow').css('display', 'block');
|
|
|
+ $('#fullScreen span').text('退出全屏');
|
|
|
+ fullScreen();
|
|
|
+ fullScreenState = true;
|
|
|
+ } else {
|
|
|
+ $('.btn-full-screen').css('display', 'block');
|
|
|
+ $('.btn-narrow').css('display', 'none');
|
|
|
+ $('#fullScreen span').text('全屏');
|
|
|
+ exitFullScreen();
|
|
|
+ fullScreenState = false;
|
|
|
+ if ($('#mapBg').hasClass('active')) {
|