Hi, I've noticed that OpenLayers GML parsers will not parse standard GML geometry properties (gml:pointProperty, gml:polygonProperty etc.). I've attached a patch which should parse all GML2 standard properties plus (multi-)curve/surface GML3 properties.
What do you think? Best regards, Andreas
Index: lib/OpenLayers/Format/GML/v3.js
===================================================================
--- lib/OpenLayers/Format/GML/v3.js (revision 11888)
+++ lib/OpenLayers/Format/GML/v3.js (working copy)
@@ -230,6 +230,18 @@
var obj = {};
this.readers.gml.pos.apply(this, [node, obj]);
container.points[1] = obj.points[0];
+ },
+ "curveProperty": function(node, obj){
+ this.readers.feature["_geometry"].apply(this, [node, obj])
+ },
+ "surfaceProperty": function(node, obj){
+ this.readers.feature["_geometry"].apply(this, [node, obj])
+ },
+ "multiCurveProperty": function(node, obj){
+ this.readers.feature["_geometry"].apply(this, [node, obj])
+ },
+ "multiSurfaceProperty": function(node, obj){
+ this.readers.feature["_geometry"].apply(this, [node, obj])
}
}, OpenLayers.Format.GML.Base.prototype.readers["gml"]),
"feature": OpenLayers.Format.GML.Base.prototype.readers["feature"],
Index: lib/OpenLayers/Format/GML/Base.js
===================================================================
--- lib/OpenLayers/Format/GML/Base.js (revision 11888)
+++ lib/OpenLayers/Format/GML/Base.js (working copy)
@@ -323,6 +323,63 @@
},
"geometryMember": function(node, obj) {
this.readChildNodes(node, obj);
+ },
+ "pointProperty": function(node, obj){
+ this.readers.feature["_geometry"].apply(this, [node, obj])
+ },
+ "polygonProperty": function(node, obj){
+ this.readers.feature["_geometry"].apply(this, [node, obj])
+ },
+ "lineStringProperty": function(node, obj){
+ this.readers.feature["_geometry"].apply(this, [node, obj])
+ },
+ "multiPointProperty": function(node, obj){
+ this.readers.feature["_geometry"].apply(this, [node, obj])
+ },
+ "multiLineStringProperty": function(node, obj){
+ this.readers.feature["_geometry"].apply(this, [node, obj])
+ },
+ "multiPolygonProperty": function(node, obj){
+ this.readers.feature["_geometry"].apply(this, [node, obj])
+ },
+ "multiGeometryProperty": function(node, obj){
+ this.readers.feature["_geometry"].apply(this, [node, obj])
+ },
+ "location": function(node, obj){
+ this.readers.feature["_geometry"].apply(this, [node, obj])
+ },
+ "centerOf": function(node, obj){
+ this.readers.feature["_geometry"].apply(this, [node, obj])
+ },
+ "position": function(node, obj){
+ this.readers.feature["_geometry"].apply(this, [node, obj])
+ },
+ "extentOf": function(node, obj){
+ this.readers.feature["_geometry"].apply(this, [node, obj])
+ },
+ "coverage": function(node, obj){
+ this.readers.feature["_geometry"].apply(this, [node, obj])
+ },
+ "edgeOf": function(node, obj){
+ this.readers.feature["_geometry"].apply(this, [node, obj])
+ },
+ "centerLineOf": function(node, obj){
+ this.readers.feature["_geometry"].apply(this, [node, obj])
+ },
+ "multiLocation": function(node, obj){
+ this.readers.feature["_geometry"].apply(this, [node, obj])
+ },
+ "multiCenterOf": function(node, obj){
+ this.readers.feature["_geometry"].apply(this, [node, obj])
+ },
+ "multiEdgeOf": function(node, obj){
+ this.readers.feature["_geometry"].apply(this, [node, obj])
+ },
+ "multiCoverage": function(node, obj){
+ this.readers.feature["_geometry"].apply(this, [node, obj])
+ },
+ "multiExtentOf": function(node, obj){
+ this.readers.feature["_geometry"].apply(this, [node, obj])
}
},
"feature": {
signature.asc
Description: Digital signature
_______________________________________________ Dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-dev
