I have two json arrays, one for background polygon and one for other polygon. And from them, I got two polygon layers.
backgroundLayer = new OpenLayers.Layer.Vector("Background Layer", {styleMap: backgroundStyleMap} );
....
totalAreaPolygon = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([linearRing]))
backgroundLayer.addFeatures([totalAreaPolygon])
And same for other polygon.
How can I subtract the other polygon from background polygon as shown in the picture (right polygon).

This is one of the examples from OpenLayers. http://openlayers.org/dev/examples/donut.html
