|
@@ -5,6 +5,7 @@ import { Space } from "@saga-web/big/lib/types/floor/Space";
|
|
|
import { Column } from "@saga-web/big/lib/types/floor/Column";
|
|
|
import { VirtualWall } from "@saga-web/big/lib/types/floor/VirtualWall";
|
|
|
import { Wall } from "@saga-web/big/lib/types/floor/Wall";
|
|
|
+import Axios from "axios";
|
|
|
|
|
|
/**
|
|
|
* 蜂鸟数据解析器
|
|
@@ -211,6 +212,12 @@ export class SFengParser extends SParser {
|
|
|
];
|
|
|
/** 当前地图的楼层list */
|
|
|
gnameToGid = {};
|
|
|
+ /** 当前底图的主题数据 */
|
|
|
+ mapTheme: any;
|
|
|
+ /** 底图版本号 */
|
|
|
+ version: number | null = null;
|
|
|
+ /** 顶楼地址img */
|
|
|
+ frImg: string = "";
|
|
|
|
|
|
/** 构造体 */
|
|
|
constructor(
|
|
@@ -327,6 +334,31 @@ export class SFengParser extends SParser {
|
|
|
} // Function loadMap()
|
|
|
|
|
|
/**
|
|
|
+ * 加载主题文件
|
|
|
+ *
|
|
|
+ * @param url 主题文件url
|
|
|
+ * @return promise promise对象
|
|
|
+ * */
|
|
|
+ loadTheme(url: string): Promise<void> {
|
|
|
+ return new Promise((resolve, reject): void => {
|
|
|
+ Axios({
|
|
|
+ method: "get",
|
|
|
+ url: url
|
|
|
+ })
|
|
|
+ .then((res: any) => {
|
|
|
+ this.mapTheme = res.data;
|
|
|
+ let data = res.data.storetheme;
|
|
|
+ this.frImg = data[data.length - 1].image;
|
|
|
+ // @ts-ignore
|
|
|
+ resolve(this.frImg);
|
|
|
+ })
|
|
|
+ .catch((res: any) => {
|
|
|
+ console.log(res);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ } // Function loadTheme()
|
|
|
+
|
|
|
+ /**
|
|
|
* 计算平均值
|
|
|
*
|
|
|
* @param Outline 轮廓线束
|