Help! html legend problems

Steven Monai stevem at SPATIALMAPPING.COM
Tue Dec 13 11:43:35 EST 2005


Joanne:

Change the name of your checkbox from "layer_status" to simply "layer".
That should allow the MapServer CGI recognize it. Also, if it is your
intention to embed the legend within a map tempate (via: <table>[legend]
</table>, for example), then you ought to remove the <html><head>... tags,
as they will only serve to confuse the browser.

Did you resolve your layer on/off problem by changing your layers' status
from ON to DEFAULT? If so, change them back to ON (or OFF), otherwise the
checkboxes in your legend will be ignored.

HTH,
-SM
--

On Mon, 12 Dec 2005 09:37:39 -0000, joanne cook <j.cook at OXFORDARCH.CO.UK>
wrote:

>Hi Everyone,
>
>I have got myself into a terrible mess with html legends and would
appreciate some assistance, as nothing I do seems to work. I am trying to
implement a legend with check boxes for layer control, that only displays
layers that are in scale on the map. So far so good. My legend template is
shown below:
>
>[leg_layer_html Opt_Flag=14]
><html>
><head>
><title></title>
></head>
><body>
><tr bgcolor="#FFFFFF">
>  <td align="center">
>    <input type="checkbox" name="layer_status" value="[leg_layer_name]"
[if name=layer_status oper=neq value=0]CHECKED[/if]>
>  </td>
>  <td><img src="[leg_icon height=15 width=15]" height=15 width=15></td>
>  <td><font face="Arial, Helvetica, sans-serif" size="2">[if
name=layer_name oper=neq value=][leg_layer_name][/if][if name=layer_name
value=]* Name Not Set*[/if]</font></td>
></tr>
></body>
></html>
>[/leg_layer_html]
>
>My first problem was that when I zoomed in on the map to a scale at which
new layers became visible, they appeared switched off in the legend. All
the layers in my map file have status ON. I resolved that, or so I thought,
but now when I try and switch layers off in the legend, and refresh my map
(with a form submit button) they just stay switched on. Also, I don't
really understand the relationship between having layers declared as cgi
variables in my web page and the behaviour of the legend.
>
>I have searched the documentation on this, and I'm sure it must be
something very simple that I am missing, so I would really appreciate it if
someone could help me out.
>
>Many thanks
>
>Jo
>
>-------------------------------------------
>Joanne Cook BSc MLitt AIFA
>Information Systems Coordinator
>Oxford Archaeology North
>-------------------------------------------
>
>
>This message has been scanned for viruses by BlackSpider MailControl -
www.blackspider.com



More information about the mapserver-users mailing list