OpenLayers OpenLayers

Changeset 6572

Show
Ignore:
Timestamp:
03/21/08 13:31:58 (5 months ago)
Author:
crschmidt
Message:

FixedZoomLevels subclassese don't propertly set min/max resolution, so
calculateInRange always returns false, so the layers can never be displayed
(due to recent code): Fix calculateInRange by setting min/max res. r=tschaub,
(Closes #1457)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Layer/FixedZoomLevels.js

    r5614 r6572  
    111111                this.resolutions[resolutionsIndex++] = this.RESOLUTIONS[i];             
    112112            } 
    113         }         
     113            this.maxResolution = this.resolutions[0]; 
     114            this.minResolution = this.resolutions[this.resolutions.length - 1]; 
     115        }        
    114116    }, 
    115117     
  • trunk/openlayers/tests/Layer/test_Google.html

    r5504 r6572  
    216216        } 
    217217    }     
     218    function test_02_Layer_Google_isBaseLayer (t) { 
     219        if(validkey) { 
     220            t.plan(3); 
     221            var map = new OpenLayers.Map( 'map' ,  
     222            { controls: [] , 'numZoomLevels':20}); 
     223     
     224            var satellite = new OpenLayers.Layer.Google( "Google Satellite" , {type: G_SATELLITE_MAP, 'maxZoomLevel':18} ); 
     225            map.addLayers([satellite]); 
     226            map.zoomToMaxExtent(); 
     227             
     228            t.eq(satellite.div.style.display, "", "Satellite layer is visible."); 
     229            satellite.setVisibility(false); 
     230            t.eq(satellite.div.style.display, "none", "Satellite layer is not visible."); 
     231            satellite.setVisibility(true); 
     232            t.eq(satellite.div.style.display, "block", "Satellite layer is visible."); 
     233             
     234        } else { 
     235            t.plan(0); 
     236            t.debug_print("Google tests can't be run from " + 
     237                          window.location.host); 
     238        } 
     239    }     
    218240 
    219241  </script>