Using single argument for callback and string for projection

This makes the asynchronous and synchronous versions of
readFeatures work with the same data structures, and leaves
projection handling outside the parsers.
This commit is contained in:
ahocevar
2013-07-24 22:19:21 +02:00
parent a4ceb41938
commit 109ec71877
6 changed files with 48 additions and 55 deletions
+2 -3
View File
@@ -12,7 +12,6 @@ goog.require('ol.parser.ObjectFeatureParser');
goog.require('ol.parser.ReadFeaturesOptions');
goog.require('ol.parser.StringFeatureParser');
goog.require('ol.parser.XML');
goog.require('ol.proj');
@@ -47,7 +46,6 @@ ol.parser.GPX = function(opt_options) {
'gpx': function(node, obj) {
if (!goog.isDef(obj.features)) {
obj.features = [];
obj.metadata = {projection: ol.proj.get('EPSG:4326')};
}
this.readChildNodes(node, obj);
},
@@ -245,7 +243,8 @@ ol.parser.GPX.prototype.read = function(data) {
if (data && data.nodeType == 9) {
data = data.documentElement;
}
var obj = {features: [], metadata: {projection: ol.proj.get('EPSG:4326')}};
var obj = /** @type {ol.parser.ReadFeaturesResult} */
({metadata: {projection: 'EPSG:4326'}});
this.readNode(data, obj);
return obj;
};