[OpenLayers-Users] legend "floating" over map

Donald Kerr donald.kerr at dkerr.co.uk
Tue Nov 27 15:10:05 PST 2012


Maybe the following (haven't tried, just did a quick Google):

 

map.events.register('changelayer', null, function(evt){

       if(evt.property === "visibility") {

            if(evt.layer.name=="MyLayerName" {

                  DoSomething;

            }

       }

   }

);

 

From: Gery . [mailto:gamejihou at hotmail.com] 
Sent: 27 November 2012 21:46
To: donald.kerr at dkerr.co.uk; p.scadden at gns.cri.nz;
openlayers-users at lists.osgeo.org
Subject: RE: [OpenLayers-Users] legend "floating" over map

 

Thanks for the answer Phil and Donald. I was thinking about your
suggestions, but the point of this, actually I forgot to explain it, is that
this legend should appear once I choose the WMS in the layerswitcher, so I
have for example a WMS of bathymetry, so I choose that one and its legend
appears, then I choose the a WMS of metamorphic basement and its legend
appears, and so forth... I think Alexandre's work was what I saw once,
googling it I found this link [1] but it's broken, is there a new one
available out there?

[1]
http://dev.geoext.org/sandbox/mapgears/geoext.ux/ux/LayerTreeBuilder/example
s/tree-builder.html


____________________________________________________________________________
______________
Piensa en el medio ambiente - mantenlo en la pantalla. NO lo imprimas si NO
es necesario.
Think green - keep it on the screen. Do NOT print if it is NOT necessary.
Denken Sie an die Umwelt - bewahren Sie es auf dem Bildschirm. Drucken Sie
NICHT, wenn es NICHT notwendig ist.



  _____  

From: donald.kerr at dkerr.co.uk
To: p.scadden at gns.cri.nz; openlayers-users at lists.osgeo.org
Date: Tue, 27 Nov 2012 21:36:34 +0000
Subject: Re: [OpenLayers-Users] legend "floating" over map

Can you not just use an absolute/relative positioned div and put the image
in that?

 

From: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] On Behalf Of Phil Scadden
Sent: 27 November 2012 21:04
To: openlayers-users at lists.osgeo.org
Subject: Re: [OpenLayers-Users] legend "floating" over map

 

 

I've been scratching my head over this, no clear idea so far. I have a WMS
layer served with mapserver and want to display with it a legend image (PNG)
"floating" over the WMS. It means, when I move the WMS in OpenLayers, the
legend is always in the same place, ie, top-left corner of my screen. I
generated this legend, a sample is attached. I remember an example about
this in the Geoext examples web site but it's not longer there (if it
existed). Any idea about doing this is appreciated, thanks.

Create a popup - position on map where you want it. Put the legend image
into a popup (img tag in the html). If you have geoext loaded as well, the
strongly consider Alexandre Dube LayerTreebuilder ux as an alternative (used
on my PBE website) to build the legend.

Notice: This email and any attachments are confidential. If received in
error please destroy and immediately notify us. Do not copy or disclose the
contents.
 


_______________________________________________ Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users

No virus found in this message.
Checked by AVG - www.avg.com
Version: 2013.0.2793 / Virus Database: 2629/5920 - Release Date: 11/26/12

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20121127/630cba4c/attachment-0001.html>


More information about the Users mailing list