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:
@@ -110,6 +110,8 @@ OpenLayers.Layer.FixedZoomLevels = OpenLayers.Class({
|
|||||||
for(var i= this.minZoomLevel; i <= this.maxZoomLevel; i++) {
|
for(var i= this.minZoomLevel; i <= this.maxZoomLevel; i++) {
|
||||||
this.resolutions[resolutionsIndex++] = this.RESOLUTIONS[i];
|
this.resolutions[resolutionsIndex++] = this.RESOLUTIONS[i];
|
||||||
}
|
}
|
||||||
|
this.maxResolution = this.resolutions[0];
|
||||||
|
this.minResolution = this.resolutions[this.resolutions.length - 1];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -215,6 +215,28 @@
|
|||||||
window.location.host);
|
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>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
Reference in New Issue
Block a user