Skip to content

Commit ba125ba

Browse files
authored
fix: add missing styles for map scale bar control (#10414)
1 parent 77baac1 commit ba125ba

File tree

5 files changed

+21
-0
lines changed

5 files changed

+21
-0
lines changed

packages/map/src/styles/vaadin-map-base-styles.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,20 @@ export const mapStyles = css`
151151
}
152152
153153
.ol-scale-bar-inner {
154+
display: flex;
154155
border: 1px solid rgba(0, 0, 0, 0.5);
155156
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
156157
overflow: hidden;
157158
}
158159
160+
.ol-scale-singlebar-even {
161+
background: #000;
162+
}
163+
164+
.ol-scale-singlebar-odd {
165+
background: #fff;
166+
}
167+
159168
.ol-scale-step-marker {
160169
display: none;
161170
}

packages/map/test/visual/base/map.test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ describe('map', () => {
4242
element.configuration.getControls().push(new OverviewMap({ label: '', collapseLabel: '' }));
4343
await visualDiff(div, 'controls-all-controls');
4444
});
45+
46+
it('scale bar', async () => {
47+
// Add scale line using bar mode
48+
element.configuration.getControls().push(new ScaleLine({ bar: true, text: true }));
49+
await visualDiff(div, 'controls-scale-bar');
50+
});
4551
});
4652

4753
describe('theme', () => {
5.66 KB
Loading

packages/map/test/visual/lumo/map.test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ describe('map', () => {
4444
element.configuration.getControls().push(new OverviewMap({ label: '', collapseLabel: '' }));
4545
await visualDiff(div, 'controls-all-controls');
4646
});
47+
48+
it('scale bar', async () => {
49+
// Add scale line using bar mode
50+
element.configuration.getControls().push(new ScaleLine({ bar: true, text: true }));
51+
await visualDiff(div, 'controls-scale-bar');
52+
});
4753
});
4854

4955
describe('theme', () => {
5.84 KB
Loading

0 commit comments

Comments
 (0)