Zoom to Booth
Select and zoom to a booth when the user clicks on it.
💡 See the JavaScript API Reference for all available methods
Code
html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
</head>
<body>
<div id="floorplan" style="width: 100%; height: 100dvh"></div>
<script type="module">
import { load } from 'https://unpkg.com/@expofp/floorplan';
load(
{ $ref: 'https://demo.expofp.com/manifest.json' },
{
element: document.querySelector('#floorplan'),
noOverlay: true,
onInit: (fp) => {
fp.setVisibility({
controls: false,
levels: false,
header: false,
overlay: false,
});
fp.zoomTo({ booths: [{ name: '1' }] });
},
},
);
</script>
</body>
</html>Related
Query parameters — set initial zoom level via URL JavaScript API Reference — full method documentation.