Zoom to Booth
Select and zoom to a booth when the user clicks on it.
TIP
See the JavaScript API Reference for all available methods.
Code
js
new ExpoFP.FloorPlan({
element: document.querySelector("#floorplan"),
eventId: "demo",
dataUrl: "https://demo.expofp.com/data/",
noOverlay: true,
onInit: (fp) => {
// Expose
window.___fp = fp;
// Hide all UI elements
fp.setVisibility({
"controls": false,
"levels": false,
"header": false,
"overlay": false
});
// Zoom to booth with name '1'
fp.zoomTo({ booths:[ { name: '1' } ]})
},
});Live Demo
Related
Query parameters - set initial zoom level via URL
JavaScript API Reference - full method documentation