[OpenLayers-Users] Vector/GML Question

Roger Kunkel rakunkel at ucdavis.edu
Wed Mar 28 12:46:28 EDT 2007


Thanks , that looks like what I need.

But, after

> gml = new OpenLayers.Format.GML();
> data = gml.write([feature,feature]);


I see that data is an featurecollection object. I want to look at the  
gml as text. How do I write it as text?

Thanks


On Mar 27, 2007, at 5:22 PM, Christopher Schmidt wrote:

> On Tue, Mar 27, 2007 at 10:13:32AM -0700, Roger Kunkel wrote:
>>
>> Is a geometry.toGML function in the works? Perhaps it already exists.
>> Seems like this would be very handy for posting user created/edited
>> geometries.
>
> See gml-serialize.html in the examples directory. Specifically, you  
> can
> serialize any list of features to GML via:
>
>   gml = new OpenLayers.Format.GML();
>   data = gml.write([feature,feature]);
>
> You can use layer.features to access the features drawn on a layer.
>
> Let me know if this doesn't help you.
>
> Regards,
> -- 
> Christopher Schmidt
> MetaCarta

Roger Kunkel
CERES Program
Dept. of Land AIr & Water Resources
UC Davis
rakunkel at ucdavis.edu






More information about the Users mailing list