Secrets

Advanced integration features using the SMAPS script.

If you're reading this, we feel you can enjoy trying these out. Fair warning: if you reach out to our support chat, they will likely have no idea what you're talking about. You're on your own here.

These are advanced integration features built on top of the Maps iframe using our SMAPS script. They add display modes, button triggers, multi-instance deployments, and more. The iframe approach from the main docs is the recommended path - this is for people who want more control.

The SMAPS script

Instead of building the iframe yourself, you can let the SMAPS script handle it:

<script>
  window.Stay22 = {
    mapParams: {
      aid: '<AID>',
      address: 'Bell Centre, Montreal'
    },
    displaySettings: {
      display: 'onload_div',
      a22mapQS: '#hotel-map'
    }
  };
</script>
<script src="https://scripts.stay22.com/smaps.js" async></script>

<div id="hotel-map"></div>

The script reads your config and generates an iframe automatically.

Display modes

The script supports four display modes via displaySettings.display:

onload_div - Inline embed

Map renders directly into the page when it loads.

displaySettings: {
  display: 'onload_div',
  a22mapQS: '#hotel-map'
}

onload_popmodal - Modal on page load

Map opens as a modal overlay when the page loads. Use sparingly.

displaySettings: {
  display: 'onload_popmodal'
}

onclick_slidedown - Button + slide reveal

A button appears; clicking it slides the map down.

displaySettings: {
  display: 'onclick_slidedown',
  a22mapQS: '#hotel-map',
  btnText: 'View Hotels Nearby',
  mainColor: '0069ed'
}

onclick_popmodal - Button + modal

A button appears; clicking it opens the map in a modal.

displaySettings: {
  display: 'onclick_popmodal',
  a22mapQS: '#hotel-map',
  btnText: 'Find Accommodation',
  mainColor: '0069ed'
}

Choosing a mode

ModeUse when...
onload_divThe map is a core part of the page
onload_popmodalYou want immediate visibility but the map isn't inline
onclick_slidedownThe map is secondary - let users opt in
onclick_popmodalSame as slidedown, but you prefer a modal

Configuration reference

mapParams

ParameterTypeRequiredDefaultDescription
aidstringYesYour Stay22 affiliate ID.
addressstringNoDestination address or place name. Can also be a CSS selector (e.g., #venue-name) - the script will read the text content of that element.
latnumberNoLatitude. Takes priority over address.
lngnumberNoLongitude.
checkinstringNoCheck-in date in YYYY-MM-DD format.
checkoutstringNoCheck-out date in YYYY-MM-DD format.
eventstartstringNoEvent start date in YYYY-MM-DD format.
eventendstringNoEvent end date in YYYY-MM-DD format.
adultsnumberNoNumber of adult guests.
venuestringNoVenue name. Displayed on the map.
campaignstringNoCampaign ID. Auto-generated from page title + address if not set.
markerimagestringNoCustom marker icon URL.
navimagestringNoCustom navigation icon URL.

displaySettings

ParameterTypeRequiredDefaultDescription
displaystringYesDisplay mode: onload_div, onload_popmodal, onclick_slidedown, onclick_popmodal.
a22mapQSstringNo.a22mapCSS selector for the container element.
btnTextstringNoView HotelsButton text for onclick_* modes.
btnClassstringNoCustom CSS class for the button.
mapClassstringNoCustom CSS class for the map container.
presentationTextstringNoText displayed above the map.
mainColorstringNo0069edPrimary color. Hex without #.
marginobjectNoMap container margins: { top, bottom, left, right }.
parentBlockstringNoCSS selector for multi-instance mode. Each matched element gets its own map.
autoDropFirstbooleanNofalseAuto-open the first slide on load (onclick_slidedown only).

Insertion points

Instead of a22mapQS, you can use explicit insertion positions:

ParameterTypeRequiredDefaultDescription
insert_beforebeginstringNoCSS selector. Map inserted before this element.
insert_afterbeginstringNoCSS selector. Map inserted at the start of this element.
insert_beforeendstringNoCSS selector. Map inserted at the end of this element.
insert_afterendstringNoCSS selector. Map inserted after this element.

Multi-instance with parentBlock

The key feature for deploying maps at scale. It tells the script: "find every element matching this selector, and create a map for each one."

<div class="event-card">
  <h3>Concert at Bell Centre</h3>
  <div class="map-slot"></div>
</div>

<div class="event-card">
  <h3>Festival at Place des Arts</h3>
  <div class="map-slot"></div>
</div>
window.Stay22 = {
  mapParams: {
    aid: '<AID>',
    address: 'h3'
  },
  displaySettings: {
    display: 'onclick_slidedown',
    parentBlock: '.event-card',
    a22mapQS: '.map-slot',
    btnText: 'View Hotels'
  }
};

The script finds every .event-card, reads the <h3> text as the address, and creates a map in each .map-slot.

URL-specific overrides

Both mapParams and displaySettings support urlSpecs for per-page overrides:

mapParams: {
  aid: '<AID>',
  address: 'Default City',
  urlSpecs: {
    'example.com/festivals': {
      address: 'Parc Jean-Drapeau, Montreal'
    }
  }
}

Styling

mainColor

Sets the primary color for buttons and UI accents. Hex value without the # prefix:

mainColor: 'ff5a5f'   // Airbnb-ish red
mainColor: '0069ed'   // Stay22 blue (default)

Custom CSS classes

displaySettings: {
  btnClass: 'btn btn-primary btn-lg',
  mapClass: 'my-map-container'
}

Map dimensions

Default: width 100%, max height 380px. Override with CSS:

.s22-responsive-wrap {
  max-height: 500px;
}

.s22-responsive-wrap iframe {
  height: 500px;
}

If the modal appears behind sticky headers:

.s22-frametoggle {
  z-index: 10000;
}

Schema.org JSON-LD auto-detection

The script auto-detects event details from application/ld+json markup:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Event",
  "name": "Summer Concert",
  "startDate": "2026-08-15",
  "location": {
    "@type": "Place",
    "name": "Bell Centre",
    "geo": {
      "@type": "GeoCoordinates",
      "latitude": 45.4960,
      "longitude": -73.5693
    }
  }
}
</script>

If JSON-LD data is present and no address/lat/lng is set, the script uses it automatically.

Need help?

Actually, remember what we said at the top? You're on your own here. But if you're truly stuck, try slava@stay22.com - he might know what you're talking about.

On this page