UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

2 lines (1 loc) 696 B
import{getKioskUrlParamKey as s}from"./SetKiosk";export function collectKioskUrlParams(o){const t={};try{const e=n=>{const l=parseFloat(n);return Number.isNaN(l)?null:l},r={x:e,y:e,z:n=>n,heading:e,lat:e,lng:e,iconSizePercent:e,uiScale:e,mapRollDegrees:e,mapInitialPtScale:e,mapPtScale:e,mapCenterX:e,mapCenterY:e,mapPitch:e};for(const n in r){const l=s(n),c=r[n](o.get(l));c!=null&&(t[n]=c)}}catch(e){console.error("collectKioskUrlParams",e)}finally{return t}}export function setKioskUrlParams(o,t,e){try{if(!t)return;for(const r of Object.keys(t))t[r]==null||e?.length&&!e.includes(r)||o.set(s(r),typeof t[r]=="number"?t[r].toFixed(2):`${t[r]}`)}catch(r){console.error("setKioskUrlParams",r)}}