Create redraw() function. This function does all of the drawing in the control: the draw function merely calls out to it. In addition, draw now does initialization of an event listener, listening for layers being added. This allows you to add the layer control before you've added all your layers, which was not possible before. It also allows, if desired, for us to add the LayerSwitcher control to the default controls, since it now will draw the layer switchers as they are added.
Create redraw() function. This function does all of the drawing in the control: the draw function merely calls out to it. In addition, draw now does initialization of an event listener, listening for layers being added. This allows you to add the layer control before you've added all your layers, which was not possible before. It also allows, if desired, for us to add the LayerSwitcher control to the default controls, since it now will draw the layer switchers as they are added.



git-svn-id: 86a4f41f9d0383640198789122b520d4105b319a@67 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf

Morgul/ol3,PetrDlouhy/openlayers,tsauerwein/ol3,richstoner/ol3,richstoner/ol3,denilsonsa/ol3,aisaacs/ol3,sbrunner/openlayers,ahocevar/openlayers,adh1365/openlayers,PublicStuff/openlayers,kkuunnddaannkk/ol3,gingerik/ol3,pmlrsg/ol3,v5analytics/openlayers,Antreasgr/ol3,bogdanvaduva/ol3,altamiracorp/openlayers,Antreasgr/ol3,klokantech/ol3raster,das-peter/ol3,yinxiaomei/ol3,sbrunner/openlayers,kjelderg/ol3,freylis/ol3,openlayers/openlayers,kjelderg/ol3,Distem/ol3,llambanna/ol3,denilsonsa/ol3,tamarmot/ol3,xiaoqqchen/ol3,klokantech/ol3,PetrDlouhy/openlayers,fperucic/ol3,WayTo/openlayers,alvinlindstam/ol3,Antreasgr/ol3,llambanna/ol3,llambanna/ol3,mechdrew/ol3,hafenr/ol3,stweil/ol3,alvinlindstam/ol3,stweil/openlayers,stweil/openlayers,bartvde/ol3,mzur/ol3,llambanna/ol3,t27/ol3,bogdanvaduva/ol3,Andrey-Pavlov/ol3,CandoImage/ol3,ahocevar/ol3,jmiller-boundless/ol3,t27/ol3,ahocevar/openlayers,openlayers/ol2,fredj/ol3,aisaacs/ol3,PublicStuff/openlayers,tschaub/ol3,shevawen/openlayers,Distem/ol3,itayod/ol3,jmiller-boundless/ol3,epointal/ol3,colllin/openlayers,Gnafu/openlayers,das-peter/ol3,dracic/openlayers,kartverket/openlayers,tschaub/ol3,owenmead/openlayers,planetlabs/ol3,gingerik/ol3,geonux/ol3,georchestra/openlayers,kkuunnddaannkk/ol3,shevawen/openlayers,sanak/ol2,Antreasgr/ol3,adh1365/openlayers,elemoine/ol3,tsauerwein/ol3,WayTo/openlayers,Distem/ol3,pvalsecc/openlayers,kartverket/openlayers,mechdrew/ol3,openlayers/openlayers,klokantech/ol3raster,hafenr/ol3,fredj/ol3,richstoner/ol3,planetlabs/ol3,klokantech/ol3,colllin/openlayers,geekdenz/openlayers,aisaacs/ol3,antonio83moura/ol3,sanak/ol2,bill-chadwick/ol3,geoext/GXM,stweil/ol3,bogdanvaduva/ol3,thhomas/ol3,xiaoqqchen/ol3,altamiracorp/openlayers,geekdenz/ol3,elbakai/openlayers,adube/ol3,mechdrew/ol3,tamarmot/ol3,georchestra/openlayers,sanak/ol2,antonio83moura/ol3,openlayers/ol2,alexbrault/ol3,mechdrew/ol3,fblackburn/ol3,ahocevar/ol3,thhomas/ol3,klokantech/ol3raster,bill-chadwick/ol3,v5analytics/openlayers,aisaacs/ol3,antonio83moura/ol3,ahocevar/ol3,mzur/ol3,hafenr/ol3,fperucic/ol3,tsauerwein/ol3,kkuunnddaannkk/ol3,openlayers/ol2,wlerner/ol3,tamarmot/ol3,klokantech/ol3raster,thhomas/ol3,openlayers/ol2,planetlabs/ol3,mzur/ol3,stweil/openlayers,sbrunner/openlayers,mzur/ol3,antonio83moura/ol3,wlerner/ol3,boundlessgeo/openlayers,CandoImage/ol3,avinet/openlayers,pgiraud/openlayers,geonux/ol3,adh1365/openlayers,NOAA-ORR-ERD/ol3,elemoine/ol3,bartvde/ol3,kjelderg/ol3,Morgul/ol3,epointal/ol3,freylis/ol3,dracic/openlayers,kkuunnddaannkk/ol3,adh1365/openlayers,Andrey-Pavlov/ol3,tschaub/ol3,wet-boew/openlayers,jmiller-boundless/ol3,yinxiaomei/ol3,das-peter/ol3,gingerik/ol3,Andrey-Pavlov/ol3,boundlessgeo/openlayers,openlayers/openlayers,pvalsecc/openlayers,tsauerwein/ol3,landonb/ol3,Morgul/ol3,avinet/openlayers,pgiraud/openlayers,bjornharrtell/ol3,jacmendt/ol3,landonb/ol3,klokantech/ol3,bill-chadwick/ol3,xiaoqqchen/ol3,Gnafu/openlayers,fblackburn/ol3,itayod/ol3,kjelderg/ol3,fblackburn/ol3,CandoImage/ol3,thomasmoelhave/ol3,alexbrault/ol3,jmiller-boundless/ol3,altamiracorp/openlayers,wlerner/ol3,fperucic/ol3,georchestra/openlayers,NOAA-ORR-ERD/ol3,PublicStuff/openlayers,itayod/ol3,yinxiaomei/ol3,thomasmoelhave/ol3,ahocevar/ol2,denilsonsa/ol3,Morgul/ol3,pvalsecc/openlayers,ahocevar/ol3,das-peter/ol3,pgiraud/openlayers,jmiller-boundless/ol3,shevawen/openlayers,colllin/openlayers,elemoine/ol3,thomasmoelhave/ol3,elbakai/openlayers,boundlessgeo/openlayers,oterral/ol3,Distem/ol3,thomasmoelhave/ol3,tamarmot/ol3,bartvde/ol3,fredj/ol3,denilsonsa/ol3,shevawen/openlayers,richstoner/ol3,avinet/openlayers,fperucic/ol3,freylis/ol3,geekdenz/ol3,wet-boew/openlayers,PublicStuff/openlayers,wet-boew/openlayers,fredj/ol3,v5analytics/openlayers,jacmendt/ol3,dracic/openlayers,adube/ol3,oterral/ol3,elbakai/openlayers,bogdanvaduva/ol3,pmlrsg/ol3,adube/ol3,tschaub/openlayers-raster,colllin/openlayers,geekdenz/openlayers,geonux/ol3,kartverket/openlayers,stweil/ol3,NOAA-ORR-ERD/ol3,epointal/ol3,planetlabs/ol3,geekdenz/ol3,fblackburn/ol3,WayTo/openlayers,landonb/ol3,boundlessgeo/openlayers,bartvde/ol3,dracic/openlayers,avinet/openlayers,alvinlindstam/ol3,landonb/ol3,v5analytics/openlayers,geekdenz/ol3,NOAA-ORR-ERD/ol3,alvinlindstam/ol3,hafenr/ol3,pmlrsg/ol3,Andrey-Pavlov/ol3,altamiracorp/openlayers,epointal/ol3,tschaub/ol3,t27/ol3,Gnafu/openlayers,elbakai/openlayers,bjornharrtell/ol3,klokantech/ol3,gingerik/ol3,wlerner/ol3,pmlrsg/ol3,yinxiaomei/ol3,ahocevar/ol2,PetrDlouhy/openlayers,geekdenz/openlayers,freylis/ol3,t27/ol3,ahocevar/openlayers,pvalsecc/openlayers,itayod/ol3,stweil/ol3,kartverket/openlayers,PetrDlouhy/openlayers,owenmead/openlayers,thhomas/ol3,jacmendt/ol3,alexbrault/ol3,Gnafu/openlayers,xiaoqqchen/ol3,owenmead/openlayers,WayTo/openlayers,oterral/ol3,tschaub/openlayers-raster,elemoine/ol3,sanak/ol2,tschaub/openlayers-raster,CandoImage/ol3,wet-boew/openlayers,alexbrault/ol3,jacmendt/ol3,owenmead/openlayers,geoext/GXM,sbrunner/openlayers,bjornharrtell/ol3,ahocevar/ol2,pgiraud/openlayers,geonux/ol3,bill-chadwick/ol3