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.

moving the layout of the zoom slider

Postby brettshaw » Tue Mar 21, 2017 3:24 pm

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

Postby brettshaw » Tue Mar 21, 2017 3:25 pm

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

Re: moving the layout of the zoom slider

Postby AndreasJunghans » Tue Mar 21, 2017 10:12 pm

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
AndreasJunghans
 
Posts: 11
Joined: Tue May 13, 2014 3:28 pm

Re: moving the layout of the zoom slider

Postby brettshaw » Wed Mar 22, 2017 9:58 am

marvelous that worked thanks!
Brett Shaw
Software Developer - Route Optimiser Online
PTV GROUP - United Kingdom
User avatar
brettshaw
 
Posts: 7
Joined: Tue Mar 21, 2017 2:08 pm


Return to PTV Webclients (Ajax, Leaflet, OpenLayers, WMS, ...) (Admin=LNM)

cron