Merge pull request #3156 from fredj/format-getprojection

Move readProjectionFrom* functions to the base classes
This commit is contained in:
Frédéric Junod
2015-01-21 13:30:47 +01:00
14 changed files with 65 additions and 75 deletions

View File

@@ -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() {

View File

@@ -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);

View File

@@ -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() {

View File

@@ -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() {

View File

@@ -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() {

View File

@@ -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() {