Migration Guide
Move from SDK v2 (global ExpoFP script, new ExpoFP.FloorPlan) to SDK v3 (ESM load() from @expofp/floorplan). Every option you used in v2 — event callbacks (onBoothClick, onInit, …), behavior flags (noOverlay, offHistory, …), and the container — still goes into the options bag; only eventId + dataUrl are replaced by the manifest $ref. See FloorPlanOptions for the full list.
Before
html
<div id="floorplan" style="width: 100%; height: 100dvh;"></div>
<script src="https://demo.expofp.com/packages/main/expofp.js" crossorigin="anonymous"></script>
<script>
const fp = new ExpoFP.FloorPlan({
element: document.querySelector('#floorplan'),
eventId: 'demo',
dataUrl: 'https://demo.expofp.com/data/',
noOverlay: true,
onBoothClick: (e) => console.log('booth:', e.target.name),
onInit: (fp) => {
/* ... */
},
});
</script>After
html
<div id="floorplan" style="width: 100%; height: 100dvh;"></div>
<script type="module">
import { load } from 'https://unpkg.com/@expofp/floorplan';
const fp = await load(
{ $ref: 'https://demo.expofp.com/manifest.json' },
{
element: document.querySelector('#floorplan'),
noOverlay: true,
onBoothClick: (e) => console.log('booth:', e.target.name),
onInit: (fp) => {
/* ... */
},
},
);
</script>Replace demo with your event subdomain.