moving the layout of the zoom slider

This forum deals with any kind of web based client technology, whether it is the well known java script based Ajax servlet or the upcoming approaches such as Leaflet, OpenLayers and so on.
Post Reply
User avatar
brettshaw
Posts: 7
Joined: Tue Mar 21, 2017 2:08 pm

moving the layout of the zoom slider

Post 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
Brett Shaw
Software Developer - Route Optimiser Online
PTV GROUP - United Kingdom
User avatar
brettshaw
Posts: 7
Joined: Tue Mar 21, 2017 2:08 pm

Re: moving the layout of the zoom slider

Post by brettshaw »

forgot to mention i have tried setting the areaWidth and it made no difference
Brett Shaw
Software Developer - Route Optimiser Online
PTV GROUP - United Kingdom
AndreasJunghans
Posts: 13
Joined: Tue May 13, 2014 3:28 pm

Re: moving the layout of the zoom slider

Post 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
User avatar
brettshaw
Posts: 7
Joined: Tue Mar 21, 2017 2:08 pm

Re: moving the layout of the zoom slider

Post by brettshaw »

marvelous that worked thanks!
Brett Shaw
Software Developer - Route Optimiser Online
PTV GROUP - United Kingdom
Post Reply