diff --git a/changelog/upgrade-notes.md b/changelog/upgrade-notes.md index f88bca463a..9e9eff078a 100644 --- a/changelog/upgrade-notes.md +++ b/changelog/upgrade-notes.md @@ -2,6 +2,10 @@ ### Next Release +#### Removed GeoJSON crs workaround for GeoServer + +Previous version of GeoServer returned invalid crs in GeoJSON output. The workaround in `ol.format.GeoJSON` used to read this crs code is now removed. + #### Deprecation of `ol.Attribution` `ol.Attribution` is deprecated and will be removed in the next major version. Instead, you can construct a source with a string attribution or an array of strings. For dynamic attributions, you can provide a function that gets called with the current frame state. diff --git a/externs/geojson.js b/externs/geojson.js index 4dbe44a8d3..57ecc5b082 100644 --- a/externs/geojson.js +++ b/externs/geojson.js @@ -46,33 +46,11 @@ GeoJSONCRS.prototype.type; /** - * TODO: remove GeoJSONCRSCode when http://jira.codehaus.org/browse/GEOS-5996 - * is fixed and widely deployed. - * @type {!GeoJSONCRSCode|!GeoJSONCRSName|!GeoJSONLink} + * @type {!GeoJSONCRSName|!GeoJSONLink} */ GeoJSONCRS.prototype.properties; - -/** - * `GeoJSONCRSCode` is not part of the GeoJSON specification, but is generated - * by GeoServer. - * TODO: remove GeoJSONCRSCode when http://jira.codehaus.org/browse/GEOS-5996 - * is fixed and widely deployed. - * @constructor - */ -var GeoJSONCRSCode = function() {}; - - -/** - * TODO: remove this when http://jira.codehaus.org/browse/GEOS-5996 is fixed - * and widely deployed. - * @type {string} - */ -GeoJSONCRSCode.prototype.code; - - - /** * @constructor */ diff --git a/src/ol/format/geojson.js b/src/ol/format/geojson.js index f3f18e386c..5aa20b86de 100644 --- a/src/ol/format/geojson.js +++ b/src/ol/format/geojson.js @@ -457,12 +457,6 @@ ol.format.GeoJSON.prototype.readProjectionFromObject = function(object) { if (crs) { if (crs.type == 'name') { projection = ol.proj.get(crs.properties.name); - } else if (crs.type == 'EPSG') { - // 'EPSG' is not part of the GeoJSON specification, but is generated by - // GeoServer. - // TODO: remove this when http://jira.codehaus.org/browse/GEOS-5996 - // is fixed and widely deployed. - projection = ol.proj.get('EPSG:' + crs.properties.code); } else { ol.asserts.assert(false, 36); // Unknown SRS type } diff --git a/test/spec/ol/format/geojson.test.js b/test/spec/ol/format/geojson.test.js index 488bc80298..89425ad744 100644 --- a/test/spec/ol/format/geojson.test.js +++ b/test/spec/ol/format/geojson.test.js @@ -1,5 +1,3 @@ - - goog.require('ol.Feature'); goog.require('ol.extent'); goog.require('ol.format.GeoJSON'); @@ -520,20 +518,6 @@ describe('ol.format.GeoJSON', function() { }); - it('can read out-of-specification CRS generated by GeoServer', function() { - // TODO: remove this when http://jira.codehaus.org/browse/GEOS-5996 - // is fixed and widely deployed. - var json = { - crs: { - type: 'EPSG', - properties: { - code: '4326' - } - } - }; - expect(format.readProjection(json)).to.be(ol.proj.get('EPSG:4326')); - }); - }); describe('#writeFeatures', function() {