ol-ext icon indicating copy to clipboard operation
ol-ext copied to clipboard

Control Bar Position Top

Open thn80 opened this issue 2 years ago • 3 comments

Hi,

I'm trying to place my control bar to the very top (~0.5em). However, even if configuring "top: 0em;" there is a bigger distance between the control bar and the top of the map. For me it seems, that - maybe - the zoom controls (+/-) cause the control bar to be placed after them.

control_bar_top

Could someone give me a hint on how to place the control bar to the very top?

Thanks in advance

thn80 avatar Jul 03 '22 11:07 thn80

Just use CSS to style the control:

.ol-control.ol-bar.ol-top.ol-right {
    top: 0;
}

Viglino avatar Jul 04 '22 14:07 Viglino

This worked for me (at least for the browsers Firefox and Chrome on Windows). However, when accessing the page with Chrome on Android, the problem still seems to be there. Any ideas?

ol-ext_windows_firefox

ol-ext_android_chrome

thn80 avatar Jul 04 '22 18:07 thn80

On smartphone (touch devices) buttons are bigger and thus position must be define. Just add .ol-touch class to the css:

.ol-touch .ol-control.ol-bar.ol-top.ol-right,
.ol-control.ol-bar.ol-top.ol-right {
    top: 0;
}

Viglino avatar Jul 05 '22 06:07 Viglino