How can one convert a Polygon to LinearRing geometry using OpenLayers? I'm thinking that I can do this by getting bounds of the polygon, then use this to construct a Points array. Finally, use OpenLayers.Geometry.LinearRing(Points_Array) constructor to create the LinearRing. My attempts so far have flopped. Any code samples on how to achieve this will be highly appreciated.
UPDATE:
I've accepted @drnexgis' answer for what it taught me on converting geometry to GML format. It only partially answered the question, but it was helpful.
Best Answer
For example:
UPDATE
There is no API method for convering geometry to gml format, but you can use internal
OpenLayers.Format.GML.buildGeometry.polygon
function:Live demo here.