Merge pull request #8281 from gberaudo/rename_default_data_projection
Rename default data projection
This commit is contained in:
@@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
### Next release
|
### Next release
|
||||||
|
|
||||||
|
#### Renaming of the `defaultDataProjection` in the options and property of the `ol/format/Feature` class and its subclasses
|
||||||
|
|
||||||
|
The `defaultDataProjection` option is now named `dataProjection`. The protected property available on the class is also renamed.
|
||||||
|
|
||||||
#### `transition` option of `ol/source/VectorTile` is ignored
|
#### `transition` option of `ol/source/VectorTile` is ignored
|
||||||
|
|
||||||
The `transition` option to get an opacity transition to fade in tiles has been disabled for `ol/source/VectorTile`. Vector tiles are now always rendered without an opacity transition.
|
The `transition` option to get an opacity transition to fade in tiles has been disabled for `ol/source/VectorTile`. Vector tiles are now always rendered without an opacity transition.
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import {get as getProjection, equivalent as equivalentProjection, transformExten
|
|||||||
* @typedef {Object} ReadOptions
|
* @typedef {Object} ReadOptions
|
||||||
* @property {module:ol/proj~ProjectionLike} dataProjection Projection of the data we are reading.
|
* @property {module:ol/proj~ProjectionLike} dataProjection Projection of the data we are reading.
|
||||||
* If not provided, the projection will be derived from the data (where possible) or
|
* If not provided, the projection will be derived from the data (where possible) or
|
||||||
* the `defaultDataProjection` of the format is assigned (where set). If the projection
|
* the `dataProjection` of the format is assigned (where set). If the projection
|
||||||
* can not be derived from the data and if no `defaultDataProjection` is set for a format,
|
* can not be derived from the data and if no `dataProjection` is set for a format,
|
||||||
* the features will not be reprojected.
|
* the features will not be reprojected.
|
||||||
* @property {module:ol/extent~Extent} extent Tile extent of the tile being read. This is only used and
|
* @property {module:ol/extent~Extent} extent Tile extent of the tile being read. This is only used and
|
||||||
* required for {@link module:ol/format/MVT}.
|
* required for {@link module:ol/format/MVT}.
|
||||||
@@ -24,8 +24,8 @@ import {get as getProjection, equivalent as equivalentProjection, transformExten
|
|||||||
/**
|
/**
|
||||||
* @typedef {Object} WriteOptions
|
* @typedef {Object} WriteOptions
|
||||||
* @property {module:ol/proj~ProjectionLike} dataProjection Projection of the data we are writing.
|
* @property {module:ol/proj~ProjectionLike} dataProjection Projection of the data we are writing.
|
||||||
* If not provided, the `defaultDataProjection` of the format is assigned (where set).
|
* If not provided, the `dataProjection` of the format is assigned (where set).
|
||||||
* If no `defaultDataProjection` is set for a format, the features will be returned
|
* If no `dataProjection` is set for a format, the features will be returned
|
||||||
* in the `featureProjection`.
|
* in the `featureProjection`.
|
||||||
* @property {module:ol/proj~ProjectionLike} featureProjection Projection of the feature geometries
|
* @property {module:ol/proj~ProjectionLike} featureProjection Projection of the feature geometries
|
||||||
* that will be serialized by the format writer. If not provided, geometries are assumed
|
* that will be serialized by the format writer. If not provided, geometries are assumed
|
||||||
@@ -66,7 +66,7 @@ const FeatureFormat = function() {
|
|||||||
* @protected
|
* @protected
|
||||||
* @type {module:ol/proj/Projection}
|
* @type {module:ol/proj/Projection}
|
||||||
*/
|
*/
|
||||||
this.defaultDataProjection = null;
|
this.dataProjection = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
@@ -98,7 +98,7 @@ FeatureFormat.prototype.getReadOptions = function(source, opt_options) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the `defaultDataProjection` on the options, if no `dataProjection`
|
* Sets the `dataProjection` on the options, if no `dataProjection`
|
||||||
* is set.
|
* is set.
|
||||||
* @param {module:ol/format/Feature~WriteOptions|module:ol/format/Feature~ReadOptions|undefined} options
|
* @param {module:ol/format/Feature~WriteOptions|module:ol/format/Feature~ReadOptions|undefined} options
|
||||||
* Options.
|
* Options.
|
||||||
@@ -108,7 +108,7 @@ FeatureFormat.prototype.getReadOptions = function(source, opt_options) {
|
|||||||
*/
|
*/
|
||||||
FeatureFormat.prototype.adaptOptions = function(options) {
|
FeatureFormat.prototype.adaptOptions = function(options) {
|
||||||
return assign({
|
return assign({
|
||||||
dataProjection: this.defaultDataProjection,
|
dataProjection: this.dataProjection,
|
||||||
featureProjection: this.defaultFeatureProjection
|
featureProjection: this.defaultFeatureProjection
|
||||||
}, options);
|
}, options);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ const GPX = function(opt_options) {
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
this.defaultDataProjection = getProjection('EPSG:4326');
|
this.dataProjection = getProjection('EPSG:4326');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {function(module:ol/Feature, Node)|undefined}
|
* @type {function(module:ol/Feature, Node)|undefined}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import {get as getProjection} from '../proj.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {module:ol/proj~ProjectionLike} [defaultDataProjection='EPSG:4326'] Default data projection.
|
* @property {module:ol/proj~ProjectionLike} [dataProjection='EPSG:4326'] Default data projection.
|
||||||
* @property {module:ol/proj~ProjectionLike} [featureProjection] Projection for features read or
|
* @property {module:ol/proj~ProjectionLike} [featureProjection] Projection for features read or
|
||||||
* written by the format. Options passed to read or write methods will take precedence.
|
* written by the format. Options passed to read or write methods will take precedence.
|
||||||
* @property {string} [geometryName] Geometry name to use when creating features.
|
* @property {string} [geometryName] Geometry name to use when creating features.
|
||||||
@@ -51,10 +51,9 @@ const GeoJSON = function(opt_options) {
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
this.defaultDataProjection = getProjection(
|
this.dataProjection = getProjection(
|
||||||
options.defaultDataProjection ?
|
options.dataProjection ?
|
||||||
options.defaultDataProjection : 'EPSG:4326');
|
options.dataProjection : 'EPSG:4326');
|
||||||
|
|
||||||
|
|
||||||
if (options.featureProjection) {
|
if (options.featureProjection) {
|
||||||
this.defaultFeatureProjection = getProjection(options.featureProjection);
|
this.defaultFeatureProjection = getProjection(options.featureProjection);
|
||||||
@@ -456,7 +455,7 @@ GeoJSON.prototype.readProjectionFromObject = function(object) {
|
|||||||
assert(false, 36); // Unknown SRS type
|
assert(false, 36); // Unknown SRS type
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
projection = this.defaultDataProjection;
|
projection = this.dataProjection;
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
/** @type {module:ol/proj/Projection} */ (projection)
|
/** @type {module:ol/proj/Projection} */ (projection)
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ const IGC = function(opt_options) {
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
this.defaultDataProjection = getProjection('EPSG:4326');
|
this.dataProjection = getProjection('EPSG:4326');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
|
|||||||
@@ -272,7 +272,7 @@ const KML = function(opt_options) {
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
this.defaultDataProjection = getProjection('EPSG:4326');
|
this.dataProjection = getProjection('EPSG:4326');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ const MVT = function(opt_options) {
|
|||||||
/**
|
/**
|
||||||
* @type {module:ol/proj/Projection}
|
* @type {module:ol/proj/Projection}
|
||||||
*/
|
*/
|
||||||
this.defaultDataProjection = new Projection({
|
this.dataProjection = new Projection({
|
||||||
code: '',
|
code: '',
|
||||||
units: Units.TILE_PIXELS
|
units: Units.TILE_PIXELS
|
||||||
});
|
});
|
||||||
@@ -411,7 +411,7 @@ MVT.prototype.readFeatures = function(source, opt_options) {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
MVT.prototype.readProjection = function(source) {
|
MVT.prototype.readProjection = function(source) {
|
||||||
return this.defaultDataProjection;
|
return this.dataProjection;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ const OSMXML = function() {
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
this.defaultDataProjection = getProjection('EPSG:4326');
|
this.dataProjection = getProjection('EPSG:4326');
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(OSMXML, XMLFeature);
|
inherits(OSMXML, XMLFeature);
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ const Polyline = function(opt_options) {
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
this.defaultDataProjection = getProjection('EPSG:4326');
|
this.dataProjection = getProjection('EPSG:4326');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ TextFeature.prototype.readProjection = function(source) {
|
|||||||
* @return {module:ol/proj/Projection} Projection.
|
* @return {module:ol/proj/Projection} Projection.
|
||||||
*/
|
*/
|
||||||
TextFeature.prototype.readProjectionFromText = function(text) {
|
TextFeature.prototype.readProjectionFromText = function(text) {
|
||||||
return this.defaultDataProjection;
|
return this.dataProjection;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import {get as getProjection} from '../proj.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {module:ol/proj~ProjectionLike} [defaultDataProjection='EPSG:4326'] Default data projection.
|
* @property {module:ol/proj~ProjectionLike} [dataProjection='EPSG:4326'] Default data projection.
|
||||||
* @property {string} [layerName] Set the name of the TopoJSON topology
|
* @property {string} [layerName] Set the name of the TopoJSON topology
|
||||||
* `objects`'s children as feature property with the specified name. This means
|
* `objects`'s children as feature property with the specified name. This means
|
||||||
* that when set to `'layer'`, a topology like
|
* that when set to `'layer'`, a topology like
|
||||||
@@ -69,9 +69,9 @@ const TopoJSON = function(opt_options) {
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
this.defaultDataProjection = getProjection(
|
this.dataProjection = getProjection(
|
||||||
options.defaultDataProjection ?
|
options.dataProjection ?
|
||||||
options.defaultDataProjection : 'EPSG:4326');
|
options.dataProjection : 'EPSG:4326');
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -416,7 +416,7 @@ TopoJSON.prototype.readProjection;
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
TopoJSON.prototype.readProjectionFromObject = function(object) {
|
TopoJSON.prototype.readProjectionFromObject = function(object) {
|
||||||
return this.defaultDataProjection;
|
return this.dataProjection;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ XMLFeature.prototype.readProjection = function(source) {
|
|||||||
* @return {module:ol/proj/Projection} Projection.
|
* @return {module:ol/proj/Projection} Projection.
|
||||||
*/
|
*/
|
||||||
XMLFeature.prototype.readProjectionFromDocument = function(doc) {
|
XMLFeature.prototype.readProjectionFromDocument = function(doc) {
|
||||||
return this.defaultDataProjection;
|
return this.dataProjection;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -200,7 +200,7 @@ XMLFeature.prototype.readProjectionFromDocument = function(doc) {
|
|||||||
* @return {module:ol/proj/Projection} Projection.
|
* @return {module:ol/proj/Projection} Projection.
|
||||||
*/
|
*/
|
||||||
XMLFeature.prototype.readProjectionFromNode = function(node) {
|
XMLFeature.prototype.readProjectionFromNode = function(node) {
|
||||||
return this.defaultDataProjection;
|
return this.dataProjection;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ inherits(VectorSourceEvent, Event);
|
|||||||
* during parsing. If your remote data source does not advertise its projection
|
* during parsing. If your remote data source does not advertise its projection
|
||||||
* properly, this transformation will be incorrect. For some formats, the
|
* properly, this transformation will be incorrect. For some formats, the
|
||||||
* default projection (usually EPSG:4326) can be overridden by setting the
|
* default projection (usually EPSG:4326) can be overridden by setting the
|
||||||
* defaultDataProjection constructor option on the format.
|
* dataProjection constructor option on the format.
|
||||||
* Note that if a source contains non-feature data, such as a GeoJSON geometry
|
* Note that if a source contains non-feature data, such as a GeoJSON geometry
|
||||||
* or a KML NetworkLink, these will be ignored. Use a custom loader to load these.
|
* or a KML NetworkLink, these will be ignored. Use a custom loader to load these.
|
||||||
* @property {boolean} [useSpatialIndex=true]
|
* @property {boolean} [useSpatialIndex=true]
|
||||||
|
|||||||
Reference in New Issue
Block a user