[mapserver-users] HTML legend

BERTRAND Joel joel.bertrand at systella.fr
Mon Sep 28 12:56:39 EDT 2009


	Hello,

	I have some troubles with HTML legend. I want to sort this legend and I 
don't understand why I cannot sort it.

	In my map file, I have written :

         WEB
                 IMAGEPATH "/var/www/maps/tmp/"
                 IMAGEURL "/maps/tmp/"
                 TEMPLATE "corps.html"
                 METADATA
                         LAYER_ORDER "100"
                 END
         END
...
         LEGEND
                 STATUS ON
                 TEMPLATE "legende.html"
         END
...
         LAYER
                 NAME "construction"

                 CONNECTIONTYPE POSTGIS
                 CONNECTION "host=localhost dbname=mapserver
                         user=xxx password=yyy"
                 PROCESSING "CLOSE_CONNECTION=DEFER"
                 DATA "the_geom from adminbndy5 using unique gid"
                 STATUS ON
                 TYPE POLYGON
                 MAXSCALEDENOM 250000
                 CLASS
                         NAME "Zone d'habitat dense"
                         COLOR 244 125 90
                 END
                 METADATA
                         LAYER_ORDER "3"
                 END
         END

and the same metadata entries for all layers. My legend template is :

[leg_layer_html order_metadata=layer_order opt_flag=0]
[metadata name=layer_order]
[/leg_layer_html]

[leg_class_html]
<img src=[leg_icon]><i><small>&nbsp;[leg_class_name]</small></i><br>
[/leg_class_html]

With this template, I can see that all values written in metadata fields 
in map file are sent to legend template, but legend's labels are not 
sorted. Where is my mistake ? I don't find any help in mapserver 
documentation.

	Thanks in advance,

	JKB


More information about the mapserver-users mailing list