Use goog.functions.sequence

This commit is contained in:
ahocevar
2013-08-04 12:54:24 +02:00
parent b66f4aef07
commit 3ebbdbb48f
2 changed files with 12 additions and 11 deletions

View File

@@ -74,7 +74,7 @@ ol.parser.ogc.GML = function(opt_options) {
},
'http://www.opengis.net/gml': {
'_inherit': function(node, obj, container) {
// To be implemented by version specific parsers
// Version specific parsers extend this with goog.functions.sequence
var srsName;
if (!goog.isDef(this.srsName)) {
srsName = this.srsName = node.getAttribute('srsName');

View File

@@ -1,6 +1,7 @@
goog.provide('ol.parser.ogc.GML_v3');
goog.require('goog.array');
goog.require('goog.functions');
goog.require('goog.object');
goog.require('ol.geom.GeometryType');
goog.require('ol.parser.ogc.GML');
@@ -60,17 +61,17 @@ ol.parser.ogc.GML_v3 = function(opt_options) {
}
return node;
};
var baseInherit = this.readers['http://www.opengis.net/gml']['_inherit'];
goog.object.extend(this.readers['http://www.opengis.net/gml'], {
'_inherit': function(node, obj, container) {
baseInherit.call(this, node, obj, container);
// SRSReferenceGroup attributes
var dim = parseInt(node.getAttribute('srsDimension'), 10) ||
(container && container.srsDimension);
if (dim) {
obj.srsDimension = dim;
}
},
'_inherit': goog.functions.sequence(
this.readers['http://www.opengis.net/gml']['_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);
},