OpenLayers.Control.LayerSwitcher = Class.create(); OpenLayers.Control.LayerSwitcher.prototype = Object.extend( new OpenLayers.Control(), { initialize: function() { OpenLayers.Control.prototype.initialize.apply(this, arguments); }, draw: function() { // initialize our internal div OpenLayers.Control.prototype.draw.apply(this); this.map.events.register("addlayer", this, this.redraw); return this.redraw(); }, redraw: function() { var pixel = new OpenLayers.Pixel(this.map.div.clientWidth-200,4); this.div.innerHTML = ""; for(i=0; i