Skip to main content
1 of 2
CaptDragon
  • 13.4k
  • 7
  • 55
  • 96

Here is one way.

Add this to your code:

    var polygonLayer = new OpenLayers.Layer.Vector("Polygon Layer");

    polygonLayer.events.on({
        featuresadded: function (event) {
            var confirmPolygon = function () { return confirm("Do you want to keep this polygon?") };

            if (!confirmPolygon()) {
                polygonLayer.removeFeatures(event.features);
            }

        }
    });

I'll post an update for the radio button comment/suggestion.

CaptDragon
  • 13.4k
  • 7
  • 55
  • 96