UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

42 lines (41 loc) • 1.24 kB
(function() { try { var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}; e.SENTRY_RELEASE = { id: "3.39.1" }; var t = new e.Error().stack; t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "233b3b22-a917-48c8-8f7e-f558b0dbd9d8", e._sentryDebugIdIdentifier = "sentry-dbid-233b3b22-a917-48c8-8f7e-f558b0dbd9d8"); } catch {} })(); import { c as e, vt as t } from "./store-CARxK2Ft.js"; //#region src/components/Map/viewport.ts function n(e) { return { canvasToPlan: (t) => e.current.api.canvasToPlan(t), planToCanvas: (t) => e.current.api.planToCanvas(t), isVisible: (t) => e.current.api.isVisible(t) }; } function r(e) { a = e; } function i() { return a; } var a; function o(n) { let r = i(); if (!n || !r) throw Error("Canvas not ready"); let a = r.canvasToPlan({ x: n.clientWidth / 2, y: n.clientHeight / 2 }); if (!a) throw Error("The camera is not looking at the plan"); let o = e.layerStore.visible.find((e) => e.mode === t.TurnedOff || e.mode === t.TurnedOn); return { x: a.x, y: a.y, z: (o == null ? void 0 : o.name) || null }; } //#endregion export { r as i, n, i as r, o as t };