[Cartoweb-users] multiple scale dependent layers - one legendentry

karsten vennemann karsten at terragis.net
Wed Nov 21 15:08:58 EST 2007


Thanks. Now can hide and select any layers and groups I'd like:
mapInfo.initialMapStates.default.layers.rivers.selected = true
mapInfo.initialMapStates.default.layers.rivers.hidden = true
Sorry that I couldn't find this earler in the documentation. Very powerful.
Many cheers and thanks to the cartoweb developers.
Karsten

  _____  

From: Oliver Christen [mailto:oliver.christen at camptocamp.com] 
Sent: Wednesday, November 21, 2007 05:48
To: karsten vennemann; cartoweb-users at lists.maptools.org
Subject: Re: [Cartoweb-users] multiple scale dependent layers - one
legendentry

 

Hi

 

to activate a layer (or layerGroup) at startup, you need to use the
initialMapStates parameters.

see
http://www.cartoweb.org/doc/cw3.4/xhtml/user.config.html#user.config.server.
maps_config.initial

more specificaly:

 

mapInfo.initialMapStates.default.layers.*layer_id*.selected = true

this works the same for layer and layerGroup

write these in file
cartoweb3/projects/*yourproject*/server_conf/*yourproject*/*yourproject*.ini

 

regards

Oliver

----- Original Message ----- 

From: karsten <mailto:karsten at terragis.net>  vennemann 

To: cartoweb-users at lists.maptools.org 

Sent: Wednesday, November 21, 2007 2:01 PM

Subject: RE: [Cartoweb-users] multiple scale dependent layers - one
legendentry

 

Thanks for the tip. Yes the rivers LayerGroup was at the top level. I added
a container layer as suggested

 

layers.riversContainer.className = LayerGroup

layers.riversContainer.children =  rivers 

 

;LayerGroup rivers 

layers.rivers.className = LayerGroup

layers.rivers.children =  rivers_and_streams500k, rivers_and_streams50k,
rivers_and_streams50k_2, rivers_and_streams20k, rivers_and_streams1k

layers.rivers.label = Rivers

layers.rivers.icon = blank.png

layers.rivers.aggregate = true

 

If the aggregated LayerGroup rivers is the only layer in the Container
LayerGroup the checkbox did not get rendered when

layers.rivers.icon = blank.png

is set. When I uncomment the icon it does get rendered :-). I'm not sure
whether that is intended behaviour.

It does however always get rendered when I add more layers to the Container
LayerGroup. 

 

In my mapfile all the rivers layers are now set to

STATUS ON

The LayerGroup rivers shows up invisible /with a unchecked checkbox in the
legend, whereas another layer "counties" in my mapfile shows up visible (see
below).

How can I set the LayerGroup to be visible at the initial loading ?

 

Karsten

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/cartoweb-users/attachments/20071121/3c173fe1/attachment.html


More information about the Cartoweb-users mailing list