<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1498" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Ken-ichi,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>You must have a customised legend template, to
prevent the labelled layer from showing up. Because as long as one of the layers
with that name shows up, both will be visible in the map.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I noticed you have a metadata-entry called
"legendvis". I'd rather call it "LEGENDHIDE" (because "hiding" will be the
exception). Now in your legendtemplate, you must have something
like:</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>[if name=LEGENDHIDE oper=isnull] </FONT></DIV>
<DIV><FONT size=2><TR></FONT></DIV>
<DIV><FONT size=2>.............</FONT></DIV>
<DIV><FONT size=2></TR></FONT></DIV>
<DIV><FONT size=2>[/if]</FONT></DIV>
<DIV><FONT size=2><FONT face=Arial></FONT> </DIV></FONT>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>This would make the item show in the legend, as
long as the "LEGENDHIDE" entry doesn't exist in the metadata of that
layer.</FONT></DIV>
<DIV><FONT face=Arial size=2>Let me know if you have any trouble.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>regards,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Jacob</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>-----Original Message-----<BR>From: Ken-ichi Ueda
[mailto:kenichi.ueda@gmail.com] <BR>Sent: 8 June 2005 01:26<BR>To: Jacob
Delfos<BR>Cc: <A
href="mailto:chameleon@lists.maptools.org">chameleon@lists.maptools.org</A><BR>Subject:
Re: [Chameleon] ungrouped layers and legendtemplate</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Hm, now that I look a little closer, I realize that
when you have two<BR>layers with the same name, they turn on together but they
don't seem<BR>to turn off together. Have you ever experienced this?
Here's what my<BR>mapfile looks like:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>LAYER<BR>
NAME "Highways"<BR> GROUP
"Default"<BR> DATA
"/path/to/highways"<BR> STATUS
ON<BR> TYPE
LINE<BR> CLASSITEM
"TYPE"<BR>
PROJECTION<BR>
"init=epsg:1000"<BR>
END<BR>
CLASS<BR> NAME
"Interstate"<BR>
EXPRESSION
"INTER"<BR>
STYLE<BR>
SYMBOL
"circle"<BR>
SIZE
2<BR>
COLOR 255 51
51<BR>
END<BR>
END<BR>
CLASS<BR> NAME
"US
Highway"<BR>
EXPRESSION
'US-HWY'<BR>
STYLE<BR>
SYMBOL
"circle"<BR>
COLOR 102 102
102<BR>
SIZE 1<BR>
END<BR>
END<BR>
CLASS<BR> NAME
"State
Highway"<BR>
EXPRESSION
'ST-HWY'<BR>
MAXSCALE
1500000<BR>
STYLE<BR>
SYMBOL
"circle"<BR>
COLOR 153 153
153<BR>
SIZE 1<BR>
END<BR> END<BR>
END</FONT></DIV>
<DIV> </DIV><FONT face=Arial size=2>
<DIV><BR> LAYER<BR>
NAME "Highways"<BR> GROUP
"hidden"<BR>
METADATA<BR>
"legendvis" "hidden"<BR>
END<BR> DATA
"/path/to/highways"<BR> STATUS
OFF<BR> TYPE
ANNOTATION<BR> LABELCACHE
ON<BR> CLASSITEM
"TYPE"<BR> LABELITEM
"ROUTE1"<BR>
PROJECTION<BR>
"init=epsg:1000"<BR>
END<BR>
CLASS<BR> NAME
"Interstate"<BR>
KEYIMAGE
"/path/to/interstate.png"<BR>
EXPRESSION
"INTER"<BR>
STYLE<BR>
SYMBOL
"/path/to/interstate.png"<BR>
COLOR 0 0
0<BR>
END<BR>
LABEL<BR>
COLOR 255 255
255<BR>
SIZE
TINY<BR>
MINFEATURESIZE
75<BR>
MINDISTANCE
250<BR>
POSITION
cc<BR>
END<BR>
END<BR>
CLASS<BR> NAME
"State
Highway"<BR>
KEYIMAGE
"/path/to/statehwy.png"<BR>
EXPRESSION
'ST-HWY'<BR>
MAXSCALE
1500000<BR>
STYLE<BR>
SYMBOL
"/path/to/statehwy.png"<BR>
COLOR 0 0
0<BR>
END<BR>
LABEL<BR>
COLOR 0 0
0<BR>
SIZE
TINY<BR>
MINFEATURESIZE
75<BR>
MINDISTANCE
250<BR>
POSITION
cc<BR>
END<BR>
END<BR>
CLASS<BR> NAME
"US
Highway"<BR>
KEYIMAGE
"/path/to/ushwy.png"<BR>
EXPRESSION
'US-HWY'<BR>
STYLE<BR>
SYMBOL
"/path/to/ushwy.png"<BR>
COLOR 0 0
0<BR>
END<BR>
LABEL<BR>
COLOR 0 0
0<BR>
SIZE
TINY<BR>
MINFEATURESIZE
75<BR>
MINDISTANCE
250<BR>
POSITION
cc<BR>
END<BR> END<BR>
END</DIV>
<DIV> </DIV>
<DIV>Ideally I don't want the labelling layer to be visible in the
legend,<BR>but I do want it to turn on and off with the data layer.
Any<BR>thoughts?</DIV>
<DIV> </DIV>
<DIV>-Ken-ichi</DIV>
<DIV> </DIV>
<DIV>On 6/1/05, Jacob Delfos <<A
href="mailto:jacob.delfos@maunsell.com">jacob.delfos@maunsell.com</A>>
wrote:<BR>> <BR>> Ken-Ichi, <BR>> <BR>> You can
adjust your legend template to look for a metadata-value that you<BR>> made
up, and then it can use boolean logic to determine whether or not to<BR>>
show the layer in the legend. Have a look at<BR>> <A
href="http://lists.maptools.org/pipermail/chameleon/2004-October/001526.html">http://lists.maptools.org/pipermail/chameleon/2004-October/001526.html</A><BR>>
<BR>> In short: if a layer has the same name as another layer, they will turn
on<BR>> and off at the same time, even if only one layer shows in the legend.
That<BR>> way you can emulate groups, while also having control of individual
layers.<BR>> In your case, I would add a layer to your mapfile, with "STATUS
DEFAULT",<BR>> and then use a metadata entry to prevent it from showing in
the legend. <BR>> <BR>> regards, <BR>> <BR>>
Jacob <BR>> <BR>> <BR>> -----Original
Message-----<BR>> From: <A
href="mailto:chameleon-bounces@lists.maptools.org">chameleon-bounces@lists.maptools.org</A><BR>>
[mailto:chameleon-bounces@lists.maptools.org] On Behalf Of<BR>>
Ken-ichi<BR>> Sent: 2 June 2005 06:03<BR>> To: <A
href="mailto:chameleon@lists.maptools.org">chameleon@lists.maptools.org</A><BR>>
Subject: [Chameleon] ungrouped layers and legendtemplate <BR>>
<BR>> Hi all. I feel like this is a problem I have solved in the past
but I <BR>> just can't seem to figure it out: my layers in a map file are
organized <BR>> into GROUPs, and I have an HTML legend template that works
fine with the <BR>> LegendTemplate widget. However, when I have a layer
that isn't a part <BR>> of a group, it disappears whenever the map is updated
(update, zoom, <BR>> pan, whatever). I was hoping to use ungrouping
layers as a way of <BR>> hiding them from the legend while still displaying
them on the map. Is <BR>> Chameleon actually looking to some list of
layers generated by <BR>> LegendTemplate when it draws an updated map?
Is there a better way to <BR>> effectively "hide" some layers from the legend
in Chameleon? <BR>> <BR>> Thanks in advance.
<BR>> <BR>> -Ken-ichi<BR>>
_______________________________________________<BR>> Chameleon mailing
list<BR>> <A
href="mailto:Chameleon@lists.maptools.org">Chameleon@lists.maptools.org</A><BR>>
<A
href="http://lists.maptools.org/mailman/listinfo/chameleon">http://lists.maptools.org/mailman/listinfo/chameleon</A><BR>>
<BR>> <BR>> <BR>> JACOB DELFOS<BR>> SPATIAL
INFORMATION ANALYST<BR>> Maunsell Australia Pty Ltd<BR>> 629 Newcastle
Street, WA 6007<BR>> PO Box 81, WA 6902<BR>> Leederville <BR>> Western
Australia<BR>> ABN 20 093 846 925 <BR>> <BR>>
Tel + 61 8 9281 6185<BR>> Fax + 61
8 9281 6297<BR>> <A
href="mailto:jacob.delfos@maunsell.com">jacob.delfos@maunsell.com</A> <BR>>
_______________________________________________<BR>> Chameleon mailing
list<BR>> <A
href="mailto:Chameleon@lists.maptools.org">Chameleon@lists.maptools.org</A><BR>>
<A
href="http://lists.maptools.org/mailman/listinfo/chameleon">http://lists.maptools.org/mailman/listinfo/chameleon</A><BR>>
<BR>> <BR>><BR></FONT></DIV></BODY></HTML>