Skip to content

Zoom (selectBooth)

Select a booth programmatically right after load—the same as if the user tapped it. In onInit, call fp.selectBooth('1') (by booth name or externalId). That updates selection / details state and moves the viewer to the booth.

For camera-only framing (pan/zoom without that selection behaviour), use zoomTo — see Zoom To and Zoom to Booth.

TIP

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,
          allowConsent: false,
          onInit: (fp) => {
            fp.setVisibility({
              controls: false,
              levels: false,
              header: false,
              overlay: false,
            });
            fp.selectBooth('1');
          },
        },
      );
    </script>
  </body>
</html>

Open live example