UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

2 lines (1 loc) 1.09 kB
import{createLayerDef as r}from"../../../../renderer";import L from"../../../../store";import{isPathwayLayer as p}from"../../../../utils/is-pathway-layer";import{WF_CURRENT_POSITION_LAYER_NAME as d,WF_LINES_ANIMATED_LAYER_NAME as N,WF_LINES_LAYER_NAME as R,WF_POINTS_LAYER_NAME as u,WF_TRAIL_LAYER_NAME as h}from"../../../../wayfinding/layers";import{createTrafficLayers as M}from"../../traffic/trafficLayers";import{configBoothsBadges as w}from"./config-booth-badge";import I from"./config-load-layer";import{MARKER_LAYER_NAME as P}from"./config-markers";export default function T(f){let{layers:t,defaultLayer:n}=L.layerStore;if(n){const o=[].concat(t),e=t.find(i=>i===n),s=t.indexOf(e);o.splice(s,1),t=[e].concat(o)}const _=t.filter(o=>!o.rootParent).map(o=>I(o,f));return Promise.all(_).then(o=>{const e=r(u,[],{dim:!1,interactive:!0}),s=r(R,[],{dim:!1}),i=r(P,[]),y=r(h,[],{dim:!1}),A=r(N,[],{dim:!1}),E=r(d,[],{dim:!1}),m=[],c=[];for(const a of o.flat())p(a.name)?(a.dim=!1,c.push(a)):m.push(a);const l=w(f,"root",L.boothStore.booths);return[...m,...l?[l]:[],...c,...M(),i,y,s,A,e,E]})}