Using openlayers (2.12) and drawing some vector features against a WFS-T interface (offered by geoserver).

Problem is, when I draw some geometries and pan a little bit too much, openlayers sends "wfs:GetFeature" message to WFS-T interface, and while doing this it resets all features I have drawn so far.

You can try this even using the public openlayers examples: http://openlayers.org/dev/examples/wfs-protocol-transactions.html

  1. draw some features
  2. pan / zoom around enough / too much before saving
  3. the features you drew disappear

Any way to prevent this?


Well, it seems there is no simple way to prevent this from happening. I ended up following advice on:


What I do is that I configure a larger than normal ratio for the layer:

wfsLayerP = new OpenLayers.Layer.Vector(
            strategies : [ new OpenLayers.Strategy.BBOX({ratio: 100})],

This is feasible since my layer does not contain much data when editing it. Changing ratio from 2 -> 100 almost completely removes GetFeature requests while panning / zooming reasonable amounts and solves the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.