Hi Steven, When the layers are not set as hidden cgi variables and I zoom into scale, the new legend items first appear off rather than on, and don't display on the map. However, when switched on they do maintain their status when the submit button is clicked. The legend is definitely inside the form as well. Thanks for your perserverance! Jo ------------------------------------------- Joanne Cook BSc MLitt AIFA Information Systems Coordinator Oxford Archaeology North -------------------------------------------
________________________________ From: Steven Monai [mailto:[EMAIL PROTECTED] Sent: Wed 14/12/2005 15:56 To: joanne cook Cc: [email protected] Subject: RE: Help! html legend problems Joanne: Try removing the layers from your hidden cgi variables. There should be no need for them anyway, since you're using the HTML legend to control the layers' on/off status. Also, be certain that the legend is rendered inside your <form>, so that the checkboxes contribute their values to the web-page submission. -SM -- -----Original Message----- From: joanne cook [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 14, 2005 3:47 AM To: Steven Monai Cc: [email protected] Subject: RE: Help! html legend problems 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:[EMAIL PROTECTED] Sent: Tue 13/12/2005 16:43 To: [email protected]; 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 <[EMAIL PROTECTED]> 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
