diff --git a/src/ol/format/gpxformat.js b/src/ol/format/gpxformat.js index 06fb6fcd65..81719ef074 100644 --- a/src/ol/format/gpxformat.js +++ b/src/ol/format/gpxformat.js @@ -501,22 +501,6 @@ ol.format.GPX.prototype.readFeaturesFromNode = function(node, opt_options) { ol.format.GPX.prototype.readProjection; -/** - * @inheritDoc - */ -ol.format.GPX.prototype.readProjectionFromDocument = function(doc) { - return this.defaultDataProjection; -}; - - -/** - * @inheritDoc - */ -ol.format.GPX.prototype.readProjectionFromNode = function(node) { - return this.defaultDataProjection; -}; - - /** * @param {Node} node Node. * @param {string} value Value for the link's `href` attribute. diff --git a/src/ol/format/igcformat.js b/src/ol/format/igcformat.js index c6d9a987b1..aa57c6273e 100644 --- a/src/ol/format/igcformat.js +++ b/src/ol/format/igcformat.js @@ -218,11 +218,3 @@ ol.format.IGC.prototype.readFeaturesFromText = function(text, opt_options) { * @api */ ol.format.IGC.prototype.readProjection; - - -/** - * @inheritDoc - */ -ol.format.IGC.prototype.readProjectionFromText = function(text) { - return this.defaultDataProjection; -}; diff --git a/src/ol/format/kmlformat.js b/src/ol/format/kmlformat.js index b45668bd38..03e30f0477 100644 --- a/src/ol/format/kmlformat.js +++ b/src/ol/format/kmlformat.js @@ -1721,22 +1721,6 @@ ol.format.KML.prototype.readNameFromNode = function(node) { ol.format.KML.prototype.readProjection; -/** - * @inheritDoc - */ -ol.format.KML.prototype.readProjectionFromDocument = function(doc) { - return this.defaultDataProjection; -}; - - -/** - * @inheritDoc - */ -ol.format.KML.prototype.readProjectionFromNode = function(node) { - return this.defaultDataProjection; -}; - - /** * @param {Node} node Node to append a TextNode with the color to. * @param {ol.Color|string} color Color. diff --git a/src/ol/format/osmxmlformat.js b/src/ol/format/osmxmlformat.js index 01165e61cc..7f7d7959b8 100644 --- a/src/ol/format/osmxmlformat.js +++ b/src/ol/format/osmxmlformat.js @@ -234,19 +234,3 @@ ol.format.OSMXML.prototype.readFeaturesFromNode = function(node, opt_options) { * @api stable */ ol.format.OSMXML.prototype.readProjection; - - -/** - * @inheritDoc - */ -ol.format.OSMXML.prototype.readProjectionFromDocument = function(doc) { - return this.defaultDataProjection; -}; - - -/** - * @inheritDoc - */ -ol.format.OSMXML.prototype.readProjectionFromNode = function(node) { - return this.defaultDataProjection; -}; diff --git a/src/ol/format/polylineformat.js b/src/ol/format/polylineformat.js index cab6513231..d5196d555c 100644 --- a/src/ol/format/polylineformat.js +++ b/src/ol/format/polylineformat.js @@ -340,14 +340,6 @@ ol.format.Polyline.prototype.readGeometryFromText = ol.format.Polyline.prototype.readProjection; -/** - * @inheritDoc - */ -ol.format.Polyline.prototype.readProjectionFromText = function(text) { - return this.defaultDataProjection; -}; - - /** * @inheritDoc */ diff --git a/src/ol/format/textfeatureformat.js b/src/ol/format/textfeatureformat.js index c838c1a729..bdaeaf7f44 100644 --- a/src/ol/format/textfeatureformat.js +++ b/src/ol/format/textfeatureformat.js @@ -111,7 +111,9 @@ ol.format.TextFeature.prototype.readProjection = function(source) { * @protected * @return {ol.proj.Projection} Projection. */ -ol.format.TextFeature.prototype.readProjectionFromText = goog.abstractMethod; +ol.format.TextFeature.prototype.readProjectionFromText = function(text) { + return this.defaultDataProjection; +}; /** diff --git a/src/ol/format/wktformat.js b/src/ol/format/wktformat.js index 40fc27601c..97505f0191 100644 --- a/src/ol/format/wktformat.js +++ b/src/ol/format/wktformat.js @@ -291,14 +291,6 @@ ol.format.WKT.prototype.readGeometryFromText = function(text, opt_options) { }; -/** - * @inheritDoc - */ -ol.format.WKT.prototype.readProjectionFromText = function(text) { - return null; -}; - - /** * Encode a feature as a WKT string. * diff --git a/src/ol/format/xmlfeatureformat.js b/src/ol/format/xmlfeatureformat.js index 5ac7ba18ef..48a08db421 100644 --- a/src/ol/format/xmlfeatureformat.js +++ b/src/ol/format/xmlfeatureformat.js @@ -185,7 +185,9 @@ ol.format.XMLFeature.prototype.readProjection = function(source) { * @protected * @return {ol.proj.Projection} Projection. */ -ol.format.XMLFeature.prototype.readProjectionFromDocument = goog.abstractMethod; +ol.format.XMLFeature.prototype.readProjectionFromDocument = function(doc) { + return this.defaultDataProjection; +}; /** @@ -193,7 +195,9 @@ ol.format.XMLFeature.prototype.readProjectionFromDocument = goog.abstractMethod; * @protected * @return {ol.proj.Projection} Projection. */ -ol.format.XMLFeature.prototype.readProjectionFromNode = goog.abstractMethod; +ol.format.XMLFeature.prototype.readProjectionFromNode = function(node) { + return this.defaultDataProjection; +}; /** diff --git a/test/spec/ol/format/gpxformat.test.js b/test/spec/ol/format/gpxformat.test.js index 8f1483f612..986d3343c9 100644 --- a/test/spec/ol/format/gpxformat.test.js +++ b/test/spec/ol/format/gpxformat.test.js @@ -7,6 +7,18 @@ describe('ol.format.GPX', function() { format = new ol.format.GPX(); }); + describe('#readProjection', function() { + it('returns the default projection from document', function() { + var projection = format.readProjectionFromDocument(); + expect(projection).to.eql(ol.proj.get('EPSG:4326')); + }); + + it('returns the default projection from node', function() { + var projection = format.readProjectionFromNode(); + expect(projection).to.eql(ol.proj.get('EPSG:4326')); + }); + }); + describe('readFeatures', function() { describe('rte', function() { diff --git a/test/spec/ol/format/igcformat.test.js b/test/spec/ol/format/igcformat.test.js index c3b9c88440..c417de928f 100644 --- a/test/spec/ol/format/igcformat.test.js +++ b/test/spec/ol/format/igcformat.test.js @@ -29,6 +29,13 @@ describe('ol.format.IGC', function() { format = new ol.format.IGC(); }); + describe('#readProjectionFromText', function() { + it('returns the default projection', function() { + var projection = format.readProjectionFromText(igc); + expect(projection).to.eql(ol.proj.get('EPSG:4326')); + }); + }); + describe('#readFeature', function() { it('does not read invalid features', function() { expect(format.readFeature('invalid')).to.be(null); diff --git a/test/spec/ol/format/kmlformat.test.js b/test/spec/ol/format/kmlformat.test.js index 447ee870d9..ce46fc54b4 100644 --- a/test/spec/ol/format/kmlformat.test.js +++ b/test/spec/ol/format/kmlformat.test.js @@ -8,6 +8,18 @@ describe('ol.format.KML', function() { format = new ol.format.KML(); }); + describe('#readProjection', function() { + it('returns the default projection from document', function() { + var projection = format.readProjectionFromDocument(); + expect(projection).to.eql(ol.proj.get('EPSG:4326')); + }); + + it('returns the default projection from node', function() { + var projection = format.readProjectionFromNode(); + expect(projection).to.eql(ol.proj.get('EPSG:4326')); + }); + }); + describe('#readFeatures', function() { describe('id', function() { diff --git a/test/spec/ol/format/osmxmlformat.test.js b/test/spec/ol/format/osmxmlformat.test.js index 025db6e611..da4e34bf63 100644 --- a/test/spec/ol/format/osmxmlformat.test.js +++ b/test/spec/ol/format/osmxmlformat.test.js @@ -8,6 +8,18 @@ describe('ol.format.OSMXML', function() { format = new ol.format.OSMXML(); }); + describe('#readProjection', function() { + it('returns the default projection from document', function() { + var projection = format.readProjectionFromDocument(); + expect(projection).to.eql(ol.proj.get('EPSG:4326')); + }); + + it('returns the default projection from node', function() { + var projection = format.readProjectionFromNode(); + expect(projection).to.eql(ol.proj.get('EPSG:4326')); + }); + }); + describe('#readFeatures', function() { it('can read an empty document', function() { diff --git a/test/spec/ol/format/polylineformat.test.js b/test/spec/ol/format/polylineformat.test.js index 1137d7c6c9..f6ce417bfb 100644 --- a/test/spec/ol/format/polylineformat.test.js +++ b/test/spec/ol/format/polylineformat.test.js @@ -40,6 +40,12 @@ describe('ol.format.Polyline', function() { // Reset testing data beforeEach(resetTestingData); + describe('#readProjectionFromText', function() { + it('returns the default projection', function() { + var projection = format.readProjectionFromText(encodedFlatPoints); + expect(projection).to.eql(ol.proj.get('EPSG:4326')); + }); + }); describe('encodeDeltas', function() { it('returns expected value', function() { diff --git a/test/spec/ol/format/wktformat.test.js b/test/spec/ol/format/wktformat.test.js index 0012023aa5..705062ea36 100644 --- a/test/spec/ol/format/wktformat.test.js +++ b/test/spec/ol/format/wktformat.test.js @@ -4,6 +4,13 @@ describe('ol.format.WKT', function() { var format = new ol.format.WKT(); + describe('#readProjectionFromText', function() { + it('returns the default projection', function() { + var projection = format.readProjectionFromText('POINT(1 2)'); + expect(projection).to.be(null); + }); + }); + describe('#readGeometry()', function() { it('transforms with dataProjection and featureProjection', function() {