From 9ea5b2aa316d15dca7c807cc7bb5318ccd49b707 Mon Sep 17 00:00:00 2001 From: crschmidt Date: Wed, 28 Jun 2006 02:21:30 +0000 Subject: [PATCH] This is needed to allow KaMap and WorldWind to work. It may need to be removed in cases where it's not appropriate, but prevents infinite loops in the meantime (I think). git-svn-id: http://svn.openlayers.org/trunk/openlayers@817 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Layer/Grid.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/OpenLayers/Layer/Grid.js b/lib/OpenLayers/Layer/Grid.js index 5b98147b32..06d2aab9ef 100644 --- a/lib/OpenLayers/Layer/Grid.js +++ b/lib/OpenLayers/Layer/Grid.js @@ -305,6 +305,17 @@ OpenLayers.Layer.Grid.prototype = Object.extend( new OpenLayers.Layer(), { addTile:function(bounds,position) { // Should be implemented by subclasses }, + + /** + * @returns Degrees per Pixel + * @type float + */ + getResolution: function() { + var maxRes = this.map.getMaxResolution(); + var zoom = this.map.getZoom(); + + return maxRes / Math.pow(2, zoom); + }, /** @final @type String */ CLASS_NAME: "OpenLayers.Grid"