Differentiate between identity and clone transforms

This commit is contained in:
Tom Payne
2012-07-19 09:51:08 +02:00
parent 5ace389ccb
commit 43c32e6da7

View File

@@ -93,7 +93,7 @@ ol.Projection.addEquivalentProjections = function(projections) {
goog.array.forEach(projections, function(source) {
goog.array.forEach(projections, function(destination) {
ol.Projection.addTransform(
source, destination, ol.Projection.identityTransform);
source, destination, ol.Projection.cloneTransform);
});
});
};
@@ -181,7 +181,7 @@ ol.Projection.equivalent = function(projection1, projection2) {
return false;
} else {
var transform = ol.Projection.getTransform(projection1, projection2);
return transform === ol.Projection.identityTransform;
return transform === ol.Projection.cloneTransform;
}
};
@@ -219,6 +219,15 @@ ol.Projection.getTransformFromCodes = function(sourceCode, destinationCode) {
* @return {goog.math.Coordinate} Point.
*/
ol.Projection.identityTransform = function(point) {
return point;
};
/**
* @param {goog.math.Coordinate} point Point.
* @return {goog.math.Coordinate} Point.
*/
ol.Projection.cloneTransform = function(point) {
return point.clone();
};