[ka-Map-users] layer controls - your opinion requested

Paul Spencer pspencer at dmsolutions.ca
Tue Aug 2 17:39:00 EDT 2005

hello ka-mapers!

I'm soliciting feedback on how the layer control (kaLegend) works.  It 
currently serves my purposes in most cases but it could stand some 

I am not going to build a completely flexible template-based legend ala 
mapserver legend templates, but I am open to suggestions on how to make 
the existing layer control more flexible - others can build different 
layers controls if they wish :>

Currently it works by assuming that everything with no group (or in the 
group named __base__) is part of a group labelled 'Base' in the 
interface.  This special group cannot be turned off as it.

Any other groups in the map file are loaded as separately controllable 
elements in the legend control, one checkbox per group.

For each group, you can expand it to show the mapserver legend for that 
group (based on the LEGEND object in the map file, not a legend template).

For each group, you can control the visibility and the opacity on the 
client side.  The visibility is handled via the checkbox.  There is no 
visible way to control opacity (any more) but it could be added by a 
third party if they wished - instead, you can control the opacity via 
the map file by adding metadata "opacity" "50" on the first layer in any 

(Are there other things we could control on a layer-by-layer basis?)

Its pretty obvious that the name 'Base' is not particularly suited to 
most applications ... Also, it may be desirable to have one or more 
'groups' of layers that cannot be turned on/off ... but perhaps have 
variable opacity etc.

I think one solution to this is to provide more metadata in the map file 
that can control the functionality of the legend.  What I am currently 
thinking of doing is removing the magic 'Base' group and instead 
allowing groups to have visibility controls or not via metadata:

visibility_control: true/false

This could optionally be expanded to include:

opacity_control: true/false

The default for both would be 'false' if not explicitly set to 'true' 
(i.e. missing or any other value than true)

Group/Layer order is currently not fully respected in that the special 
'Base' layer is kept at the bottom on the client side.  In making the 
above change, I would also remove this restriction so that the static 
layers could be placed anywhere in the map drawing order and have that 
respected on the client side.

For performance reasons, we turn off all unnecessary layers during 
dragging.  I would propose to change this to either:

1) turn off only layers that have visibility_control set to true

- OR -

2) provide another metadata to control which layers are left on when 
dragging (I'm open to suggestions on naming for this, plus defaults)

Finally, what should we do with layers that have no group set?  Perhaps 
they could still go into a special 'Base' group?  Or 'Ungrouped Layers'?

If there is any other functionality or any objection/changes to the 
stuff I've mentioned here, please post on the list to get your opinion 
heard :)



|Paul Spencer                           pspencer at dmsolutions.ca   |
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|

More information about the ka-Map-users mailing list