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:
@@ -250,6 +250,12 @@ OpenLayers.Map.prototype = {
|
|||||||
|
|
||||||
this.events.triggerEvent("addlayer");
|
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,
|
// hack hack hack - until we add a more robust layer switcher,
|
||||||
// which is able to determine which layers are base layers and
|
// which is able to determine which layers are base layers and
|
||||||
// which are not (and put baselayers in a radiobutton group and
|
// which are not (and put baselayers in a radiobutton group and
|
||||||
|
|||||||
Reference in New Issue
Block a user