Map and motion

Split view

A property list and a full-height map side by side. On screens 992px and wider each takes half of the space under the header, and the list scrolls on its own. On phones one pane shows at a time, with a List / Map switch. See it on listing-map.html.

Structure

<main class="split" data-split="list">
  <section class="split-list scroll-fancy">
    <form class="split-toolbar">...filters...</form>
    <div class="split-body">
      <div class="split-head">...title and sort...</div>
      <div class="row g-3">
        <div class="col-sm-6" data-map-id="1">...property card...</div>
      </div>
    </div>
  </section>
  <section class="split-map">
    <div class="map-view map-view--split" data-property-map="#map-data" data-map-key="API_KEY"></div>
  </section>
  <div class="split-switch">
    <button type="button" data-split-show="list" aria-pressed="true">List</button>
    <button type="button" data-split-show="map" aria-pressed="false">Map</button>
  </div>
</main>

Leave the footer out of this page. The page does not scroll on desktop, so a footer would never be reached. Load assets/js/map-view.min.js and put the property data in a script type="application/json" block, the same as the other map pages.

Classes and attributes

NamePurpose
.split + data-splitThe wrapper. Two columns on desktop, full height under the header. The attribute holds list or map and decides what phones show.
.split-listLeft half. Scrolls on its own.
.split-toolbarFilter row pinned to the top of the list.
.split-body, .split-headPadding for the cards, and the title row with the sort menu.
.split-map + .map-view--splitRight half. The map fills it.
.split-switch + data-split-showFloating List / Map buttons. Shown on phones only.
data-map-idOn a card column. Hovering the card highlights the pin with the same id in the map data.
--split-topHeader height. Set automatically by site.js.