[OpenLayers-Commits] r2016 - sandbox/vector/lib/OpenLayers/Writer
commits at openlayers.org
commits at openlayers.org
Wed Dec 6 11:15:19 EST 2006
Author: pgiraud
Date: 2006-12-06 11:15:19 -0500 (Wed, 06 Dec 2006)
New Revision: 2016
Modified:
sandbox/vector/lib/OpenLayers/Writer/GML.js
sandbox/vector/lib/OpenLayers/Writer/WFS.js
Log:
modifications needed for a first testcase
Modified: sandbox/vector/lib/OpenLayers/Writer/GML.js
===================================================================
--- sandbox/vector/lib/OpenLayers/Writer/GML.js 2006-12-06 15:55:47 UTC (rev 2015)
+++ sandbox/vector/lib/OpenLayers/Writer/GML.js 2006-12-06 16:15:19 UTC (rev 2016)
@@ -23,17 +23,21 @@
* @param {OpenLayers.Geometry} geometry
*/
buildXmlNode: function(geometry) {
- this.gml = document.createElementNS("http://www.opengis.net/gml", 'gml:LineString');
+ this.gml = document.createElementNS("http://www.opengis.net/gml", 'gml:MultiLineString');
// TBD retrieve the srs from layer
this.gml.setAttribute("srsName", "http://www.opengis.net/gml/srs/epsg.xml#4326");
+ var lineStringMember = document.createElementNS("http://www.opengis.net/gml", 'gml:lineStringMember');
+
+ var lineString = document.createElementNS("http://www.opengis.net/gml", 'gml:LineString');
+
var coordinates = document.createElementNS("http://www.opengis.net/gml", "gml:coordinates");
coordinates.setAttribute("decimal", ".");
coordinates.setAttribute("cs", ",");
coordinates.setAttribute("ts", " ");
- var points = geometry.path;
+ var points = geometry.components[0].path;
var path = "";
for (var i = 0; i < points.length; i++) {
path += points[i].lon + "," + points[i].lat + " ";
@@ -42,6 +46,9 @@
var txtNode = document.createTextNode(path);
coordinates.appendChild(txtNode);
- this.gml.appendChild(coordinates);
+ lineString.appendChild(coordinates);
+ lineStringMember.appendChild(lineString);
+
+ this.gml.appendChild(lineStringMember);
},
}
\ No newline at end of file
Modified: sandbox/vector/lib/OpenLayers/Writer/WFS.js
===================================================================
--- sandbox/vector/lib/OpenLayers/Writer/WFS.js 2006-12-06 15:55:47 UTC (rev 2015)
+++ sandbox/vector/lib/OpenLayers/Writer/WFS.js 2006-12-06 16:15:19 UTC (rev 2016)
@@ -92,7 +92,7 @@
var nameNode = document.createElementNS('http://www.opengis.net/wfs', 'wfs:Name');
// TBD get the geometry field name
- var txtNode = document.createTextNode("wkb_geometry");
+ var txtNode = document.createTextNode(feature.layer.params.geometry_column);
nameNode.appendChild(txtNode);
propertyNode.appendChild(nameNode);
More information about the Commits
mailing list