[OpenLayers-Users] Re: OpenLayers Refresh Strategy Problems

HughBarker Hugh.Barker at csiro.au
Mon Oct 3 21:21:41 EDT 2011


Well, it turns out that you can't do a refresh strategy on a WMS service, as
far as I can tell. So I converted my code to use WFS instead, and it works
as expected. The working code:

            underway = new OpenLayers.Layer.Vector("WFS", {
                strategies: [new OpenLayers.Strategy.BBOX(), new
OpenLayers.Strategy.Refresh({interval: 4000, force: true})],
                protocol: new OpenLayers.Protocol.WFS({
                    url: 
"http://ubuntu-geospatial-server:8080/geoserver/wfs",
                    featureType: "ss2011_v03",
                    featureNS: "http://csiro.au/underway",
                    geometryName: "position"
                });

Note that I also need a BBOX strategy. Another gotcha that I found was that
I needed to manually specify the geometryName, otherwise it would default to
"the_geom", which doesn't exist for my layer.

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/OpenLayers-Refresh-Strategy-Problems-tp6856908p6857254.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list