Use ol.extent.getWidth and ol.extent.getHeight

This commit is contained in:
Frederic Junod
2014-04-15 10:09:25 +02:00
parent cb1edd262d
commit 663e7af0d2
5 changed files with 12 additions and 12 deletions
+2 -2
View File
@@ -283,8 +283,8 @@ goog.exportProperty(
* @return {number} Resolution.
*/
ol.View2D.prototype.getResolutionForExtent = function(extent, size) {
var xResolution = (extent[2] - extent[0]) / size[0];
var yResolution = (extent[3] - extent[1]) / size[1];
var xResolution = ol.extent.getWidth(extent) / size[0];
var yResolution = ol.extent.getHeight(extent) / size[1];
return Math.max(xResolution, yResolution);
};