Remove GeoJSON workaround for GeoServer
See #1569 See https://osgeo-org.atlassian.net/browse/GEOS-5996
This commit is contained in:
@@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
### Next Release
|
### 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`
|
#### 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.
|
`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.
|
||||||
|
|||||||
@@ -46,33 +46,11 @@ GeoJSONCRS.prototype.type;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: remove GeoJSONCRSCode when http://jira.codehaus.org/browse/GEOS-5996
|
* @type {!GeoJSONCRSName|!GeoJSONLink}
|
||||||
* is fixed and widely deployed.
|
|
||||||
* @type {!GeoJSONCRSCode|!GeoJSONCRSName|!GeoJSONLink}
|
|
||||||
*/
|
*/
|
||||||
GeoJSONCRS.prototype.properties;
|
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
|
* @constructor
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -457,12 +457,6 @@ ol.format.GeoJSON.prototype.readProjectionFromObject = function(object) {
|
|||||||
if (crs) {
|
if (crs) {
|
||||||
if (crs.type == 'name') {
|
if (crs.type == 'name') {
|
||||||
projection = ol.proj.get(crs.properties.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 {
|
} else {
|
||||||
ol.asserts.assert(false, 36); // Unknown SRS type
|
ol.asserts.assert(false, 36); // Unknown SRS type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
goog.require('ol.Feature');
|
goog.require('ol.Feature');
|
||||||
goog.require('ol.extent');
|
goog.require('ol.extent');
|
||||||
goog.require('ol.format.GeoJSON');
|
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() {
|
describe('#writeFeatures', function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user