[OpenLayers-Users] WFS points for markers and popups

Burgholzer,Robert rwburgholzer at deq.virginia.gov
Fri May 9 10:42:30 EDT 2008


Tom,
You may first want to look at the popups demo, popups.html and the textmarkers demo, markersTextLayer.html, in the example folder of the OpenLayers distro.

It would seem that this would be fairly easy to add to a WMS layer.

r.b.


-----Original Message-----
From:	users-bounces at openlayers.org on behalf of Tom (JDi Solutions)
Sent:	Fri 5/9/2008 10:20 AM
To:	users at openlayers.org
Cc:	
Subject:	[OpenLayers-Users] WFS points for markers and popups

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/c0dfc8b2/attachment.html


More information about the Users mailing list