Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

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

http://osgeo-org.1560.n6.nabble.com/Can-I-prevent-OpenLayers-from-losing-my-WFS-T-feature-edits-td5042133.html

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

wfsLayerP = new OpenLayers.Layer.Vector(
        "layername",
        {
            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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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