Giving all controls an events instance. You can now listen for activate and deactivate on any control. Panel controls do this to know when they should redraw. Navigation history control demonstrates the effect of this change. r=elemoine (closes #1346)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@6167 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2008-02-09 16:46:02 +00:00
parent 9bfd829512
commit bf224d699d
5 changed files with 61 additions and 40 deletions

View File

@@ -36,21 +36,8 @@
function init(){
map = new OpenLayers.Map('map');
// set any application specific behavior here
// this will become unnecessary when controls have better event handling
var previousOptions = {
onActivate: function() {panel.redraw();},
onDeactivate: function() {panel.redraw();}
};
var nextOptions = {
onActivate: function() {panel.redraw();},
onDeactivate: function() {panel.redraw();}
};
var options = {
previousOptions: previousOptions,
nextOptions: nextOptions
};
nav = new OpenLayers.Control.NavigationHistory(options);
nav = new OpenLayers.Control.NavigationHistory();
// parent control must be added to the map
map.addControl(nav);
panel = new OpenLayers.Control.Panel(