Activating strategies after adding the layer to the map. r=elemoine (closes #1920)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@9266 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2009-04-10 21:59:57 +00:00
parent ddbf4b5222
commit e0faaf59d9
4 changed files with 33 additions and 0 deletions

View File

@@ -454,6 +454,21 @@
"(fractionalZoom true) returns resolution for zoom beyond res length - 1");
}
function test_afterAdd(t) {
t.plan(1);
var map = new OpenLayers.Map("map");
var layer = new OpenLayers.Layer(null, {isBaseLayer: true});
var hasBase = false;
layer.afterAdd = function() {
hasBase = !!(layer.map && layer.map.baseLayer);
}
map.addLayer(layer);
t.eq(hasBase, true, "when afterAdd is called, map has a base layer");
}