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
| Name | Purpose |
|---|---|
.split + data-split | The wrapper. Two columns on desktop, full height under the header. The attribute holds list or map and decides what phones show. |
.split-list | Left half. Scrolls on its own. |
.split-toolbar | Filter row pinned to the top of the list. |
.split-body, .split-head | Padding for the cards, and the title row with the sort menu. |
.split-map + .map-view--split | Right half. The map fills it. |
.split-switch + data-split-show | Floating List / Map buttons. Shown on phones only. |
data-map-id | On a card column. Hovering the card highlights the pin with the same id in the map data. |
--split-top | Header height. Set automatically by site.js. |