From ab4f69ac4857332ab080cdb33ecc67b1a36f6dd0 Mon Sep 17 00:00:00 2001 From: euzuro Date: Thu, 5 Oct 2006 17:08:27 +0000 Subject: [PATCH] special cased inRange() to return true if getResolution() returns null -- this way we get through and actually do load 3rd party layers. git-svn-id: http://svn.openlayers.org/trunk/openlayers@1598 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Layer/FixedZoomLevels.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/OpenLayers/Layer/FixedZoomLevels.js b/lib/OpenLayers/Layer/FixedZoomLevels.js index 7907d34aea..628500c3db 100644 --- a/lib/OpenLayers/Layer/FixedZoomLevels.js +++ b/lib/OpenLayers/Layer/FixedZoomLevels.js @@ -88,6 +88,26 @@ OpenLayers.Layer.FixedZoomLevels.prototype = { } return resolution; }, + + /** Overridden from OpenLayers.Layer because if the 3rd party tool has + * not been loaded (setcentered) yet, then its translation function + * will return null and therefore resolution will be null. In this case + * we want to return true so that the redraw will happen. + * + * @returns Whether or not the layer is displayable at the current map's + * current resolution + * @type Boolean + */ + inRange: function() { + var inRange = false; + if (this.map) { + var resolution = this.map.getResolution(); + inRange = ( (resolution == null) || + ( (resolution >= this.minResolution) && + (resolution <= this.maxResolution) ) ); + } + return inRange; + }, /** Calculates using px-> lonlat translation functions on tl and br * corners of viewport