Replace fitGeometry and fitExtent with fit

Fit accepts either a geometry or an extent.

This combines two previously distinct functions
into one more flexible call.

Also brings the rotations support and options
previously available to fitGeometry to extents
This commit is contained in:
vmalaret
2015-04-03 18:15:45 +02:00
committed by Bart van den Eijnden
parent 3021d3a6a7
commit 74759142d9
10 changed files with 43 additions and 46 deletions

View File

@@ -338,7 +338,7 @@ ol.control.OverviewMap.prototype.resetExtent_ = function() {
ol.OVERVIEWMAP_MAX_RATIO / ol.OVERVIEWMAP_MIN_RATIO) / Math.LN2;
var ratio = 1 / (Math.pow(2, steps / 2) * ol.OVERVIEWMAP_MIN_RATIO);
ol.extent.scaleFromCenter(extent, ratio);
ovview.fitExtent(extent, ovmapSize);
ovview.fit(extent, ovmapSize);
};