From 8eb3e55aa060eca170369cd075e15012b3d31bba Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Wed, 9 Mar 2016 11:55:05 +0100 Subject: [PATCH] Remove use of goog.math.Size --- src/ol/control/overviewmapcontrol.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ol/control/overviewmapcontrol.js b/src/ol/control/overviewmapcontrol.js index 0abd7dd7ab..19f402ac52 100644 --- a/src/ol/control/overviewmapcontrol.js +++ b/src/ol/control/overviewmapcontrol.js @@ -282,17 +282,17 @@ ol.control.OverviewMap.prototype.validateExtent_ = function() { ovmap.getPixelFromCoordinate(ol.extent.getTopLeft(extent)); var bottomRightPixel = ovmap.getPixelFromCoordinate(ol.extent.getBottomRight(extent)); - var boxSize = new goog.math.Size( - Math.abs(topLeftPixel[0] - bottomRightPixel[0]), - Math.abs(topLeftPixel[1] - bottomRightPixel[1])); + + var boxWidth = Math.abs(topLeftPixel[0] - bottomRightPixel[0]); + var boxHeight = Math.abs(topLeftPixel[1] - bottomRightPixel[1]); var ovmapWidth = ovmapSize[0]; var ovmapHeight = ovmapSize[1]; - if (boxSize.width < ovmapWidth * ol.OVERVIEWMAP_MIN_RATIO || - boxSize.height < ovmapHeight * ol.OVERVIEWMAP_MIN_RATIO || - boxSize.width > ovmapWidth * ol.OVERVIEWMAP_MAX_RATIO || - boxSize.height > ovmapHeight * ol.OVERVIEWMAP_MAX_RATIO) { + if (boxWidth < ovmapWidth * ol.OVERVIEWMAP_MIN_RATIO || + boxHeight < ovmapHeight * ol.OVERVIEWMAP_MIN_RATIO || + boxWidth > ovmapWidth * ol.OVERVIEWMAP_MAX_RATIO || + boxHeight > ovmapHeight * ol.OVERVIEWMAP_MAX_RATIO) { this.resetExtent_(); } else if (!ol.extent.containsExtent(ovextent, extent)) { this.recenter_();