|
@@ -209,6 +209,8 @@ export class SFengParser extends SParser {
|
|
120009,
|
|
120009,
|
|
120010
|
|
120010
|
|
];
|
|
];
|
|
|
|
+ /** 当前地图的楼层list */
|
|
|
|
+ gnameToGid = {};
|
|
|
|
|
|
/** 构造体 */
|
|
/** 构造体 */
|
|
constructor(
|
|
constructor(
|
|
@@ -235,15 +237,30 @@ export class SFengParser extends SParser {
|
|
* 解析数据
|
|
* 解析数据
|
|
*
|
|
*
|
|
* @param currentMapId 当前模型id
|
|
* @param currentMapId 当前模型id
|
|
- * @param groupId 当前楼层
|
|
|
|
|
|
+ * @param groupId 当前楼层(前台传入为gname)
|
|
* @param _fn 查询成功回调函数(返回参数为FloorData)
|
|
* @param _fn 查询成功回调函数(返回参数为FloorData)
|
|
* */
|
|
* */
|
|
parseData(currentMapId: string, groupId: string, _fn: Function): void {
|
|
parseData(currentMapId: string, groupId: string, _fn: Function): void {
|
|
|
|
+ // TODO 同一地图不需要重复加载
|
|
this.fmap.openMapById(currentMapId, (err: any) => {
|
|
this.fmap.openMapById(currentMapId, (err: any) => {
|
|
console.log("错误信息", err);
|
|
console.log("错误信息", err);
|
|
});
|
|
});
|
|
this.fmap.on("loadComplete", () => {
|
|
this.fmap.on("loadComplete", () => {
|
|
|
|
+ if (this.currentMapId != currentMapId) {
|
|
|
|
+ this.currentMapId = currentMapId;
|
|
|
|
+ this.gnameToGid = {};
|
|
|
|
+ // @ts-ignore
|
|
|
|
+ this.fmap.listGroups.forEach(t => {
|
|
|
|
+ // @ts-ignore
|
|
|
|
+ this.gnameToGid[t.gname] = t.gid;
|
|
|
|
+ });
|
|
|
|
+ }
|
|
let obj = {};
|
|
let obj = {};
|
|
|
|
+ // @ts-ignore
|
|
|
|
+ groupId = this.gnameToGid[groupId];
|
|
|
|
+ if (!groupId) {
|
|
|
|
+ _fn({ err: "楼层不正确" });
|
|
|
|
+ }
|
|
// 切换至当前楼层才可查询
|
|
// 切换至当前楼层才可查询
|
|
this.fmap.focusGroupID = groupId;
|
|
this.fmap.focusGroupID = groupId;
|
|
// 创建搜索分析对象
|
|
// 创建搜索分析对象
|