[OpenLayers-Users] What's the Best Way to Create Lengends with OL/MapServer?

Eric Lemoine eric.lemoine at camptocamp.com
Sat Aug 15 09:03:52 EDT 2009


On Saturday, August 15, 2009, Bill Thoen <bthoen at gisnet.com> wrote:
> Greetings All,
>
> What's the best way to create legends in an OpenLayers interface over
> MapServer? Is there a way to use the MS HTML legends from a mapfile, or
> do I have to start with GetLegendGraphic calls anyway? What I'd like is
> a Legend / Layer Control from which I could show / hide layers and see
> their current styles -- something like the type 3 legends described in
> the MS docs here:
> http://www.mapserver.org/output/html_legend.html#sample-site-using-the-html-legend.
> But these templates seem to be usable only with MapServer; OpenLayers
> doesn't appear to read a mapfile to that level.
>
> In the long run, however, what I really want is a Layer Control; one
> that allows the user to change layer order, turn layers on and off,
> change their styles, mark a layer as selectable and/or  editable,and
> group layers so that the groups can be moved up or down, made visible or
> hidden, etc. as a group. That, I suppose, is a job for JavaScript or
> something similar, which I can do if that's the best approach, but if
> there's something ready to use out there already, I'd rather not
> re-invent it.
>
> There always seems to be so many choices when you build your own that
> sometimes I hardly know where to start!


Hi.

what you're asking is beyond the scope of OpenLayers. I'd recommend
you look at GeoExt (www.geoext.org), which features a layer tree and a
legend panel (based on GetLegendGraphic for WMS layers).

Hope this helps,



>
>
> Thanks,
> - Bill Thoen
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com



More information about the Users mailing list