Thanks for the idea. I am currently using something like this:
vectors.onFeatureInsert= function(feature) { var wktwriter=new OpenLayers.Format.WKT(); var wkt=wktwriter.write(feature); } vectors being the vector layer obviously. Not sure if the above is correct but at least the output is something I can use to store and retrieve from the DB. 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. Now on to deleting/removing a feature... Thanks again. On Wed, Feb 3, 2010 at 12:15 PM, John Powell <john.pow...@emapsite.com>wrote: > In response to the question about saving polygons, it is also worth > looking at Format.WKT as this produces polygons in OGC compliant format > which can then be inserted into a spatially enabled database such as > Postgres or MySQL. > > Somthing like > > > layer.events.register('featureadded', this, function(obj){ > var wktwriter=new OpenLayers.Format.WKT(); > var wkt=wktwriter.write(obj.feature); > } > > wkt will now look something like POLYGON(( x1 y1, x2 y2, .....x1, y1)) > > and you can insert this into a geometry column of a db using the > geomfromtext function. > > > >
_______________________________________________ Dev mailing list Dev@openlayers.org http://openlayers.org/mailman/listinfo/dev