Moving SRSReferenceGroup parser from Base to v3.

This commit is contained in:
ahocevar
2012-06-14 15:11:55 +02:00
parent fa90a42806
commit 88982e043f
2 changed files with 20 additions and 18 deletions

View File

@@ -90,12 +90,20 @@ OpenLayers.Format.GML.v3 = OpenLayers.Class(OpenLayers.Format.GML.Base, {
*/
readers: {
"gml": OpenLayers.Util.applyDefaults({
"_inherit": function(node, obj, container) {
// SRSReferenceGroup attributes
var dim = parseInt(node.getAttribute("srsDimension"), 10) ||
(container && container.srsDimension);
if (dim) {
obj.srsDimension = dim;
}
},
"featureMembers": function(node, obj) {
this.readChildNodes(node, obj);
},
"Curve": function(node, container) {
var obj = {points: []};
this.readers.gml._srsReferenceGroup.apply(this, [node, obj, container]);
this.readers.gml._inherit.apply(this, [node, obj, container]);
this.readChildNodes(node, obj);
if(!container.components) {
container.components = [];
@@ -174,7 +182,7 @@ OpenLayers.Format.GML.v3 = OpenLayers.Class(OpenLayers.Format.GML.Base, {
},
"MultiCurve": function(node, container) {
var obj = {components: []};
this.readers.gml._srsReferenceGroup.apply(this, [node, obj, container]);
this.readers.gml._inherit.apply(this, [node, obj, container]);
this.readChildNodes(node, obj);
if(obj.components.length > 0) {
container.components = [
@@ -187,7 +195,7 @@ OpenLayers.Format.GML.v3 = OpenLayers.Class(OpenLayers.Format.GML.Base, {
},
"MultiSurface": function(node, container) {
var obj = {components: []};
this.readers.gml._srsReferenceGroup.apply(this, [node, obj, container]);
this.readers.gml._inherit.apply(this, [node, obj, container]);
this.readChildNodes(node, obj);
if(obj.components.length > 0) {
container.components = [