[OpenLayers-Users] WFS points for markers and popups

Tom (JDi Solutions) tom.dean at jdi-solutions.co.uk
Fri May 9 10:20:34 EDT 2008


Hi all,

I've googled and searched the examples and mail archives for the solution
for this but can't quite find precisely what I'm looking for so I wonder if
someone could help out?

I have so far managed to get a standard OpenLayers setup and added a WMS
base layer and a WFS layer which returns 2 pieces of data, a point geometry
(GEOLOC) and a site reference (SITE_REF) using the following code:

var layer2= new OpenLayers.Layer.WFS('Points',
'http://mygeoserver/geoserver/wfs?',{request:'GetFeature',PropertyName:'GEOLOC,SITE_REF',typeName:'gndp:points',isBaseLayer:'false',extractAttributes:'true'});

and that adds a layer of markers to the map which is great.  What I now want
is to add popups to these markers which simply displays the SITE_REF (I'll
later change this to some slightly more glamorous HTML but for now that will
do.
It seems like I may have to use featureClass: OpenLayers.Feature.WFS as
shown in the example here: http://openlayers.org/dev/examples/wfs.html but
that appears to give the same functionality I already have.  There is a
suggestion to subclass OpenLayers.Feature.WFS in order to add a popup but my
js skills are weak and I don't get how to do this.  Can someone give an
example?  Which methods need to be overridden and how do I get my data into
the popup?

Furthermore, is it possible to load the WFS layer as a tiled layer so I can
cache the results? and how do I set a different icon?

thanks in advance,

Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080509/7b0360e4/attachment.html


More information about the Users mailing list