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