Page 1 of 1

moving the layout of the zoom slider

Posted: Tue Mar 21, 2017 3:24 pm
by brettshaw
I am currently trying to move the 'zoomslider' layer from its default on the right to the left hand side.

i.e.

Code: Select all

var zoomLay = map.getLayer("zoomslider");
zoomLay.setAreaLeft(20);
zoomLay.setAreaTop(20);
The problem i get that its generated parent 'div' doesn't compensate for the changes and the 'ComputedAreaWidth' remains the same as the screen area, in this scenario its 1893px, so it fills the screen from right to left.

is this a bug or am i missing some configuration etc

cheer

Re: moving the layout of the zoom slider

Posted: Tue Mar 21, 2017 3:25 pm
by brettshaw
forgot to mention i have tried setting the areaWidth and it made no difference

Re: moving the layout of the zoom slider

Posted: Tue Mar 21, 2017 10:12 pm
by AndreasJunghans
Hi there,

you need to reset the right edge. Otherwise, the default value is retained, and the layer is anchored both on the left and the right edge (and therefore taking up most of the available space). Just add the following to remove the right anchor:

Code: Select all

zoomLay.setAreaRight(null);
Regards,

Andreas

Re: moving the layout of the zoom slider

Posted: Wed Mar 22, 2017 9:58 am
by brettshaw
marvelous that worked thanks!