Rename "adaptOptionsWithDefaultDataProjection"

This commit is contained in:
tsauerwein
2014-08-21 11:39:01 +02:00
parent b30ed6b934
commit 939e167c0b
5 changed files with 18 additions and 38 deletions

View File

@@ -50,18 +50,20 @@ ol.format.Feature.prototype.getReadOptions = function(
featureProjection: opt_options.featureProjection featureProjection: opt_options.featureProjection
}; };
} }
return this.adaptOptionsWithDefaultDataProjection(options); return this.adaptOptions(options);
}; };
/** /**
* Sets the `defaultDataProjection` on the options, if no `dataProjection`
* is set.
* @param {olx.format.WriteOptions|olx.format.ReadOptions|undefined} options * @param {olx.format.WriteOptions|olx.format.ReadOptions|undefined} options
* Options. * Options.
* @protected * @protected
* @return {olx.format.WriteOptions|olx.format.ReadOptions|undefined} * @return {olx.format.WriteOptions|olx.format.ReadOptions|undefined}
* Updated options. * Updated options.
*/ */
ol.format.Feature.prototype.adaptOptionsWithDefaultDataProjection = function( ol.format.Feature.prototype.adaptOptions = function(
options) { options) {
var updatedOptions; var updatedOptions;
if (goog.isDef(options)) { if (goog.isDef(options)) {

View File

@@ -128,9 +128,7 @@ ol.format.JSONFeature.prototype.readProjectionFromObject = goog.abstractMethod;
* @inheritDoc * @inheritDoc
*/ */
ol.format.JSONFeature.prototype.writeFeature = function(feature, opt_options) { ol.format.JSONFeature.prototype.writeFeature = function(feature, opt_options) {
return this.writeFeatureObject( return this.writeFeatureObject(feature, this.adaptOptions(opt_options));
feature,
this.adaptOptionsWithDefaultDataProjection(opt_options));
}; };
@@ -148,9 +146,7 @@ ol.format.JSONFeature.prototype.writeFeatureObject = goog.abstractMethod;
*/ */
ol.format.JSONFeature.prototype.writeFeatures = function( ol.format.JSONFeature.prototype.writeFeatures = function(
features, opt_options) { features, opt_options) {
return this.writeFeaturesObject( return this.writeFeaturesObject(features, this.adaptOptions(opt_options));
features,
this.adaptOptionsWithDefaultDataProjection(opt_options));
}; };
@@ -168,9 +164,7 @@ ol.format.JSONFeature.prototype.writeFeaturesObject = goog.abstractMethod;
*/ */
ol.format.JSONFeature.prototype.writeGeometry = function( ol.format.JSONFeature.prototype.writeGeometry = function(
geometry, opt_options) { geometry, opt_options) {
return this.writeGeometryObject( return this.writeGeometryObject(geometry, this.adaptOptions(opt_options));
geometry,
this.adaptOptionsWithDefaultDataProjection(opt_options));
}; };

View File

@@ -317,7 +317,7 @@ ol.format.Polyline.prototype.readGeometryFromText =
return /** @type {ol.geom.Geometry} */ ( return /** @type {ol.geom.Geometry} */ (
ol.format.Feature.transformWithOptions( ol.format.Feature.transformWithOptions(
new ol.geom.LineString(coordinates), false, new ol.geom.LineString(coordinates), false,
this.adaptOptionsWithDefaultDataProjection(opt_options))); this.adaptOptions(opt_options)));
}; };
@@ -384,8 +384,7 @@ ol.format.Polyline.prototype.writeGeometryText =
goog.asserts.assertInstanceof(geometry, ol.geom.LineString); goog.asserts.assertInstanceof(geometry, ol.geom.LineString);
geometry = /** @type {ol.geom.LineString} */ geometry = /** @type {ol.geom.LineString} */
(ol.format.Feature.transformWithOptions( (ol.format.Feature.transformWithOptions(
geometry, true, geometry, true, this.adaptOptions(opt_options)));
this.adaptOptionsWithDefaultDataProjection(opt_options)));
var flatCoordinates = geometry.getFlatCoordinates(); var flatCoordinates = geometry.getFlatCoordinates();
var stride = geometry.getStride(); var stride = geometry.getStride();
return ol.format.Polyline.encodeDeltas(flatCoordinates, stride, this.factor_); return ol.format.Polyline.encodeDeltas(flatCoordinates, stride, this.factor_);

View File

@@ -49,8 +49,7 @@ ol.format.TextFeature.prototype.getType = function() {
*/ */
ol.format.TextFeature.prototype.readFeature = function(source, opt_options) { ol.format.TextFeature.prototype.readFeature = function(source, opt_options) {
return this.readFeatureFromText( return this.readFeatureFromText(
this.getText_(source), this.getText_(source), this.adaptOptions(opt_options));
this.adaptOptionsWithDefaultDataProjection(opt_options));
}; };
@@ -68,8 +67,7 @@ ol.format.TextFeature.prototype.readFeatureFromText = goog.abstractMethod;
*/ */
ol.format.TextFeature.prototype.readFeatures = function(source, opt_options) { ol.format.TextFeature.prototype.readFeatures = function(source, opt_options) {
return this.readFeaturesFromText( return this.readFeaturesFromText(
this.getText_(source), this.getText_(source), this.adaptOptions(opt_options));
this.adaptOptionsWithDefaultDataProjection(opt_options));
}; };
@@ -87,8 +85,7 @@ ol.format.TextFeature.prototype.readFeaturesFromText = goog.abstractMethod;
*/ */
ol.format.TextFeature.prototype.readGeometry = function(source, opt_options) { ol.format.TextFeature.prototype.readGeometry = function(source, opt_options) {
return this.readGeometryFromText( return this.readGeometryFromText(
this.getText_(source), this.getText_(source), this.adaptOptions(opt_options));
this.adaptOptionsWithDefaultDataProjection(opt_options));
}; };
@@ -121,9 +118,7 @@ ol.format.TextFeature.prototype.readProjectionFromText = goog.abstractMethod;
* @inheritDoc * @inheritDoc
*/ */
ol.format.TextFeature.prototype.writeFeature = function(feature, opt_options) { ol.format.TextFeature.prototype.writeFeature = function(feature, opt_options) {
return this.writeFeatureText( return this.writeFeatureText(feature, this.adaptOptions(opt_options));
feature,
this.adaptOptionsWithDefaultDataProjection(opt_options));
}; };
@@ -141,9 +136,7 @@ ol.format.TextFeature.prototype.writeFeatureText = goog.abstractMethod;
*/ */
ol.format.TextFeature.prototype.writeFeatures = function( ol.format.TextFeature.prototype.writeFeatures = function(
features, opt_options) { features, opt_options) {
return this.writeFeaturesText( return this.writeFeaturesText(features, this.adaptOptions(opt_options));
features,
this.adaptOptionsWithDefaultDataProjection(opt_options));
}; };
@@ -161,9 +154,7 @@ ol.format.TextFeature.prototype.writeFeaturesText = goog.abstractMethod;
*/ */
ol.format.TextFeature.prototype.writeGeometry = function( ol.format.TextFeature.prototype.writeGeometry = function(
geometry, opt_options) { geometry, opt_options) {
return this.writeGeometryText( return this.writeGeometryText(geometry, this.adaptOptions(opt_options));
geometry,
this.adaptOptionsWithDefaultDataProjection(opt_options));
}; };

View File

@@ -199,9 +199,7 @@ ol.format.XMLFeature.prototype.readProjectionFromNode = goog.abstractMethod;
* @inheritDoc * @inheritDoc
*/ */
ol.format.XMLFeature.prototype.writeFeature = function(feature, opt_options) { ol.format.XMLFeature.prototype.writeFeature = function(feature, opt_options) {
return this.writeFeatureNode( return this.writeFeatureNode(feature, this.adaptOptions(opt_options));
feature,
this.adaptOptionsWithDefaultDataProjection(opt_options));
}; };
@@ -218,9 +216,7 @@ ol.format.XMLFeature.prototype.writeFeatureNode = goog.abstractMethod;
* @inheritDoc * @inheritDoc
*/ */
ol.format.XMLFeature.prototype.writeFeatures = function(features, opt_options) { ol.format.XMLFeature.prototype.writeFeatures = function(features, opt_options) {
return this.writeFeaturesNode( return this.writeFeaturesNode(features, this.adaptOptions(opt_options));
features,
this.adaptOptionsWithDefaultDataProjection(opt_options));
}; };
@@ -237,9 +233,7 @@ ol.format.XMLFeature.prototype.writeFeaturesNode = goog.abstractMethod;
* @inheritDoc * @inheritDoc
*/ */
ol.format.XMLFeature.prototype.writeGeometry = function(geometry, opt_options) { ol.format.XMLFeature.prototype.writeGeometry = function(geometry, opt_options) {
return this.writeGeometryNode( return this.writeGeometryNode(geometry, this.adaptOptions(opt_options));
geometry,
this.adaptOptionsWithDefaultDataProjection(opt_options));
}; };