remove event type list from Events (lazy listener initialization) p=tschaub,me r=erilem (closes #2555)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@12384 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -32,12 +32,9 @@ OpenLayers.Control.DrawFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
callbacks: null,
|
||||
|
||||
/**
|
||||
* Constant: EVENT_TYPES
|
||||
*
|
||||
* Supported event types:
|
||||
* featureadded - Triggered when a feature is added
|
||||
*/
|
||||
EVENT_TYPES: ["featureadded"],
|
||||
|
||||
/**
|
||||
* APIProperty: multi
|
||||
@@ -67,13 +64,6 @@ OpenLayers.Control.DrawFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
* options - {Object}
|
||||
*/
|
||||
initialize: function(layer, handler, options) {
|
||||
|
||||
// concatenate events specific to vector with those from the base
|
||||
this.EVENT_TYPES =
|
||||
OpenLayers.Control.DrawFeature.prototype.EVENT_TYPES.concat(
|
||||
OpenLayers.Control.prototype.EVENT_TYPES
|
||||
);
|
||||
|
||||
OpenLayers.Control.prototype.initialize.apply(this, [options]);
|
||||
this.callbacks = OpenLayers.Util.extend(
|
||||
{
|
||||
|
||||
@@ -23,14 +23,12 @@
|
||||
OpenLayers.Control.Geolocate = OpenLayers.Class(OpenLayers.Control, {
|
||||
|
||||
/**
|
||||
* Constant: EVENT_TYPES
|
||||
* Supported event types:
|
||||
* - *locationupdated* Triggered when browser return a new position
|
||||
* - *locationfailed* Triggered when geolocation has failed
|
||||
* - *locationuncapable* Triggered when control is activated on a browser
|
||||
* which doesn't support geolocation
|
||||
*/
|
||||
EVENT_TYPES: ["locationupdated", "locationfailed", "locationuncapable"],
|
||||
|
||||
/**
|
||||
* Property: geolocation
|
||||
@@ -63,15 +61,6 @@ OpenLayers.Control.Geolocate = OpenLayers.Class(OpenLayers.Control, {
|
||||
* Create a new control to deal with browser geolocation API
|
||||
*
|
||||
*/
|
||||
initialize: function(options) {
|
||||
// concatenate events specific to this control with those from the base
|
||||
this.EVENT_TYPES =
|
||||
OpenLayers.Control.Geolocate.prototype.EVENT_TYPES.concat(
|
||||
OpenLayers.Control.prototype.EVENT_TYPES
|
||||
);
|
||||
this.geolocationOptions = {};
|
||||
OpenLayers.Control.prototype.initialize.apply(this, [options]);
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: destroy
|
||||
|
||||
@@ -170,8 +170,6 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
filterType: OpenLayers.Filter.Spatial.BBOX,
|
||||
|
||||
/**
|
||||
* Constant: EVENT_TYPES
|
||||
*
|
||||
* Supported event types:
|
||||
* beforefeatureselected - Triggered when <click> is true before a
|
||||
* feature is selected. The event object has a feature property with
|
||||
@@ -197,9 +195,6 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
* outfeature - Triggered when <hover> is true and the mouse moves
|
||||
* moved away from a hover-selected feature
|
||||
*/
|
||||
EVENT_TYPES: ["featureselected", "featuresselected", "featureunselected",
|
||||
"clickout", "beforefeatureselected", "beforefeaturesselected",
|
||||
"hoverfeature", "outfeature"],
|
||||
|
||||
/**
|
||||
* Constructor: OpenLayers.Control.GetFeature
|
||||
@@ -211,12 +206,6 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
* made)
|
||||
*/
|
||||
initialize: function(options) {
|
||||
// concatenate events specific to vector with those from the base
|
||||
this.EVENT_TYPES =
|
||||
OpenLayers.Control.GetFeature.prototype.EVENT_TYPES.concat(
|
||||
OpenLayers.Control.prototype.EVENT_TYPES
|
||||
);
|
||||
|
||||
options.handlerOptions = options.handlerOptions || {};
|
||||
|
||||
OpenLayers.Control.prototype.initialize.apply(this, [options]);
|
||||
|
||||
@@ -18,9 +18,7 @@
|
||||
OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, {
|
||||
|
||||
/**
|
||||
* Constant: EVENT_TYPES
|
||||
* {Array(String)} Supported application event types. Register a listener
|
||||
* for a particular event with the following syntax:
|
||||
* Register a listener for a particular event with the following syntax:
|
||||
* (code)
|
||||
* control.events.register(type, obj, listener);
|
||||
* (end)
|
||||
@@ -37,7 +35,6 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, {
|
||||
* measurement sketch is modified. Listeners receive an event with measure,
|
||||
* units, order, and geometry.
|
||||
*/
|
||||
EVENT_TYPES: ['measure', 'measurepartial'],
|
||||
|
||||
/**
|
||||
* APIProperty: handlerOptions
|
||||
@@ -120,11 +117,6 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, {
|
||||
* options - {Object}
|
||||
*/
|
||||
initialize: function(handler, options) {
|
||||
// concatenate events specific to measure with those from the base
|
||||
this.EVENT_TYPES =
|
||||
OpenLayers.Control.Measure.prototype.EVENT_TYPES.concat(
|
||||
OpenLayers.Control.prototype.EVENT_TYPES
|
||||
);
|
||||
OpenLayers.Control.prototype.initialize.apply(this, [options]);
|
||||
var callbacks = {done: this.measureComplete,
|
||||
point: this.measurePartial};
|
||||
|
||||
@@ -24,9 +24,7 @@
|
||||
OpenLayers.Control.SLDSelect = OpenLayers.Class(OpenLayers.Control, {
|
||||
|
||||
/**
|
||||
* Constant: EVENT_TYPES
|
||||
* {Array(String)} Supported application event types. Register a listener
|
||||
* for a particular event with the following syntax:
|
||||
* Register a listener for a particular event with the following syntax:
|
||||
* (code)
|
||||
* control.events.register(type, obj, listener);
|
||||
* (end)
|
||||
@@ -41,7 +39,6 @@ OpenLayers.Control.SLDSelect = OpenLayers.Class(OpenLayers.Control, {
|
||||
* array of OpenLayers.Filter objects created in order to perform
|
||||
* the particular selection.
|
||||
*/
|
||||
EVENT_TYPES: ["selected"],
|
||||
|
||||
/**
|
||||
* APIProperty: clearOnDeactivate
|
||||
@@ -148,11 +145,6 @@ OpenLayers.Control.SLDSelect = OpenLayers.Class(OpenLayers.Control, {
|
||||
* selection on.
|
||||
*/
|
||||
initialize: function(handler, options) {
|
||||
// concatenate events specific to this control with those from the base
|
||||
this.EVENT_TYPES =
|
||||
OpenLayers.Control.SLDSelect.prototype.EVENT_TYPES.concat(
|
||||
OpenLayers.Control.prototype.EVENT_TYPES
|
||||
);
|
||||
OpenLayers.Control.prototype.initialize.apply(this, [options]);
|
||||
|
||||
this.callbacks = OpenLayers.Util.extend({done: this.select,
|
||||
|
||||
@@ -22,14 +22,11 @@
|
||||
OpenLayers.Control.SelectFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
|
||||
/**
|
||||
* Constant: EVENT_TYPES
|
||||
*
|
||||
* Supported event types:
|
||||
* - *beforefeaturehighlighted* Triggered before a feature is highlighted
|
||||
* - *featurehighlighted* Triggered when a feature is highlighted
|
||||
* - *featureunhighlighted* Triggered when a feature is unhighlighted
|
||||
*/
|
||||
EVENT_TYPES: ["beforefeaturehighlighted", "featurehighlighted", "featureunhighlighted"],
|
||||
|
||||
/**
|
||||
* Property: multipleKey
|
||||
@@ -173,11 +170,6 @@ OpenLayers.Control.SelectFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
* options - {Object}
|
||||
*/
|
||||
initialize: function(layers, options) {
|
||||
// concatenate events specific to this control with those from the base
|
||||
this.EVENT_TYPES =
|
||||
OpenLayers.Control.SelectFeature.prototype.EVENT_TYPES.concat(
|
||||
OpenLayers.Control.prototype.EVENT_TYPES
|
||||
);
|
||||
OpenLayers.Control.prototype.initialize.apply(this, [options]);
|
||||
|
||||
if(this.scope === null) {
|
||||
|
||||
@@ -18,9 +18,7 @@
|
||||
OpenLayers.Control.Snapping = OpenLayers.Class(OpenLayers.Control, {
|
||||
|
||||
/**
|
||||
* Constant: EVENT_TYPES
|
||||
* {Array(String)} Supported application event types. Register a listener
|
||||
* for a particular event with the following syntax:
|
||||
* Register a listener for a particular event with the following syntax:
|
||||
* (code)
|
||||
* control.events.register(type, obj, listener);
|
||||
* (end)
|
||||
@@ -45,7 +43,6 @@ OpenLayers.Control.Snapping = OpenLayers.Class(OpenLayers.Control, {
|
||||
* unsnap - Triggered when a vertex is unsnapped. Listeners receive an
|
||||
* event with a *point* property.
|
||||
*/
|
||||
EVENT_TYPES: ["beforesnap", "snap", "unsnap"],
|
||||
|
||||
/**
|
||||
* CONSTANT: DEFAULTS
|
||||
@@ -175,10 +172,6 @@ OpenLayers.Control.Snapping = OpenLayers.Class(OpenLayers.Control, {
|
||||
* no maximum resolution limit.
|
||||
*/
|
||||
initialize: function(options) {
|
||||
// concatenate events specific to measure with those from the base
|
||||
Array.prototype.push.apply(
|
||||
this.EVENT_TYPES, OpenLayers.Control.prototype.EVENT_TYPES
|
||||
);
|
||||
OpenLayers.Control.prototype.initialize.apply(this, [options]);
|
||||
this.options = options || {}; // TODO: this could be done by the super
|
||||
|
||||
|
||||
@@ -19,9 +19,7 @@
|
||||
OpenLayers.Control.Split = OpenLayers.Class(OpenLayers.Control, {
|
||||
|
||||
/**
|
||||
* Constant: EVENT_TYPES
|
||||
* {Array(String)} Supported application event types. Register a listener
|
||||
* for a particular event with the following syntax:
|
||||
* Register a listener for a particular event with the following syntax:
|
||||
* (code)
|
||||
* control.events.register(type, obj, listener);
|
||||
* (end)
|
||||
@@ -47,7 +45,6 @@ OpenLayers.Control.Split = OpenLayers.Class(OpenLayers.Control, {
|
||||
* sketch or modified feature used as a splitter. The features
|
||||
* property is a list of all resulting features.
|
||||
*/
|
||||
EVENT_TYPES: ["beforesplit", "split", "aftersplit"],
|
||||
|
||||
/**
|
||||
* APIProperty: layer
|
||||
@@ -169,10 +166,6 @@ OpenLayers.Control.Split = OpenLayers.Class(OpenLayers.Control, {
|
||||
* splitting.
|
||||
*/
|
||||
initialize: function(options) {
|
||||
// concatenate events specific to measure with those from the base
|
||||
Array.prototype.push.apply(
|
||||
this.EVENT_TYPES, OpenLayers.Control.prototype.EVENT_TYPES
|
||||
);
|
||||
OpenLayers.Control.prototype.initialize.apply(this, [options]);
|
||||
this.options = options || {}; // TODO: this could be done by the super
|
||||
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
OpenLayers.Control.TransformFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
|
||||
/**
|
||||
* Constant: EVENT_TYPES
|
||||
*
|
||||
* Supported event types:
|
||||
* - *beforesetfeature* Triggered before a feature is set for
|
||||
* tranformation. The feature will not be set if a listener returns
|
||||
@@ -51,8 +49,6 @@ OpenLayers.Control.TransformFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
* - *transformcomplete* Triggered after dragging. Listeners receive
|
||||
* an event object with the transformed *feature*.
|
||||
*/
|
||||
EVENT_TYPES: ["beforesetfeature", "setfeature", "beforetransform",
|
||||
"transform", "transformcomplete"],
|
||||
|
||||
/**
|
||||
* APIProperty: geometryTypes
|
||||
@@ -181,11 +177,6 @@ OpenLayers.Control.TransformFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
* control.
|
||||
*/
|
||||
initialize: function(layer, options) {
|
||||
// concatenate events specific to this control with those from the base
|
||||
this.EVENT_TYPES =
|
||||
OpenLayers.Control.TransformFeature.prototype.EVENT_TYPES.concat(
|
||||
OpenLayers.Control.prototype.EVENT_TYPES
|
||||
);
|
||||
OpenLayers.Control.prototype.initialize.apply(this, [options]);
|
||||
|
||||
this.layer = layer;
|
||||
|
||||
@@ -155,8 +155,6 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
||||
hoverRequest: null,
|
||||
|
||||
/**
|
||||
* Constant: EVENT_TYPES
|
||||
*
|
||||
* Supported event types (in addition to those from <OpenLayers.Control>):
|
||||
* beforegetfeatureinfo - Triggered before the request is sent.
|
||||
* The event object has an *xy* property with the position of the
|
||||
@@ -172,7 +170,6 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
||||
* layers, *text* and *request* will only contain the response body
|
||||
* and request object of the last request.
|
||||
*/
|
||||
EVENT_TYPES: ["beforegetfeatureinfo", "nogetfeatureinfo", "getfeatureinfo"],
|
||||
|
||||
/**
|
||||
* Constructor: <OpenLayers.Control.WMSGetFeatureInfo>
|
||||
@@ -181,12 +178,6 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
||||
* options - {Object}
|
||||
*/
|
||||
initialize: function(options) {
|
||||
// concatenate events specific to vector with those from the base
|
||||
this.EVENT_TYPES =
|
||||
OpenLayers.Control.WMSGetFeatureInfo.prototype.EVENT_TYPES.concat(
|
||||
OpenLayers.Control.prototype.EVENT_TYPES
|
||||
);
|
||||
|
||||
options = options || {};
|
||||
options.handlerOptions = options.handlerOptions || {};
|
||||
|
||||
|
||||
@@ -136,8 +136,6 @@ OpenLayers.Control.WMTSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
||||
hoverRequest: null,
|
||||
|
||||
/**
|
||||
* Constant: EVENT_TYPES
|
||||
*
|
||||
* Supported event types (in addition to those from <OpenLayers.Control>):
|
||||
* beforegetfeatureinfo - Triggered before each request is sent.
|
||||
* The event object has an *xy* property with the position of the
|
||||
@@ -157,7 +155,6 @@ OpenLayers.Control.WMTSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
||||
* an event with *request*, *xy*, and *layer* properties. In the case
|
||||
* of a parsing error, the event will also contain an *error* property.
|
||||
*/
|
||||
EVENT_TYPES: ["beforegetfeatureinfo", "getfeatureinfo", "exception"],
|
||||
|
||||
/**
|
||||
* Property: pending
|
||||
@@ -172,12 +169,6 @@ OpenLayers.Control.WMTSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
||||
* options - {Object}
|
||||
*/
|
||||
initialize: function(options) {
|
||||
// concatenate events specific to vector with those from the base
|
||||
this.EVENT_TYPES =
|
||||
OpenLayers.Control.WMTSGetFeatureInfo.prototype.EVENT_TYPES.concat(
|
||||
OpenLayers.Control.prototype.EVENT_TYPES
|
||||
);
|
||||
|
||||
options = options || {};
|
||||
options.handlerOptions = options.handlerOptions || {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user