[OpenLayers-Users] openLayer and GML3.1 ?
Sébastien Geindre
sebastien.geindre at meteo.fr
Thu Nov 8 05:39:53 EST 2007
hi everybody,
It seems that OL could build GML geometry from polygon feature.
But, gml data seems to be GML2, am i wrong ?
is thre any work on GML3 ? in the sand box ?
/**
* Method: buildGeometry.polygon
* Given an OpenLayers polygon geometry, create a GML polygon.
*
* Parameters:
* geometry - {<OpenLayers.Geometry.Polygon>} A polygon geometry.
*
* Returns:
* {DOMElement} A GML polygon node.
*/
polygon: function(geometry) {
var gml = this.createElementNS(this.gmlns, "gml:Polygon");
var rings = geometry.components;
var ringMember, ringGeom, type;
for(var i=0; i<rings.length; ++i) {
type = (i==0) ? "outerBoundaryIs" : "innerBoundaryIs";
ringMember = this.createElementNS(this.gmlns,
"gml:" + type);
ringGeom = this.buildGeometry.linearring.apply(this,
[rings[i]]);
ringMember.appendChild(ringGeom);
gml.appendChild(ringMember);
}
return gml;
}
--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr
More information about the Users
mailing list