[fusion-users] Groups are shown in the legend as (inactive) layers

Bernhard Schneider bernhard.schneider at ilu.ch
Mon Jun 9 03:12:48 EDT 2008


Hi everyone,

All map groups that I specify in my map file (I'm using MapServer  
5.something) are correctly shown in the legend. However, each of them  
appears a second time in the legend as regular map layer that is  
always greyed out.

After some digging in the code, I found that the function  
parseMapLayersAndGroups() of Fusion.Maps.MapServer may not correctly  
deal with the layer and group information passed to it. It is  
receiving a list of all layers that includes all groups. (It makes  
sense to include the groups in this list because a group may indeed be  
a layer as well, that is, it may have its own map layer information to  
be drawn on the map.) Additionally, all groups are given as a separate  
list. The function now builds the map layer tree by going through the  
group list first. Then, it loops through the layer list adding the  
layers to the groups where necessary. However, all groups are added a  
second time in this process, this time as regular map layers.

For testing, I added some code to the loop through the map layers.  
There, I check whether a layer corresponds to a group (by comparing  
layer and group names). If there is a match, I ignore the layer. I'm  
not sure whether this hack allows for groups having their own map  
data, but in my case this is not the case anyway.

Did I find a bug, or am I making things worse?

I'm not sure whether this post should go to the Fusion-Dev mailing list.

Bernhard


More information about the fusion-users mailing list