Rename transform to applyTransform for geometries
This commit is contained in:
@@ -187,7 +187,7 @@ ol.Geolocation.prototype.positionChange_ = function(position) {
|
|||||||
this.set(ol.GeolocationProperty.SPEED,
|
this.set(ol.GeolocationProperty.SPEED,
|
||||||
goog.isNull(coords.speed) ? undefined : coords.speed);
|
goog.isNull(coords.speed) ? undefined : coords.speed);
|
||||||
var geometry = ol.sphere.WGS84.circle(this.position_, coords.accuracy);
|
var geometry = ol.sphere.WGS84.circle(this.position_, coords.accuracy);
|
||||||
geometry.transform(this.transform_);
|
geometry.applyTransform(this.transform_);
|
||||||
this.set(ol.GeolocationProperty.ACCURACY_GEOMETRY, geometry);
|
this.set(ol.GeolocationProperty.ACCURACY_GEOMETRY, geometry);
|
||||||
this.dispatchChangeEvent();
|
this.dispatchChangeEvent();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -217,4 +217,4 @@ ol.geom.Circle.prototype.setRadius = function(radius) {
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.geom.Circle.prototype.transform = goog.abstractMethod;
|
ol.geom.Circle.prototype.applyTransform = goog.abstractMethod;
|
||||||
|
|||||||
@@ -159,10 +159,11 @@ ol.geom.Geometry.prototype.getType = goog.abstractMethod;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Apply a transform function to the geometry. Modifies the geometry in place.
|
||||||
* @function
|
* @function
|
||||||
* @param {ol.TransformFunction} transformFn Transform.
|
* @param {ol.TransformFunction} transformFn Transform.
|
||||||
*/
|
*/
|
||||||
ol.geom.Geometry.prototype.transform = goog.abstractMethod;
|
ol.geom.Geometry.prototype.applyTransform = goog.abstractMethod;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -247,11 +247,11 @@ ol.geom.GeometryCollection.prototype.setGeometriesArray = function(geometries) {
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.geom.GeometryCollection.prototype.transform = function(transformFn) {
|
ol.geom.GeometryCollection.prototype.applyTransform = function(transformFn) {
|
||||||
var geometries = this.geometries_;
|
var geometries = this.geometries_;
|
||||||
var i, ii;
|
var i, ii;
|
||||||
for (i = 0, ii = geometries.length; i < ii; ++i) {
|
for (i = 0, ii = geometries.length; i < ii; ++i) {
|
||||||
geometries[i].transform(transformFn);
|
geometries[i].applyTransform(transformFn);
|
||||||
}
|
}
|
||||||
this.dispatchChangeEvent();
|
this.dispatchChangeEvent();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ ol.geom.SimpleGeometry.prototype.setLayout =
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @todo api
|
* @todo api
|
||||||
*/
|
*/
|
||||||
ol.geom.SimpleGeometry.prototype.transform = function(transformFn) {
|
ol.geom.SimpleGeometry.prototype.applyTransform = function(transformFn) {
|
||||||
if (!goog.isNull(this.flatCoordinates)) {
|
if (!goog.isNull(this.flatCoordinates)) {
|
||||||
transformFn(this.flatCoordinates, this.flatCoordinates, this.stride);
|
transformFn(this.flatCoordinates, this.flatCoordinates, this.stride);
|
||||||
this.dispatchChangeEvent();
|
this.dispatchChangeEvent();
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ ol.interaction.DragAndDrop.prototype.handleResult_ = function(file, result) {
|
|||||||
var feature = readFeatures[j];
|
var feature = readFeatures[j];
|
||||||
var geometry = feature.getGeometry();
|
var geometry = feature.getGeometry();
|
||||||
if (!goog.isNull(geometry)) {
|
if (!goog.isNull(geometry)) {
|
||||||
geometry.transform(transform);
|
geometry.applyTransform(transform);
|
||||||
}
|
}
|
||||||
features.push(feature);
|
features.push(feature);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ ol.source.FormatVector.prototype.readFeatures = function(source) {
|
|||||||
var feature = features[i];
|
var feature = features[i];
|
||||||
var geometry = feature.getGeometry();
|
var geometry = feature.getGeometry();
|
||||||
if (!goog.isNull(geometry)) {
|
if (!goog.isNull(geometry)) {
|
||||||
geometry.transform(transform);
|
geometry.applyTransform(transform);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ describe('ol.geom.Circle', function() {
|
|||||||
|
|
||||||
it('throws an exception', function() {
|
it('throws an exception', function() {
|
||||||
expect(function() {
|
expect(function() {
|
||||||
circle.transform(ol.proj.identityTransform);
|
circle.applyTransform(ol.proj.identityTransform);
|
||||||
}).to.throwException();
|
}).to.throwException();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user