UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

43 lines (42 loc) • 1.27 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.47.0" }; var t = new e.Error().stack; t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "cd544147-31ec-4446-b8a2-8021e027057b", e._sentryDebugIdIdentifier = "sentry-dbid-cd544147-31ec-4446-b8a2-8021e027057b"); } catch {} })(); import { l as e } from "./store-DTvNQcN7.js"; import { t } from "./LayerStore-DCg-juRT.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 };