[mapserver-users] RE: html legend

Brian Barrett Brian at zetica.com
Tue Apr 12 03:20:41 PDT 2011


Does anybody have any suggestions for the problem outlined below? Is it a problem the order of the If statements?

Thanks

Brian


From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Brian Barrett
Sent: 06 April 2011 08:05
To: 'mapserver-users at lists.osgeo.org'
Subject: [mapserver-users] html legend

Hi,

I have a mapserver html legend that does not show all of my desired classes.

My map has some layers with a group name and some without. Most layers with a group name need just a single legend entry, so I've specified a [leg_group_html] section (as shown below) to identify those layers using the "isset" and "neq"  operators.

The layers with a group name "geophysics" or "interp" need a legend item for each layer (with a specific formatting) so I've specified a [leg_class_html] section and set these up there using the "eq" operator on the "layer_group"

My problem is with the remaining layers that have no group defined. These currently do not show in the legend, despite using the "isnull" option in the [leg_class_html] section.

Code is below. Can anyone help explain the problem please?



[leg_header_html]
[/leg_header_html]

[leg_group_html]
                [if name=group_name oper=isset]
                    [if name=group_name oper=neq value="geophysics"]
                                [if name=group_name oper=neq value="interp"]
                                [if name=layer_status oper=eq value=1]

                                                <table><tr>
                                                                <td width=15> </td>
                                                <td width=20>
                                                                <img src="[leg_icon width=20 height=15]" width=20 height=15 alt="">
                                                </td>
                                                <td>
                                                                [leg_group_name]
                                                </td>
                                                </tr></table>
                [/if][/if][/if][/if]
[/leg_group_html]


[leg_class_html]
                [if name=layer_group oper=isnull]
                                                <table><tr>
                                                                <td width=15> </td>
                                                <td width=20>
                                                                <img src="[leg_icon width=20 height=15]" width=20 height=15 alt="">
                                                </td>
                                                <td>
                                                                [leg_class_name]
                                                </td>
                                                </tr></table>
                [/if]
                [if name=layer_group oper=eq  value="geophysics"]
                                <table><tr>
                                                <td width=15> </td>
                                <td width=200>
                                                <img src="[leg_icon width=200 height=40]" width=200 height=40 alt="">
                                </td>
                                </tr></table>
                [/if]
                [if name=layer_group oper=eq  value="interp"]
                                <table><tr>
                                                <td width=15> </td>
                                <td width=300>
                                                <img src="[leg_icon width=300 height=400]" width=300 height=400 alt="">
                                </td>
                                </tr></table>
                [/if]
[/leg_class_html]



Brian

3D mapping and site investigation services for:
Pipeline and cable routes<http://www.zetica.com/productsandservices/pipelines.htm> | UXO<http://www.zetica.com/productsandservices/sitesafe.htm> | Utilities<http://www.zetica.com/productsandservices/utilities01.htm> | Rail<http://www.zeticarail.com/> | Foundation design<http://www.zetica.com/productsandservices/engineering.htm> | Flood defences<http://www.zetica.com/productsandservices/flood-defences.htm> | Surveying<http://www.zetica.com/productsandservices/topographic-land-and-measure-surveys.htm>
** Click here<http://www.zetica.com/news.htm> to see our latest newsletter **
Brian Barrett
Senior Geophysicist
brian at zetica.com<mailto:sBrian at zetica.com>
Tel: 44-(0)1993-886682
Mob: 44-(0)7973-549737
Fax: 44-(0)1993-886683
www.zetica.com<http://www.zetica.com/>
[cid:image001.gif at 01CBF903.A890EF80]
Zetica Ltd
Units 15 & 16
Hanborough Business Park
Long Hanborough
OX29 8LH, UK
Zetica Limited is registered in England No. 4079723
The information in this email is intended only for the addressee(s) named above. Access to this email by anyone else is unauthorised. If you are not the intended recipient of this message any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. Zetica Ltd and or its subsidiaries do not warrant that any attachments are free from viruses or other defects and accept no liability for any losses resulting from infected email transmissions. Please note that any views expressed in this email may be those of the originator and do not necessarily reflect those of this organisation.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20110412/9f78b36c/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 1392 bytes
Desc: image001.gif
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20110412/9f78b36c/attachment.gif>


More information about the MapServer-users mailing list