From b0c1ef04a1d8aede528e4e2cd514f00832e5a67d Mon Sep 17 00:00:00 2001 From: ahocevar Date: Mon, 22 Jul 2013 15:02:43 +0200 Subject: [PATCH] Implementing getProjection for KML and GPX --- src/ol/parser/gpx.js | 9 +++++++++ src/ol/parser/kml.js | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/src/ol/parser/gpx.js b/src/ol/parser/gpx.js index 4e723e1ee2..712102b81e 100644 --- a/src/ol/parser/gpx.js +++ b/src/ol/parser/gpx.js @@ -12,6 +12,7 @@ goog.require('ol.parser.ObjectFeatureParser'); goog.require('ol.parser.ReadFeaturesOptions'); goog.require('ol.parser.StringFeatureParser'); goog.require('ol.parser.XML'); +goog.require('ol.proj'); @@ -232,6 +233,14 @@ ol.parser.GPX = function(opt_options) { goog.inherits(ol.parser.GPX, ol.parser.XML); +/** + * @inheritDoc + */ +ol.parser.GPX.prototype.getProjection = function() { + return ol.proj.get('EPSG:4326'); +}; + + /** * @param {string|Document|Element|Object} data Data to read. * @return {Object} An object representing the document. diff --git a/src/ol/parser/kml.js b/src/ol/parser/kml.js index 42d91a5f0a..91932449bd 100644 --- a/src/ol/parser/kml.js +++ b/src/ol/parser/kml.js @@ -27,6 +27,7 @@ goog.require('ol.parser.DomFeatureParser'); goog.require('ol.parser.ReadFeaturesOptions'); goog.require('ol.parser.StringFeatureParser'); goog.require('ol.parser.XML'); +goog.require('ol.proj'); goog.require('ol.style.Icon'); goog.require('ol.style.Line'); goog.require('ol.style.LineLiteral'); @@ -928,6 +929,14 @@ ol.parser.KML.prototype.parseLinks = function(deferreds, obj, done) { }; +/** + * @inheritDoc + */ +ol.parser.KML.prototype.getProjection = function() { + return ol.proj.get('EPSG:4326'); +}; + + /** * @param {string|Document|Element|Object} data Data to read. * @param {Function=} opt_callback Optional callback to call when reading