Hi, 
 
create a feature from your geometry and save that.
 
var geometry_collection = new OpenLayers.Geometry.MultiPoint();
 
var fts=vectorLayer.features;
for(var i=0;i<fts.length;i++)
    geometry_collection.addPoint(fts[i].geometry);
 
var writer       = new OpenLayers.Format.GML();
var feature      = new OpenLayers.Feature.Vector();
feature.geometry = geometry_collection;
 
var gml = writer.write(feature);
 
alert(gml);
 
Arnd



  _____  

Von: [email protected]
[mailto:[email protected]] Im Auftrag von Lucas
Heezen - Covadis
Gesendet: Donnerstag, 1. März 2012 09:33
An: openlayers list
Betreff: [OpenLayers-Users] GeometryCollection to GML



Hello, 

 

Is it possible to convert a geometry.collection (multipoint) to gml?

 

This is what I have so far:

 

var geometry_collection = new OpenLayers.Geometry.MultiPoint();

vectorLayer.features.each(function(ff, index) {

geometry_collection.addPoint(ff.geometry);

});

                        

var writer = new OpenLayers.Format.GML();

var gml = writer.buildGeometry.multipoint(geometry_collection);

alert(gml);

 

But is get the following error:  this.createElementNS is not a function

 


Met vriendelijke groet,
Lucas Heezen


Beschrijving: http://www.covadis.nl/emailkop/logo.gif

Covadis b.v. 

t: 026 3616600 


Geograaf 12 

f: 026 3612317 


6921 EW Duiven 

e:  <mailto:[email protected]> [email protected]

 

<<image001.gif>>

_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to