feat: add device compass map orientation

This commit is contained in:
2026-07-22 10:32:29 +01:00
parent ff8d55f1c0
commit f4e55349ca
2 changed files with 237 additions and 1 deletions
+45
View File
@@ -492,6 +492,46 @@ button:disabled {
background: rgba(31, 122, 98, 0.16);
}
.map-wrap .ol-device-compass {
top: 184px;
right: 16px;
left: auto;
overflow: hidden;
background: var(--panel);
border: 1px solid var(--panel-border);
border-radius: 14px;
backdrop-filter: blur(16px);
box-shadow: var(--shadow);
}
.map-wrap .ol-device-compass button {
display: grid;
width: 2.0625em;
height: 2.0625em;
margin: 0;
padding: 0;
place-items: center;
background: linear-gradient(135deg, var(--accent) 0%, #2b9a79 100%);
color: #fffefb;
font-size: 1.3rem;
line-height: 1;
}
.map-wrap .ol-device-compass button:hover,
.map-wrap .ol-device-compass button:focus,
.map-wrap .ol-device-compass button[aria-pressed="true"] {
background: linear-gradient(135deg, var(--accent-strong) 0%, var(--accent) 100%);
color: #fff;
outline: 2px solid rgba(31, 122, 98, 0.35);
outline-offset: -2px;
}
.device-compass-icon {
display: block;
width: 1.2em;
height: 1.2em;
}
/* OpenLayers hides this control while the view is north-up. */
.map-wrap .ol-rotate {
top: auto;
@@ -552,6 +592,11 @@ button:disabled {
right: 12px;
}
.map-wrap .ol-device-compass {
top: 180px;
right: 12px;
}
.map-wrap .ol-rotate {
right: 12px;
bottom: 12px;