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) 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@6572 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2008-03-21 17:31:58 +00:00
parent cc8f3d2319
commit 03fc6aacd4
2 changed files with 25 additions and 1 deletions

View File

@@ -110,7 +110,9 @@ OpenLayers.Layer.FixedZoomLevels = OpenLayers.Class({
for(var i= this.minZoomLevel; i <= this.maxZoomLevel; i++) {
this.resolutions[resolutionsIndex++] = this.RESOLUTIONS[i];
}
}
this.maxResolution = this.resolutions[0];
this.minResolution = this.resolutions[this.resolutions.length - 1];
}
},
/**

View File

@@ -215,6 +215,28 @@
window.location.host);
}
}
function test_02_Layer_Google_isBaseLayer (t) {
if(validkey) {
t.plan(3);
var map = new OpenLayers.Map( 'map' ,
{ controls: [] , 'numZoomLevels':20});
var satellite = new OpenLayers.Layer.Google( "Google Satellite" , {type: G_SATELLITE_MAP, 'maxZoomLevel':18} );
map.addLayers([satellite]);
map.zoomToMaxExtent();
t.eq(satellite.div.style.display, "", "Satellite layer is visible.");
satellite.setVisibility(false);
t.eq(satellite.div.style.display, "none", "Satellite layer is not visible.");
satellite.setVisibility(true);
t.eq(satellite.div.style.display, "block", "Satellite layer is visible.");
} else {
t.plan(0);
t.debug_print("Google tests can't be run from " +
window.location.host);
}
}
</script>
</head>