Compare
Swipe comparison shell for before/after or two map layers.
Preview
Usage
Use this component inside a qgis2web Leaflet export after loading q2w-mapcss.css. Keep generated map JavaScript unchanged unless your workflow needs custom behavior.
<div class="q2w-compare"> Compare content </div>
Variants
| Pattern | Effect |
|---|---|
.q2w-compare | Default component shell |
.q2w-compare--compact | Denser layout for small maps |
.q2w-compare--floating | Floating map overlay style |
data-theme="dark" | Uses dark theme tokens automatically |
Sub-elements
| Class | Purpose |
|---|---|
.q2w-compare | Root element for the compare component |
.q2w-compare__head | Optional header/title region |
.q2w-compare__body | Main component content region |
.q2w-compare__actions | Optional action group |