Rename defaultDataProjection to dataProjection #8152

This commit is contained in:
ThomasG77
2018-05-03 21:12:41 +02:00
committed by Guillaume Beraudo
parent 6c538c12f6
commit cbaa9a7567
12 changed files with 28 additions and 29 deletions

View File

@@ -10,8 +10,8 @@ import {get as getProjection, equivalent as equivalentProjection, transformExten
* @typedef {Object} ReadOptions
* @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
* the `defaultDataProjection` 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,
* the `dataProjection` of the format is assigned (where set). If the projection
* can not be derived from the data and if no `dataProjection` is set for a format,
* the features will not be reprojected.
* @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}.
@@ -24,8 +24,8 @@ import {get as getProjection, equivalent as equivalentProjection, transformExten
/**
* @typedef {Object} WriteOptions
* @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 no `defaultDataProjection` is set for a format, the features will be returned
* If not provided, the `dataProjection` of the format is assigned (where set).
* If no `dataProjection` is set for a format, the features will be returned
* in the `featureProjection`.
* @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
@@ -66,7 +66,7 @@ const FeatureFormat = function() {
* @protected
* @type {module:ol/proj/Projection}
*/
this.defaultDataProjection = null;
this.dataProjection = null;
/**
* @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.
* @param {module:ol/format/Feature~WriteOptions|module:ol/format/Feature~ReadOptions|undefined} options
* Options.
@@ -108,7 +108,7 @@ FeatureFormat.prototype.getReadOptions = function(source, opt_options) {
*/
FeatureFormat.prototype.adaptOptions = function(options) {
return assign({
dataProjection: this.defaultDataProjection,
dataProjection: this.dataProjection,
featureProjection: this.defaultFeatureProjection
}, options);
};

View File

@@ -52,7 +52,7 @@ const GPX = function(opt_options) {
/**
* @inheritDoc
*/
this.defaultDataProjection = getProjection('EPSG:4326');
this.dataProjection = getProjection('EPSG:4326');
/**
* @type {function(module:ol/Feature, Node)|undefined}

View File

@@ -22,7 +22,7 @@ import {get as getProjection} from '../proj.js';
/**
* @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
* written by the format. Options passed to read or write methods will take precedence.
* @property {string} [geometryName] Geometry name to use when creating features.
@@ -51,10 +51,9 @@ const GeoJSON = function(opt_options) {
/**
* @inheritDoc
*/
this.defaultDataProjection = getProjection(
options.defaultDataProjection ?
options.defaultDataProjection : 'EPSG:4326');
this.dataProjection = getProjection(
options.dataProjection ?
options.dataProjection : 'EPSG:4326');
if (options.featureProjection) {
this.defaultFeatureProjection = getProjection(options.featureProjection);
@@ -456,7 +455,7 @@ GeoJSON.prototype.readProjectionFromObject = function(object) {
assert(false, 36); // Unknown SRS type
}
} else {
projection = this.defaultDataProjection;
projection = this.dataProjection;
}
return (
/** @type {module:ol/proj/Projection} */ (projection)

View File

@@ -45,7 +45,7 @@ const IGC = function(opt_options) {
/**
* @inheritDoc
*/
this.defaultDataProjection = getProjection('EPSG:4326');
this.dataProjection = getProjection('EPSG:4326');
/**
* @private

View File

@@ -272,7 +272,7 @@ const KML = function(opt_options) {
/**
* @inheritDoc
*/
this.defaultDataProjection = getProjection('EPSG:4326');
this.dataProjection = getProjection('EPSG:4326');
/**
* @private

View File

@@ -56,7 +56,7 @@ const MVT = function(opt_options) {
/**
* @type {module:ol/proj/Projection}
*/
this.defaultDataProjection = new Projection({
this.dataProjection = new Projection({
code: '',
units: Units.TILE_PIXELS
});
@@ -411,7 +411,7 @@ MVT.prototype.readFeatures = function(source, opt_options) {
* @api
*/
MVT.prototype.readProjection = function(source) {
return this.defaultDataProjection;
return this.dataProjection;
};

View File

@@ -30,7 +30,7 @@ const OSMXML = function() {
/**
* @inheritDoc
*/
this.defaultDataProjection = getProjection('EPSG:4326');
this.dataProjection = getProjection('EPSG:4326');
};
inherits(OSMXML, XMLFeature);

View File

@@ -41,7 +41,7 @@ const Polyline = function(opt_options) {
/**
* @inheritDoc
*/
this.defaultDataProjection = getProjection('EPSG:4326');
this.dataProjection = getProjection('EPSG:4326');
/**
* @private

View File

@@ -111,7 +111,7 @@ TextFeature.prototype.readProjection = function(source) {
* @return {module:ol/proj/Projection} Projection.
*/
TextFeature.prototype.readProjectionFromText = function(text) {
return this.defaultDataProjection;
return this.dataProjection;
};

View File

@@ -16,7 +16,7 @@ import {get as getProjection} from '../proj.js';
/**
* @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
* `objects`'s children as feature property with the specified name. This means
* that when set to `'layer'`, a topology like
@@ -69,9 +69,9 @@ const TopoJSON = function(opt_options) {
/**
* @inheritDoc
*/
this.defaultDataProjection = getProjection(
options.defaultDataProjection ?
options.defaultDataProjection : 'EPSG:4326');
this.dataProjection = getProjection(
options.dataProjection ?
options.dataProjection : 'EPSG:4326');
};
@@ -416,7 +416,7 @@ TopoJSON.prototype.readProjection;
* @inheritDoc
*/
TopoJSON.prototype.readProjectionFromObject = function(object) {
return this.defaultDataProjection;
return this.dataProjection;
};

View File

@@ -190,7 +190,7 @@ XMLFeature.prototype.readProjection = function(source) {
* @return {module:ol/proj/Projection} Projection.
*/
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.
*/
XMLFeature.prototype.readProjectionFromNode = function(node) {
return this.defaultDataProjection;
return this.dataProjection;
};

View File

@@ -122,7 +122,7 @@ inherits(VectorSourceEvent, Event);
* during parsing. If your remote data source does not advertise its projection
* properly, this transformation will be incorrect. For some formats, 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
* or a KML NetworkLink, these will be ignored. Use a custom loader to load these.
* @property {boolean} [useSpatialIndex=true]