[OpenLayers-Users] legend "floating" over map

Mark Prins mc.prins at gmail.com
Wed Dec 5 05:54:00 PST 2012


2012/12/4 Gery <gamejihou at hotmail.com>

> Thanks Donald, Alexandre, Sergeant and Mark for the ideas. I think Mark's
> solution is what I have in mind, Mark could you share an example about
> using
> this UpdateLegendControl.js script please? I went through it but I'm
> confused about how to use it.
>

you just add it to a map as a control while passing a div or other
container element that you want to hold the legend:

_map.addControl(new UpdateLegendControl({
         div : jQuery('#legendDiv')[0]
}));


like shown here:
https://github.com/MinELenI/CBSviewer/blob/master/src/main/js/Viewer.js#L168
The div should be styled and positioned with some css



-- 
Disclaimer;
This message is just a reflection of what I thought at the time of sending.
The message may contain information that is not intended for you or that
you don't understand.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20121205/eb413082/attachment.html>


More information about the Users mailing list