Skip to content

Bookmarks

The app allows users to save items as bookmarks.

💡 Adding bookmarks is disabled in kiosk mode.

Bookmarking feature in the app interface

Desktop

Desktop view 1Desktop view 2

Mobile

Mobile view 1Mobile view 2

Bookmark management in the JS SDK

💡 See the JavaScript API Reference for details.

Adding and removing bookmarks

js
import { load } from 'https://unpkg.com/@expofp/floorplan';
load(
  { $ref: 'https://demo.expofp.com/manifest.json' },
  {
    element: document.querySelector('#floorplan'),
    onInit: (fp) => {
      // Save to bookmarks
      fp.setBookmarks([{ name: "Alaska Airlines", bookmarked: true }]);
      fp.setBookmarks([{ externalId: "bizx", bookmarked: true }]);
      // Remove from bookmarks
      fp.setBookmarks([{ name: "Alaska Airlines", bookmarked: false }]);
      fp.setBookmarks([{ externalId: "bizx", bookmarked: false }]);
    },
  },
);

Handling bookmark additions

js
import { load } from 'https://unpkg.com/@expofp/floorplan';
load(
  { $ref: 'https://demo.expofp.com/manifest.json' },
  {
    element: document.querySelector('#floorplan'),
    onBookmarkClick: (e) => {
      // ...
    },
  },
);

Using the onInit function

js
import { load } from 'https://unpkg.com/@expofp/floorplan';
load(
  { $ref: 'https://demo.expofp.com/manifest.json' },
  {
    element: document.querySelector('#floorplan'),
    onInit: (fp) => {
      fp.setBookmarks([
        // ...
      ]);
    },
  },
);

Bookmarking via URL parameters

The following parameters are supported.