add hook to trigger the drawing of a layer upon addition to the map (assuming a center has been set)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@895 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-07-06 02:20:06 +00:00
parent 90933052aa
commit 986eaaf7a4

View File

@@ -250,6 +250,12 @@ OpenLayers.Map.prototype = {
this.events.triggerEvent("addlayer");
//make sure layer draws itself!
if (this.center != null) {
var bounds = this.getExtent();
layer.moveTo(bounds, true);
}
// hack hack hack - until we add a more robust layer switcher,
// which is able to determine which layers are base layers and
// which are not (and put baselayers in a radiobutton group and