give layer an "added" and "removed" event. p=mpriour,me r=me (closes #2983)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@11052 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2011-01-22 12:04:40 +00:00
parent f73fb689a8
commit 4a9460b314
5 changed files with 39 additions and 40 deletions
-31
View File
@@ -50,28 +50,6 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, {
*/
metadataParams: null,
/**
* Constant: EVENT_TYPES
* {Array(String)} Supported application event types. Register a listener
* for a particular event with the following syntax:
* (code)
* layer.events.register(type, obj, listener);
* (end)
*
* Listeners will be called with a reference to an event object. The
* properties of this event depends on exactly what happened.
*
* All event objects have at least the following properties:
* object - {Object} A reference to layer.events.object.
* element - {DOMElement} A reference to layer.events.element.
*
* Supported map event types (in addition to those from <OpenLayers.Layer>):
* added - Triggered after the layer is added to a map. Listeners
* will receive an object with a *map* property referencing the
* map and a *layer* property referencing the layer.
*/
EVENT_TYPES: ["added"],
/**
* Constructor: OpenLayers.Layer.Bing
* Create a new Bing layer.
@@ -98,12 +76,6 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, {
* Any other documented layer properties can be provided in the config object.
*/
initialize: function(options) {
// concatenate events specific to vector with those from the base
this.EVENT_TYPES =
OpenLayers.Layer.Bing.prototype.EVENT_TYPES.concat(
OpenLayers.Layer.prototype.EVENT_TYPES
);
options = OpenLayers.Util.applyDefaults({
zoomOffset: 1,
maxResolution: 78271.51695,
@@ -245,9 +217,6 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, {
this.updateAttribution();
}
this.map.events.register("moveend", this, this.updateAttribution);
// TODO: move this event to Layer
// http://trac.osgeo.org/openlayers/ticket/2983
this.events.triggerEvent("added", {map: this.map, layer: this});
},
/**