Embed reference

/embed.js defines window.MapMyVenue.SeatingChart. It has no dependencies and works on any page.

Options

OptionDescription
divIdId of the element to draw into. Give it a height (the snippet uses 600px); the map is at least 400px tall. The map renders in a shadow root, so your page's CSS can't break it.
publicKeyYour workspace public key (pk_...).
eventEvent key (ev_...).
scrollPageOptional boolean, default true. A plain mouse wheel and one-finger swipes scroll your page; Ctrl/⌘ + wheel or pinch zooms the map. Set false when the map fills the whole page.
holdTokenOptional. Your own per-buyer token (8–64 chars A-Z a-z 0-9 _ -); the API rejects other tokens with 400. By default the map makes one per event and keeps it for the browser tab.
onSelectionChange(seats)Seats this buyer holds: [{ id, label, rowLabel, categoryId, section, price }]. price and categoryId may be null. Called on load and on every change, including seats released by expiry.
onCheckout(seats)Optional. When set, the map shows a cart (held seats with price, remove, subtotal, hold countdown and a "Find me N seats" picker) and a Book button with the seat count and total that calls it with the held seats. Book them on your server with the secret key and chart.getHoldToken(), then return a message to show (e.g. 'Booked 2 seats.') or throw an Error to show its message. A second press while it runs is ignored, and the map refreshes when it finishes. Without it there is no cart and no Book button.
onHoldExpired()The buyer's hold ran out and their seats were released.
onError(err)Unexpected errors (network, server). A seat someone else just took is not an error; the map shows a notice.

Methods

render()Draws the map and connects for live updates. Returns a promise.
getHoldToken()Token that owns this buyer's holds. Send it to your server for booking.
getSelectedSeats()Seat ids currently held by this buyer.
clearSelection()Releases everything this buyer holds.
destroy()Removes the map and closes the live connection.

Behaviour

  • Clicking a free seat holds it; clicking it again releases it.
  • Holds survive a page reload in the same tab: the map restores the buyer's seats and countdown. (Not if you pass a holdToken that changes on reload, or the browser blocks session storage.)
  • After a network drop the map reconnects and re-syncs on its own.
chart.clearSelection();          // e.g. when the buyer empties their cart
const seats = chart.getSelectedSeats();