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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user