UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

2 lines (1 loc) • 575 B
import{createImageCanvas as l,createYahCanvas as u}from"../../components/Map/drawing/config/canvases";import{decreaseByPercentage as o}from"../../utils/math";const n="yah",A="#ff4343",C=64,E=90,_=32;function H(e,a){const r=e.get(n);return r?(r.id=n,l(r,o(C,_),o(E,_),a)):u(a,A)}export function createYahHandler({wayfinding:e,iconMap:a,pixelRatio:r,floorContext:I}){const c=H(a,r);return c.id="current-location-2",t=>{if(!t){e.setIcon(n,null),e.flush();return}const s=I.isLayerVisible(t.layer);e.setIcon(n,{canvas:c,x:t.x,y:t.y,hidden:!s,dimmed:!s,origin:[.5,1]}),e.flush()}}