Skip to content

Commit 5b709f8

Browse files
committed
Add screen width-aware attribution.
1 parent 8bbccad commit 5b709f8

2 files changed

Lines changed: 55 additions & 1 deletion

File tree

site/src/assets/styles.css

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ body,
354354
/* Amenity filter panel */
355355
.amenity-filter {
356356
position: absolute;
357-
bottom: 8px;
357+
bottom: 28px;
358358
right: 8px;
359359
z-index: 100;
360360
background: #fff;
@@ -364,6 +364,52 @@ body,
364364
max-width: 220px;
365365
}
366366

367+
@media (max-width: 450px) {
368+
.amenity-filter { bottom: 50px; }
369+
}
370+
371+
/* Hide OL's default attribution control — we render our own (.map-attribution) */
372+
.map-container .ol-attribution {
373+
display: none;
374+
}
375+
376+
/* Map attribution */
377+
.map-attribution {
378+
position: absolute;
379+
bottom: 0;
380+
right: 0;
381+
z-index: 100;
382+
padding: 2px 6px;
383+
background: rgba(255, 255, 255, 0.85);
384+
border-radius: 3px 0 0 0;
385+
font-size: 11px;
386+
line-height: 1.4;
387+
color: #333;
388+
max-width: calc(100% - 8px);
389+
white-space: nowrap;
390+
}
391+
392+
.map-attribution a {
393+
color: #2563eb;
394+
text-decoration: none;
395+
}
396+
397+
.map-attribution a:hover {
398+
text-decoration: underline;
399+
}
400+
401+
@media (max-width: 600px) {
402+
.map-attribution {
403+
white-space: normal;
404+
text-align: right;
405+
max-width: calc(100% - 130px);
406+
}
407+
}
408+
409+
@media (max-width: 565px) {
410+
.map-attribution .attr-long { display: none; }
411+
}
412+
367413
.amenity-filter-header {
368414
padding: 8px 12px;
369415
font-weight: 600;

site/src/components/MapContainer.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@
4747
<div ref="popupEl">
4848
<PoiPopup :feature="selectedFeature" @close="closePopup" />
4949
</div>
50+
51+
<div class="map-attribution">
52+
&copy;
53+
<a href="https://www.openstreetmap.org/copyright" target="_blank" rel="noopener noreferrer">OpenStreetMap<span class="attr-long"> contributors</span></a>,
54+
<a href="https://www.openmaptiles.org/" target="_blank" rel="noopener noreferrer">OpenMapTiles</a>,
55+
<a href="https://overturemaps.org/" target="_blank" rel="noopener noreferrer">Overture Maps<span class="attr-long"> Foundation</span></a>,
56+
<a href="https://openpois.org/about.html" target="_blank" rel="noopener noreferrer">OpenPOIs</a>
57+
</div>
5058
</div>
5159
</template>
5260

0 commit comments

Comments
 (0)