Fix the calls of .transform in internal code. It should be .doTransform.
This commit is contained in:
@@ -53,7 +53,7 @@ ol.Bounds.prototype.setProjection = function(projection) {
|
||||
ol.Bounds.prototype.intersects = function(bounds) {
|
||||
var otherProj = bounds.getProjection();
|
||||
if (!goog.isNull(otherProj) && !goog.isNull(this.projection_)) {
|
||||
bounds = bounds.transform(this.projection_);
|
||||
bounds = bounds.doTransform(this.projection_);
|
||||
}
|
||||
return goog.base(this, "intersects", bounds.toUnreferencedBounds());
|
||||
};
|
||||
@@ -70,13 +70,13 @@ ol.Bounds.prototype.doTransform = function(proj) {
|
||||
throw new Error("Bounds must have a projection before transforming.");
|
||||
}
|
||||
var tl = new ol.Loc(
|
||||
this.minX_, this.maxY_, undefined, this.projection_).transform(proj);
|
||||
this.minX_, this.maxY_, undefined, this.projection_).doTransform(proj);
|
||||
var tr = new ol.Loc(
|
||||
this.maxX_, this.maxY_, undefined, this.projection_).transform(proj);
|
||||
this.maxX_, this.maxY_, undefined, this.projection_).doTransform(proj);
|
||||
var bl = new ol.Loc(
|
||||
this.minX_, this.minY_, undefined, this.projection_).transform(proj);
|
||||
this.minX_, this.minY_, undefined, this.projection_).doTransform(proj);
|
||||
var br = new ol.Loc(
|
||||
this.maxX_, this.minY_, undefined, this.projection_).transform(proj);
|
||||
this.maxX_, this.minY_, undefined, this.projection_).doTransform(proj);
|
||||
|
||||
var x = [tl.getX(), tr.getX(), bl.getX(), br.getX()].sort();
|
||||
var y = [tl.getY(), tr.getY(), bl.getY(), br.getY()].sort();
|
||||
|
||||
@@ -143,7 +143,7 @@ ol.Map.DEFAULT_CONTROLS = ["navigation"];
|
||||
*/
|
||||
ol.Map.prototype.getCenter = function() {
|
||||
var proj = this.getUserProjection();
|
||||
return this.center_.transform(proj);
|
||||
return this.center_.doTransform(proj);
|
||||
};
|
||||
|
||||
|
||||
@@ -271,7 +271,7 @@ ol.Map.prototype.setCenter = function(center) {
|
||||
proj = this.getUserProjection();
|
||||
center.setProjection(proj);
|
||||
}
|
||||
this.center_ = center.transform(this.getProjection());
|
||||
this.center_ = center.doTransform(this.getProjection());
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user