Add export for ol.proj.METERS_PER_UNIT

This commit is contained in:
Bart van den Eijnden
2014-01-30 10:19:26 +01:00
parent 61ed9a106c
commit 1ada9dfea5
5 changed files with 15 additions and 10 deletions
+3 -2
View File
@@ -16,6 +16,7 @@ goog.require('ol.View');
goog.require('ol.coordinate');
goog.require('ol.extent');
goog.require('ol.proj');
goog.require('ol.proj.METERS_PER_UNIT');
goog.require('ol.proj.Projection');
goog.require('ol.proj.Units');
@@ -544,8 +545,8 @@ ol.View2D.createResolutionConstraint_ = function(options) {
.getExtent();
var size = goog.isNull(projectionExtent) ?
// use an extent that can fit the whole world if need be
360 * ol.METERS_PER_UNIT[ol.proj.Units.DEGREES] /
ol.METERS_PER_UNIT[projection.getUnits()] :
360 * ol.proj.METERS_PER_UNIT[ol.proj.Units.DEGREES] /
ol.proj.METERS_PER_UNIT[projection.getUnits()] :
Math.max(projectionExtent[2] - projectionExtent[0],
projectionExtent[3] - projectionExtent[1]);
maxResolution = size / ol.DEFAULT_TILE_SIZE;