UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

2 lines (1 loc) • 764 B
import{runInAction as a}from"mobx";import t from"../../store";import{planWhen as u}from"../../utils/plan-reactions.js";import{getPtScaleZoomRatio as m}from"./kiosk-record";export function integrateKioskIntoMap(e,n){e&&a(()=>{if(t.uiState.setKioskData(e),t.uiState.kiosk=n,t.maplibreStore.showMaplibre)return;const o=t.uiState.kiosk?e:{},i=o.mapCenterX!=null&&o.mapCenterY!=null;t.uiState.setMapSettings({centerxy:i?`${o.mapCenterX},${o.mapCenterY}`:"",z:e.z??void 0,bearing:o.mapRollDegrees});const r=m(o);r!==void 0&&t.uiState.changeZoom(r)})}export function integrateKioskIntoWf(e){e&&(e.z!=null&&t.fp.activateFloor({name:e.z.toString()}),u(()=>!!t.uiState.selectedRoute,()=>{const n=t.uiState.selectedRoute;n?.to&&!n.from&&t.routeStore.selectRoute(n,!1,!0)}))}