From 986eaaf7a488d34f3f8b6c6f0e1f604e32f27099 Mon Sep 17 00:00:00 2001 From: euzuro Date: Thu, 6 Jul 2006 02:20:06 +0000 Subject: [PATCH] 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 --- lib/OpenLayers/Map.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index 95ee9157e5..4dd3e3a90a 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -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