Help! html legend problems
joanne cook
j.cook at OXFORDARCH.CO.UK
Wed Dec 14 03:46:49 PST 2005
Hi Steven,
Thanks for the response. I have removed the html head and foot tabs- they were important at one point but not anymore. I also changed the name of the checkbox to layer, as you suggested. The layers are all on in the map file, and defined as hidden cgi variables in my web page. Now, when I zoom into scale, the new layers appear switched on, which is good, but if I uncheck the check boxes and click the submit button they stay switched on, whereas I want them to turn off...
All the best
Jo
-------------------------------------------
Joanne Cook BSc MLitt AIFA
Information Systems Coordinator
Oxford Archaeology North
-------------------------------------------
________________________________
From: Steven Monai [mailto:stevem at SPATIALMAPPING.COM]
Sent: Tue 13/12/2005 16:43
To: MAPSERVER-USERS at LISTS.UMN.EDU; joanne cook
Subject: Re: Help! html legend problems
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