[Chameleon] Legend template/xml structure
Godwin, Liz
Godwinl at AGR.GC.CA
Wed Jun 30 14:20:43 EDT 2004
Ken,
What I do in cases where I want more control with the legend is to use
conditional blocks and metadata tags. I would assign in this case for
example, a layer metadata tag in the map file called "display_class" and
for each layer, set it to 1 or 0. In the legend temeplate, I'd have a
conditional block set within the [leg_class_html] block that tests for
this.
ie..
[leg_class_html]
[if name=display_class value=1]
<!--class stuff -->
<img src=[leg_icon]> [leg_class_name]<br>
[/if]
[/leg_class_html]
In this case, the class html would only display if you set the layer's
metadata to do so.
Also...
- Classes without the NAME tag set in the map file, do not display in
legends.
- Using [leg_icon] in the layer block will produce an icon representing
the first class. If in the class block, will produce one for each
class. - you could use the IF statements in the layer block too to
decide if you want the layer to have an icon where there classes are not
displayed in the legend.
To answer your question though...no... it's not automatic.
Liz
-----Original Message-----
From: Ken Sanderson [mailto:ken at rockies.ca]
Sent: June 29, 2004 4:37 PM
To: Godwin, Liz
Subject: RE: [Chameleon] Legend template/xml structure
Hello, I have a few attempts under my belt, some working better then
others, and just had a question. Is there a way to test how many class
objects a layer object might have? Overall I wanted to treat a layer as
a layer, unless it has more then 1 class object at which point I treat
it completely differently, thus allowing me greater control of the
appearance.
I cant see a way of doing it however. I could use the name of layer, but
then I would need a different template for every map, which I also would
rather not do.
Thoughts?
Ken
-----Original Message-----
From: chameleon-bounces at lists.maptools.org
[mailto:chameleon-bounces at lists.maptools.org] On Behalf Of Godwin, Liz
Sent: June 29, 2004 12:37 PM
To: Ken Sanderson
Cc: chameleon at lists.maptools.org
Subject: RE: [Chameleon] Legend template/xml structure
Ken,
I've started a Wiki page for HTML legend examples that work in
Chameleon. I've only added one for now, that doesn't use Classes or
Groups. I will try to add more soon when I've cleaned them up a bit.
Most of mine I haven't used in Chameleon.
One legend I think might help point you in the right driection is legend
2 at the bottom of this page:
http://mapserver.gis.umn.edu/doc40/html-legend-howto.html#live
In the meantime, if you have something started that isn't quite working
right (after reading the docs...they are quite helpful) then please feel
free to post back to me or the list.
Liz Godwin
-----Original Message-----
From: Ken Sanderson [mailto:ken at rockies.ca]
Sent: June 29, 2004 12:35 PM
To: Godwin, Liz
Subject: RE: [Chameleon] Legend template/xml structure
Thanks, Liz. Your examples would be greatly appreciated, really helps to
learn when you can refer to what other folks have done.
In the mean time I will read over that link, thanks again.
Ken
-----Original Message-----
From: Godwin, Liz [mailto:Godwinl at AGR.GC.CA]
Sent: June 29, 2004 6:39 AM
To: Ken Sanderson; chameleon at lists.maptools.org
Subject: RE: [Chameleon] Legend template/xml structure
Hi Ken,
I personally prefer the HTML legend templates to the XML templates. They
work well for me.
At the MapServer site there is a good document with examples. This with
some trial and error, taught me what I need to know.
http://mapserver.gis.umn.edu/doc40/html-legend-howto.html
I have made some complicated HTML legend files that support groups,
layers and classes, and I have weak support for WMS layers as a
workaround for Mapserver not yet doing this automatically. If you are
interested I can post these.
Liz Godwin
-----Original Message-----
From: chameleon-bounces at lists.maptools.org
[mailto:chameleon-bounces at lists.maptools.org] On Behalf Of Ken Sanderson
Sent: June 28, 2004 4:42 PM
To: chameleon at lists.maptools.org
Subject: [Chameleon] Legend template/xml structure
Hello all. Now that I have chameleon up and functioning, as well as
created a map file using Maplab I wanted to jump into doing some
modifications to my legend.
I have a layer with multiple class objects that I also want to show up
in the legend. Basically it's a polygon layer that is displayed by an
attribute value. Displays well, but the legend just displays the top
color rather then each of the potential attribute colors.
So I have been looking at the legendtemplate widget, along with the
legend_template.html file, and further the sample_themes.xml file,
trying to decide whats the best way to go about this and I have a few
questions.
Is there any documentation on the scripting in the legend_template.html
file, such as variables, what opt_flag is for and what other options you
have there, what is the isset operator, etc? Same for the xml page, is
there a schema for it? If I wanted to include classes is there a <class>
object? Can you put a <group> within a <group>?
Thanks,
Ken
_______________________________________________
Chameleon mailing list
Chameleon at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/chameleon
_______________________________________________
Chameleon mailing list
Chameleon at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/chameleon
More information about the Chameleon
mailing list