@expofp/floorplan
Version:
Interactive floor plan library for expos and events
2 lines (1 loc) • 694 B
JavaScript
import{runInAction as a,when as i}from"mobx";import e from"../../store";import{getPtScaleZoomRatio as u}from"./kiosk-record";export function integrateKioskIntoMap(t,n){t&&a(()=>{if(e.uiState.setKioskData(t),e.uiState.kiosk=n,e.maplibreStore.showMaplibre)return;const o=t.mapCenterX!=null&&t.mapCenterY!=null;e.uiState.setMapSettings({centerxy:o?`${t.mapCenterX},${t.mapCenterY}`:"",z:t.z??void 0,bearing:t.mapRollDegrees});const r=u(t);r!==void 0&&e.uiState.changeZoom(r)})}export function integrateKioskIntoWf(t){t&&(t.z!=null&&e.fp.activateFloor({name:t.z.toString()}),i(()=>!!e.uiState.selectedRoute,()=>{const n=e.uiState.selectedRoute;n?.to&&!n.from&&e.routeStore.selectRoute(n,!1,!0)}))}