Make it smaller

This commit is contained in:
jcardus 2024-11-04 19:19:37 +00:00
parent 693573ead2
commit 766e4cab49
3 changed files with 6 additions and 10 deletions

View File

@ -68,7 +68,7 @@ const MapRoutePoints = ({ positions, onClick }) => {
const minSpeed = positions.map((p) => p.speed).reduce((a, b) => Math.min(a, b), Infinity);
const control = new LegendControl(positions, speedUnit, t);
map.addControl(control, 'bottom-right');
map.addControl(control, 'bottom-left');
map.getSource(id)?.setData({
type: 'FeatureCollection',

View File

@ -15,7 +15,7 @@ export class LegendControl {
this.map = map;
// Create the control container
this.controlContainer = document.createElement('div');
this.controlContainer.className = 'maplibregl-ctrl-group maplibregl-ctrl';
this.controlContainer.className = 'maplibregl-ctrl';
if (this.positions.length && this.maxSpeed) {
this.controlContainer.appendChild(this.createSpeedLegend(this.minSpeed, this.maxSpeed, this.t));
@ -39,7 +39,6 @@ export class LegendControl {
}).join(', ');
const legend = document.createElement('div');
legend.classList.add('legend');
const colorBar = document.createElement('div');
colorBar.classList.add('legend-color-bar');

View File

@ -1,9 +1,5 @@
.legend {
padding: 10px;
}
.legend-color-bar {
height: 20px;
height: 10px;
}
.legend-speed-labels {
@ -11,13 +7,14 @@
}
.legend-speed-label {
/* this makes the middle label position exactly in the middle */
min-width: 70px;
color: black;
background: rgba(255, 255, 255, 0.8);
padding: 0 2px;
}
.legend-speed-label:nth-child(2) {
text-align: center;
padding: 0 30px;
}
.legend-speed-label:nth-child(3) {