Merge pull request #700 from elemoine/calculate-extent

Add and export View2D.calculateExtent
This commit is contained in:
Éric Lemoine
2013-05-10 03:57:24 -07:00
2 changed files with 4 additions and 2 deletions

View File

@@ -1,3 +1,4 @@
@exportClass ol.View2D ol.View2DOptions
@exportProperty ol.View2D.prototype.fitExtent
@exportProperty ol.View2D.prototype.calculateExtent
@exportProperty ol.View2D.prototype.getView2D

View File

@@ -1,5 +1,4 @@
// FIXME getView3D has not return type
// FIXME remove getExtent?
goog.provide('ol.View2D');
goog.provide('ol.View2DProperty');
@@ -167,10 +166,12 @@ goog.exportProperty(
/**
* Calculate the extent for the given size in pixels, the current
* resolution and the current center.
* @param {ol.Size} size Box pixel size.
* @return {ol.Extent} Extent.
*/
ol.View2D.prototype.getExtent = function(size) {
ol.View2D.prototype.calculateExtent = function(size) {
goog.asserts.assert(this.isDef());
var center = this.getCenter();
var resolution = this.getResolution();