diff --git a/lib/OpenLayers/Layer.js b/lib/OpenLayers/Layer.js index 5619f56c9b..47ec65b375 100644 --- a/lib/OpenLayers/Layer.js +++ b/lib/OpenLayers/Layer.js @@ -529,6 +529,14 @@ OpenLayers.Layer = OpenLayers.Class({ } }, + /** + * Method: afterAdd + * Called at the end of the map.addLayer sequence. At this point, the map + * will have a base layer. To be overridden by subclasses. + */ + afterAdd: function() { + }, + /** * APIMethod: removeMap * Just as setMap() allows each layer the possibility to take a diff --git a/lib/OpenLayers/Layer/Vector.js b/lib/OpenLayers/Layer/Vector.js index 8f4c515088..3ec749c33c 100644 --- a/lib/OpenLayers/Layer/Vector.js +++ b/lib/OpenLayers/Layer/Vector.js @@ -350,6 +350,15 @@ OpenLayers.Layer.Vector = OpenLayers.Class(OpenLayers.Layer, { this.renderer.map = this.map; this.renderer.setSize(this.map.getSize()); } + }, + + /** + * Method: afterAdd + * Called at the end of the map.addLayer sequence. At this point, the map + * will have a base layer. Any autoActivate strategies will be + * activated here. + */ + afterAdd: function() { if(this.strategies) { var strategy, i, len; for(i=0, len=this.strategies.length; i