For now, we require a projection on loc internally.
This commit is contained in:
@@ -329,7 +329,8 @@ ol.Map.prototype.setZoom = function(zoom, opt_anchor) {
|
||||
newRes = this.getResolutionForZoom(newZoom);
|
||||
newCenter = new ol.Loc(
|
||||
anchorLoc.getX() + (size.width/2 - opt_anchor.x) * newRes,
|
||||
anchorLoc.getY() - (size.height/2 - opt_anchor.y) * newRes
|
||||
anchorLoc.getY() - (size.height/2 - opt_anchor.y) * newRes,
|
||||
undefined, this.getProjection()
|
||||
);
|
||||
} else {
|
||||
newCenter = this.center_;
|
||||
|
||||
@@ -91,7 +91,8 @@ ol.renderer.MapRenderer.prototype.getLocForPixel = function(pixel) {
|
||||
size = goog.style.getSize(this.container_);
|
||||
return new ol.Loc(
|
||||
center.getX() - (size.width/2 - pixel.x)*resolution,
|
||||
center.getY() + (size.height/2 - pixel.y)*resolution
|
||||
center.getY() + (size.height/2 - pixel.y)*resolution,
|
||||
undefined, this.renderedCenter_.getProjection()
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user