|
@@ -261,56 +261,67 @@ export class SFengParser extends SParser {
|
|
|
columns: Column[] = [],
|
|
|
walls: Wall[] = [],
|
|
|
virtualWall: VirtualWall[] = [],
|
|
|
- doors: Door[] = [];
|
|
|
- result = result
|
|
|
- .map((t: any) => {
|
|
|
- if (t.target) {
|
|
|
- if (t.target._data && t.target._data.vertices) {
|
|
|
- let arr = t.target._data.vertices,
|
|
|
- type = t.typeID,
|
|
|
- outline = [];
|
|
|
- for (let i = 0; i < arr.length - 1; i += 2) {
|
|
|
- outline.push({
|
|
|
- X: arr[i] - maxx,
|
|
|
- Y: arr[i + 1] - maxy
|
|
|
- });
|
|
|
- }
|
|
|
- if (this.spaceType.indexOf(type) > -1) {
|
|
|
- spaces.push({
|
|
|
- // @ts-ignore
|
|
|
- OutLine: [outline],
|
|
|
- Name: t.target.name,
|
|
|
- Location: {
|
|
|
- // @ts-ignore
|
|
|
- Points: [this.getAverageVal([outline])]
|
|
|
- },
|
|
|
- Type: t.typeID,
|
|
|
- // @ts-ignore
|
|
|
- Tag: SFengParser.typeIdMap[t.typeID],
|
|
|
- SourceId: t.FID,
|
|
|
- Height: t.target.height
|
|
|
- });
|
|
|
- } else if (this.columnType.indexOf(type) > -1) {
|
|
|
- // @ts-ignore
|
|
|
- columns.push({ OutLine: [outline] });
|
|
|
- } else if (this.wallType.indexOf(type) > -1) {
|
|
|
+ pList: any[] = [];
|
|
|
+ result.forEach((t: any) => {
|
|
|
+ if (t.target) {
|
|
|
+ let type = t.typeID;
|
|
|
+ if (t.target._data && t.target._data.vertices) {
|
|
|
+ let arr = t.target._data.vertices,
|
|
|
+ outline = [];
|
|
|
+ for (let i = 0; i < arr.length - 1; i += 2) {
|
|
|
+ outline.push({
|
|
|
+ X: arr[i] - maxx,
|
|
|
+ Y: arr[i + 1] - maxy
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (this.spaceType.indexOf(type) > -1) {
|
|
|
+ spaces.push({
|
|
|
// @ts-ignore
|
|
|
- walls.push({ OutLine: [outline] });
|
|
|
- } else if (
|
|
|
- this.virtualWallType.indexOf(type) > -1
|
|
|
- ) {
|
|
|
+ OutLine: [outline],
|
|
|
+ Name: t.target.name,
|
|
|
+ Location: {
|
|
|
+ // @ts-ignore
|
|
|
+ Points: [this.getAverageVal([outline])]
|
|
|
+ },
|
|
|
+ Type: t.typeID,
|
|
|
// @ts-ignore
|
|
|
- virtualWall.push({ OutLine: [outline] });
|
|
|
- }
|
|
|
+ Tag: SFengParser.typeIdMap[t.typeID],
|
|
|
+ SourceId: t.FID,
|
|
|
+ Height: t.target.height
|
|
|
+ });
|
|
|
+ } else if (this.columnType.indexOf(type) > -1) {
|
|
|
+ // @ts-ignore
|
|
|
+ columns.push({ OutLine: [outline] });
|
|
|
+ } else if (this.wallType.indexOf(type) > -1) {
|
|
|
+ // @ts-ignore
|
|
|
+ walls.push({ OutLine: [outline] });
|
|
|
+ } else if (this.virtualWallType.indexOf(type) > -1) {
|
|
|
+ // @ts-ignore
|
|
|
+ virtualWall.push({ OutLine: [outline] });
|
|
|
}
|
|
|
}
|
|
|
- })
|
|
|
- .filter((item: any) => item);
|
|
|
+ if (this.poiList.indexOf(type) > -1) {
|
|
|
+ pList.push({
|
|
|
+ Name: t.target.name,
|
|
|
+ Pos: {
|
|
|
+ X: t.mapCoord.x - maxx,
|
|
|
+ Y: t.mapCoord.y - maxy
|
|
|
+ },
|
|
|
+ Type: t.typeID,
|
|
|
+ // @ts-ignore
|
|
|
+ Tag: SFengParser.typeIdMap[t.typeID],
|
|
|
+ Height: t.target.height,
|
|
|
+ SourceId: t.ID
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
obj = {
|
|
|
Spaces: spaces,
|
|
|
Columns: columns,
|
|
|
Walls: walls,
|
|
|
- VirtualWalls: virtualWall
|
|
|
+ VirtualWalls: virtualWall,
|
|
|
+ PList: pList
|
|
|
};
|
|
|
_fn(obj);
|
|
|
});
|