[OpenLayers-Users] Serialise Control?

Eric Lemoine eric.c2c at gmail.com
Tue Nov 20 09:33:35 EST 2007


On Nov 17, 2007 5:47 PM, mike <mike at bristolbeat.co.uk> wrote:
> Leading on from the modify-feature example, I wonder if there could or
> should be a Save / Serialize  control in openlayers that could be added and
> called like these other functions, and would serialize (and possibly put /
> post to a handling script) the vector data into one of the GML  type
> formats.
>
> This would be really handy for any kind of editing application.

Hi Mike,

FYI, given a vector layer populated with features, you can do this to
get a GML string:

var serializer = new OpenLayers.Format.GML();
var gml = serializer.write(vectorLayer.features);

Given that, building a custom control that does what you want
shouldn't be too difficult.

--
Eric



More information about the Users mailing list