|
@@ -58,3 +58,48 @@ var fileArr = [
|
|
'/guide/lib/echarts.min.js',
|
|
'/guide/lib/echarts.min.js',
|
|
'/uploads/wechat/163607/file/杨浦16/removeMark.js',//清除标注脚本
|
|
'/uploads/wechat/163607/file/杨浦16/removeMark.js',//清除标注脚本
|
|
'/uploads/wechat/163607/file/杨浦16/UIAnchor.js',//UI界面脚本
|
|
'/uploads/wechat/163607/file/杨浦16/UIAnchor.js',//UI界面脚本
|
|
|
|
+ '/uploads/wechat/163607/file/杨浦16/FloorClick.js',//创建切换楼层脚本
|
|
|
|
+ '/uploads/wechat/163607/file/杨浦16/MainPanel.js',//公共工具功能脚本
|
|
|
|
+ '/uploads/wechat/163607/file/杨浦16/CreateHtml.js',//创建页面元素脚本
|
|
|
|
+ '/uploads/wechat/163607/file/杨浦16/public.js',//公共场景功能脚本
|
|
|
|
+ '/uploads/wechat/163607/file/杨浦16/ChangeScene.js',//场景切换脚本
|
|
|
|
+];
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * 说明:加载外部文件
|
|
|
|
+ */
|
|
|
|
+THING.Utils.dynamicLoad(fileArr, function () {
|
|
|
|
+ app.on('load', function (ev) {
|
|
|
|
+ skyBox = app.skyBox; // 获取天空盒
|
|
|
|
+ app.level.change(ev.campus); // 切换至园区层级
|
|
|
|
+ ev.campus.azimuth = '180';
|
|
|
|
+ mainPanle = new MainPanel(app);// 界面的类
|
|
|
|
+ // setupNavpanel();
|
|
|
|
+ // creatFloorChoose(); //======================================本地数据测试===============================================
|
|
|
|
+ // 获取园区在CampusBuilder编辑时保存的地理位置
|
|
|
|
+ let tjsLnglat = app.root.defaultCampus.extraData;
|
|
|
|
+ if (tjsLnglat != undefined && tjsLnglat != null) {
|
|
|
|
+ tjsLnglat = tjsLnglat.coordinates;
|
|
|
|
+ if (tjsLnglat != undefined && tjsLnglat != null) {
|
|
|
|
+ tjsLnglat = tjsLnglat.split(",");
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ ev.campus.extraData = { coordinates: "116.4641,39.98606" } // 园区绑定默认经纬度,地图才生效
|
|
|
|
+ }
|
|
|
|
+ createHtml(); // 创建html
|
|
|
|
+ restarRotate(); // 自动旋转
|
|
|
|
+
|
|
|
|
+ curCampus = ev.campus;
|
|
|
|
+ // 进入层级切换
|
|
|
|
+ app.level.change(ev.campus);
|
|
|
|
+ });
|
|
|
|
+});
|
|
|
|
+
|
|
|
|
+// 监听建筑层级的 LeaveLevel 事件
|
|
|
|
+app.on(THING.EventType.LeaveLevel, ".Building", function (ev) {
|
|
|
|
+ // 要进入的层级对象
|
|
|
|
+ var current = ev.current;
|
|
|
|
+ // 上一层级对象(退出的层级)
|
|
|
|
+ var preObject = ev.previous;
|
|
|
|
+ if (current.parent === preObject) {
|
|
|
|
+ removeMark();
|