Trigger feature related events with feature information and layer related events with layer information. Also adding events.on and events.un convenience methods. r=crschmidt (closes #1343)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@6149 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2008-02-08 23:31:27 +00:00
parent 464fb30589
commit f27833f1db
20 changed files with 326 additions and 118 deletions
+14 -8
View File
@@ -35,10 +35,13 @@ OpenLayers.Control.Attribution =
* Destroy control.
*/
destroy: function() {
this.map.events.unregister("removelayer", this, this.updateAttribution);
this.map.events.unregister("addlayer", this, this.updateAttribution);
this.map.events.unregister("changelayer", this, this.updateAttribution);
this.map.events.unregister("changebaselayer", this, this.updateAttribution);
this.map.events.un({
"removelayer": this.updateAttribution,
"addlayer": this.updateAttribution,
"changelayer": this.updateAttribution,
"changebaselayer": this.updateAttribution,
scope: this
});
OpenLayers.Control.prototype.destroy.apply(this, arguments);
},
@@ -53,10 +56,13 @@ OpenLayers.Control.Attribution =
draw: function() {
OpenLayers.Control.prototype.draw.apply(this, arguments);
this.map.events.register('changebaselayer', this, this.updateAttribution);
this.map.events.register('changelayer', this, this.updateAttribution);
this.map.events.register('addlayer', this, this.updateAttribution);
this.map.events.register('removelayer', this, this.updateAttribution);
this.map.events.on({
'changebaselayer': this.updateAttribution,
'changelayer': this.updateAttribution,
'addlayer': this.updateAttribution,
'removelayer': this.updateAttribution,
scope: this
});
this.updateAttribution();
return this.div;