Thanks for the idea.<br><br>I am currently using something like this:<br><br>vectors.onFeatureInsert=<div id=":am" class="ii gt">function(feature) {<div class="im"><br>    var wktwriter=new OpenLayers.Format.WKT();<br></div>
    var wkt=wktwriter.write(feature);<br>}<br><br>
vectors being the vector layer obviously.<br><br>Not sure if the above is correct but at least the output is something I can use to store and retrieve from the DB.<br>I am probably going to save the output temporarily in the variable and save it in the DB when the user is done editing the map.<br>

<br>Now on to deleting/removing a feature...<br><br>Thanks again.<br></div><br><br><div class="gmail_quote">On Wed, Feb 3, 2010 at 12:15 PM, John Powell <span dir="ltr">&lt;<a href="mailto:john.powell@emapsite.com">john.powell@emapsite.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">In response to the question about saving polygons, it is also worth<br>
looking at Format.WKT as this produces polygons in OGC compliant format<br>
which can then be inserted into a spatially enabled database such as<br>
Postgres or MySQL.<br>
<br>
Somthing like<br>
<br>
<br>
layer.events.register(&#39;featureadded&#39;, this, function(obj){<br>
    var wktwriter=new OpenLayers.Format.WKT();<br>
    var wkt=wktwriter.write(obj.feature);<br>
}<br>
<br>
wkt will now look something like POLYGON(( x1 y1, x2 y2, .....x1, y1))<br>
<br>
and you can insert this into a geometry column of a db using the<br>
geomfromtext function.<br>
<br>
<br><br></blockquote></div><br>