[Cartoweb-users] layer dependings

wochter wochter at seznam.cz
Tue Apr 3 04:30:42 EDT 2007

that's the problem...
As I wrote, I tried make layergroup with aggregate parameter, but it
runs incorrectly.

Activate/deactivate of 2 children layers works good until use:
mapInfo.initialMapStates.default.layers.swdemo_budovy.hidden = true
Then are children layers displayed in legend but not in map.

I use:
layers.budovy.className = LayerGroup
layers.budovy.label = Budovy
layers.budovy.children = swdemo_budovy, swdemo_budovy_doplnok
layers.budovy.aggregate = true

Names of children layers in legend comes from mapfile.map, I don't know why.
For example:
  NAME swdemo_budovy
    CONNECTION 'user=fero password=h dbname=gis host=localhost port=5432'
    DATA "the_geom from swdemo_budovy"
  #  NAME "Swdemo_budovy"
    COLOR 235 200 120
    OUTLINECOLOR 182 130 17

In legend is displayed name: "Swdemo_budovy"

I have to comment line "NAME" in CLASS bacause
mapInfo.initialMapStates.default.layers.swdemo_budovy.hidden = true
doesn't work properly when is not commented.

Why it takes the names of children layers from mapfile.map?
Is it correct?

I'm little bit confused...


Oliver Christen  wrote / napísal(a):
> Hi,
> maybe make a layergroup with the "aggregate" parameters, which allow to
> bind two layers together.
> and set the second layer as hidden.
> this way, when you activate/deactivate the parent groups, it should
> activate/deactivate both child layers?
> regards
> Oliver
>> Hi,
>> how to set depending of layer please?
>> There is layer "1" and layer "2".
>> Layer "2" is hidden in legend, but fully depend on layer "1"
>> I need to de/activate layer "2" when is de/activated layer "1".
>> Is it possible?
>> I try "LayerGroup" with hidden children in project.ini
>> mapInfo.initialMapStates.default.layers.myHiddenLayer.hidden = true
>> but this solution is not very happy.
>> It doesn't work properly.
>> Thanks
>> wochter
>> _______________________________________________
>> Cartoweb-users mailing list
>> Cartoweb-users at lists.maptools.org
>> http://lists.maptools.org/mailman/listinfo/cartoweb-users

More information about the Cartoweb-users mailing list