From 08ae509a7ffa6416e434c9fd08cc50988ccbe6aa Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Thu, 29 May 2014 11:21:31 -0600 Subject: [PATCH] Export method to get resolution for extent and size While this is straightforward to calculate, this method adds convenience. --- src/ol/view2d.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ol/view2d.js b/src/ol/view2d.js index bc0cdecabd..34cd1def9f 100644 --- a/src/ol/view2d.js +++ b/src/ol/view2d.js @@ -287,9 +287,12 @@ goog.exportProperty( /** + * Get the resolution for a provided extent (in map units) and size (in pixels). * @param {ol.Extent} extent Extent. * @param {ol.Size} size Box pixel size. - * @return {number} Resolution. + * @return {number} The resolution at which the provided extent will render at + * the given size. + * @todo api */ ol.View2D.prototype.getResolutionForExtent = function(extent, size) { var xResolution = ol.extent.getWidth(extent) / size[0];