UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

2 lines (1 loc) 455 B
export function createTrailView({renderer:r,iconProvider:c,floorContext:i,layer:u}){const a=new Set;function o(l,t){if(i.showAllFloors())return!0;const e=i.getActiveFloor();return e?l===e&&t===e:!1}function n(l){r.setTrail(l,null,null),a.delete(l)}return{place(l,t,e){if(!o(t.layer,e.layer)){n(l);return}r.setTrail(l,t,e,{canvas:c.getIcon("trail").canvas,layer:u}),a.add(l)},clear(l){n(l)},clearAll(){for(const l of a)r.setTrail(l,null,null);a.clear()}}}