Adding back events documentation.

When the list of event types became unconstrained in 501b42228a, we lost the documentation for events that are triggered.  This change adds the list of events triggered to the API docs for events properties.
This commit is contained in:
tschaub
2012-02-16 10:36:34 -07:00
parent ed502f6f19
commit 2b5ade2dde
17 changed files with 218 additions and 143 deletions

View File

@@ -139,10 +139,7 @@ OpenLayers.Control = OpenLayers.Class({
* APIProperty: events * APIProperty: events
* {<OpenLayers.Events>} Events instance for listeners and triggering * {<OpenLayers.Events>} Events instance for listeners and triggering
* control specific events. * control specific events.
*/ *
events: null,
/**
* Register a listener for a particular event with the following syntax: * Register a listener for a particular event with the following syntax:
* (code) * (code)
* control.events.register(type, obj, listener); * control.events.register(type, obj, listener);
@@ -161,6 +158,7 @@ OpenLayers.Control = OpenLayers.Class({
* activate - Triggered when activated. * activate - Triggered when activated.
* deactivate - Triggered when deactivated. * deactivate - Triggered when deactivated.
*/ */
events: null,
/** /**
* Constructor: OpenLayers.Control * Constructor: OpenLayers.Control

View File

@@ -32,7 +32,16 @@ OpenLayers.Control.DrawFeature = OpenLayers.Class(OpenLayers.Control, {
callbacks: null, callbacks: null,
/** /**
* Supported event types: * APIProperty: events
* {<OpenLayers.Events>} Events instance for listeners and triggering
* control specific events.
*
* Register a listener for a particular event with the following syntax:
* (code)
* control.events.register(type, obj, listener);
* (end)
*
* Supported event types (in addition to those from <OpenLayers.Control.events>):
* featureadded - Triggered when a feature is added * featureadded - Triggered when a feature is added
*/ */

View File

@@ -23,13 +23,22 @@
OpenLayers.Control.Geolocate = OpenLayers.Class(OpenLayers.Control, { OpenLayers.Control.Geolocate = OpenLayers.Class(OpenLayers.Control, {
/** /**
* Supported event types: * APIProperty: events
* - *locationupdated* Triggered when browser return a new position. Listeners will * {<OpenLayers.Events>} Events instance for listeners and triggering
* control specific events.
*
* Register a listener for a particular event with the following syntax:
* (code)
* control.events.register(type, obj, listener);
* (end)
*
* Supported event types (in addition to those from <OpenLayers.Control.events>):
* locationupdated - Triggered when browser return a new position. Listeners will
* receive an object with a 'position' property which is the browser.geolocation.position * receive an object with a 'position' property which is the browser.geolocation.position
* native object, as well as a 'point' property which is the location transformed in the * native object, as well as a 'point' property which is the location transformed in the
* current map projection. * current map projection.
* - *locationfailed* Triggered when geolocation has failed * locationfailed - Triggered when geolocation has failed
* - *locationuncapable* Triggered when control is activated on a browser * locationuncapable - Triggered when control is activated on a browser
* which doesn't support geolocation * which doesn't support geolocation
*/ */

View File

@@ -170,7 +170,16 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
filterType: OpenLayers.Filter.Spatial.BBOX, filterType: OpenLayers.Filter.Spatial.BBOX,
/** /**
* Supported event types: * APIProperty: events
* {<OpenLayers.Events>} Events instance for listeners and triggering
* control specific events.
*
* Register a listener for a particular event with the following syntax:
* (code)
* control.events.register(type, obj, listener);
* (end)
*
* Supported event types (in addition to those from <OpenLayers.Control.events>):
* beforefeatureselected - Triggered when <click> is true before a * beforefeatureselected - Triggered when <click> is true before a
* feature is selected. The event object has a feature property with * feature is selected. The event object has a feature property with
* the feature about to select * the feature about to select

View File

@@ -18,15 +18,16 @@
OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, { OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, {
/** /**
* APIProperty: events
* {<OpenLayers.Events>} Events instance for listeners and triggering
* control specific events.
*
* Register a listener for a particular event with the following syntax: * Register a listener for a particular event with the following syntax:
* (code) * (code)
* control.events.register(type, obj, listener); * control.events.register(type, obj, listener);
* (end) * (end)
* *
* Listeners will be called with a reference to an event object. The * Supported event types (in addition to those from <OpenLayers.Control.events>):
* properties of this event depends on exactly what happened.
*
* Supported control event types (in addition to those from <OpenLayers.Control>):
* measure - Triggered when a measurement sketch is complete. Listeners * measure - Triggered when a measurement sketch is complete. Listeners
* will receive an event with measure, units, order, and geometry * will receive an event with measure, units, order, and geometry
* properties. * properties.

View File

@@ -24,16 +24,16 @@
OpenLayers.Control.SLDSelect = OpenLayers.Class(OpenLayers.Control, { OpenLayers.Control.SLDSelect = OpenLayers.Class(OpenLayers.Control, {
/** /**
* APIProperty: events
* {<OpenLayers.Events>} Events instance for listeners and triggering
* control specific events.
*
* Register a listener for a particular event with the following syntax: * Register a listener for a particular event with the following syntax:
* (code) * (code)
* control.events.register(type, obj, listener); * control.events.register(type, obj, listener);
* (end) * (end)
* *
* Listeners will be called with a reference to an event object. The * Supported event types (in addition to those from <OpenLayers.Control.events>):
* properties of this event depends on exactly what happened.
*
* Supported control event types (in addition to those from
* <OpenLayers.Control>):
* selected - Triggered when a selection occurs. Listeners receive an * selected - Triggered when a selection occurs. Listeners receive an
* event with *filters* and *layer* properties. Filters will be an * event with *filters* and *layer* properties. Filters will be an
* array of OpenLayers.Filter objects created in order to perform * array of OpenLayers.Filter objects created in order to perform

View File

@@ -22,12 +22,21 @@
OpenLayers.Control.SelectFeature = OpenLayers.Class(OpenLayers.Control, { OpenLayers.Control.SelectFeature = OpenLayers.Class(OpenLayers.Control, {
/** /**
* Supported event types: * APIProperty: events
* - *beforefeaturehighlighted* Triggered before a feature is highlighted * {<OpenLayers.Events>} Events instance for listeners and triggering
* - *featurehighlighted* Triggered when a feature is highlighted * control specific events.
* - *featureunhighlighted* Triggered when a feature is unhighlighted *
* - *boxselectionstart* Triggered before box selection starts * Register a listener for a particular event with the following syntax:
* - *boxselectionend* Triggered after box selection ends * (code)
* control.events.register(type, obj, listener);
* (end)
*
* Supported event types (in addition to those from <OpenLayers.Control.events>):
* beforefeaturehighlighted - Triggered before a feature is highlighted
* featurehighlighted - Triggered when a feature is highlighted
* featureunhighlighted - Triggered when a feature is unhighlighted
* boxselectionstart - Triggered before box selection starts
* boxselectionend - Triggered after box selection ends
*/ */
/** /**

View File

@@ -18,15 +18,16 @@
OpenLayers.Control.Snapping = OpenLayers.Class(OpenLayers.Control, { OpenLayers.Control.Snapping = OpenLayers.Class(OpenLayers.Control, {
/** /**
* APIProperty: events
* {<OpenLayers.Events>} Events instance for listeners and triggering
* control specific events.
*
* Register a listener for a particular event with the following syntax: * Register a listener for a particular event with the following syntax:
* (code) * (code)
* control.events.register(type, obj, listener); * control.events.register(type, obj, listener);
* (end) * (end)
* *
* Listeners will be called with a reference to an event object. The * Supported event types (in addition to those from <OpenLayers.Control.events>):
* properties of this event depends on exactly what happened.
*
* Supported control event types (in addition to those from <OpenLayers.Control>):
* beforesnap - Triggered before a snap occurs. Listeners receive an * beforesnap - Triggered before a snap occurs. Listeners receive an
* event object with *point*, *x*, *y*, *distance*, *layer*, and * event object with *point*, *x*, *y*, *distance*, *layer*, and
* *snapType* properties. The point property will be original point * *snapType* properties. The point property will be original point

View File

@@ -19,15 +19,16 @@
OpenLayers.Control.Split = OpenLayers.Class(OpenLayers.Control, { OpenLayers.Control.Split = OpenLayers.Class(OpenLayers.Control, {
/** /**
* APIProperty: events
* {<OpenLayers.Events>} Events instance for listeners and triggering
* control specific events.
*
* Register a listener for a particular event with the following syntax: * Register a listener for a particular event with the following syntax:
* (code) * (code)
* control.events.register(type, obj, listener); * control.events.register(type, obj, listener);
* (end) * (end)
* *
* Listeners will be called with a reference to an event object. The * Supported event types (in addition to those from <OpenLayers.Control.events>):
* properties of this event depends on exactly what happened.
*
* Supported control event types (in addition to those from <OpenLayers.Control>):
* beforesplit - Triggered before a split occurs. Listeners receive an * beforesplit - Triggered before a split occurs. Listeners receive an
* event object with *source* and *target* properties. * event object with *source* and *target* properties.
* split - Triggered when a split occurs. Listeners receive an event with * split - Triggered when a split occurs. Listeners receive an event with

View File

@@ -22,31 +22,40 @@
OpenLayers.Control.TransformFeature = OpenLayers.Class(OpenLayers.Control, { OpenLayers.Control.TransformFeature = OpenLayers.Class(OpenLayers.Control, {
/** /**
* Supported event types: * APIProperty: events
* - *beforesetfeature* Triggered before a feature is set for * {<OpenLayers.Events>} Events instance for listeners and triggering
* control specific events.
*
* Register a listener for a particular event with the following syntax:
* (code)
* control.events.register(type, obj, listener);
* (end)
*
* Supported event types (in addition to those from <OpenLayers.Control.events>):
* beforesetfeature - Triggered before a feature is set for
* tranformation. The feature will not be set if a listener returns * tranformation. The feature will not be set if a listener returns
* false. Listeners receive a *feature* property, with the feature * false. Listeners receive a *feature* property, with the feature
* that will be set for transformation. Listeners are allowed to * that will be set for transformation. Listeners are allowed to
* set the control's *scale*, *ratio* and *rotation* properties, * set the control's *scale*, *ratio* and *rotation* properties,
* which will set the initial scale, ratio and rotation of the * which will set the initial scale, ratio and rotation of the
* feature, like the <setFeature> method's initialParams argument. * feature, like the <setFeature> method's initialParams argument.
* - *setfeature* Triggered when a feature is set for tranformation. * setfeature - Triggered when a feature is set for tranformation.
* Listeners receive a *feature* property, with the feature that * Listeners receive a *feature* property, with the feature that
* is now set for transformation. * is now set for transformation.
* - *beforetransform* Triggered while dragging, before a feature is * beforetransform - Triggered while dragging, before a feature is
* transformed. The feature will not be transformed if a listener * transformed. The feature will not be transformed if a listener
* returns false (but the box still will). Listeners receive one or * returns false (but the box still will). Listeners receive one or
* more of *center*, *scale*, *ratio* and *rotation*. The *center* * more of *center*, *scale*, *ratio* and *rotation*. The *center*
* property is an <OpenLayers.Geometry.Point> object with the new * property is an <OpenLayers.Geometry.Point> object with the new
* center of the transformed feature, the others are Floats with the * center of the transformed feature, the others are Floats with the
* scale, ratio or rotation change since the last transformation. * scale, ratio or rotation change since the last transformation.
* - *transform* Triggered while dragging, when a feature is transformed. * transform - Triggered while dragging, when a feature is transformed.
* Listeners receive an event object with one or more of *center*, * Listeners receive an event object with one or more of *center*,
* *scale*, *ratio* and *rotation*. The *center* property is an * scale*, *ratio* and *rotation*. The *center* property is an
* <OpenLayers.Geometry.Point> object with the new center of the * <OpenLayers.Geometry.Point> object with the new center of the
* transformed feature, the others are Floats with the scale, ratio * transformed feature, the others are Floats with the scale, ratio
* or rotation change of the feature since the last transformation. * or rotation change of the feature since the last transformation.
* - *transformcomplete* Triggered after dragging. Listeners receive * transformcomplete - Triggered after dragging. Listeners receive
* an event object with the transformed *feature*. * an event object with the transformed *feature*.
*/ */

View File

@@ -155,7 +155,16 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
hoverRequest: null, hoverRequest: null,
/** /**
* Supported event types (in addition to those from <OpenLayers.Control>): * APIProperty: events
* {<OpenLayers.Events>} Events instance for listeners and triggering
* control specific events.
*
* Register a listener for a particular event with the following syntax:
* (code)
* control.events.register(type, obj, listener);
* (end)
*
* Supported event types (in addition to those from <OpenLayers.Control.events>):
* beforegetfeatureinfo - Triggered before the request is sent. * beforegetfeatureinfo - Triggered before the request is sent.
* The event object has an *xy* property with the position of the * The event object has an *xy* property with the position of the
* mouse click or hover event that triggers the request. * mouse click or hover event that triggers the request.

View File

@@ -136,7 +136,16 @@ OpenLayers.Control.WMTSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
hoverRequest: null, hoverRequest: null,
/** /**
* Supported event types (in addition to those from <OpenLayers.Control>): * APIProperty: events
* {<OpenLayers.Events>} Events instance for listeners and triggering
* control specific events.
*
* Register a listener for a particular event with the following syntax:
* (code)
* control.events.register(type, obj, listener);
* (end)
*
* Supported event types (in addition to those from <OpenLayers.Control.events>):
* beforegetfeatureinfo - Triggered before each request is sent. * beforegetfeatureinfo - Triggered before each request is sent.
* The event object has an *xy* property with the position of the * The event object has an *xy* property with the position of the
* mouse click or hover event that triggers the request and a *layer* * mouse click or hover event that triggers the request and a *layer*

View File

@@ -58,6 +58,21 @@ OpenLayers.Layer = OpenLayers.Class({
alwaysInRange: null, alwaysInRange: null,
/** /**
* Constant: RESOLUTION_PROPERTIES
* {Array} The properties that are used for calculating resolutions
* information.
*/
RESOLUTION_PROPERTIES: [
'scales', 'resolutions',
'maxScale', 'minScale',
'maxResolution', 'minResolution',
'numZoomLevels', 'maxZoomLevel'
],
/**
* APIProperty: events
* {<OpenLayers.Events>}
*
* Register a listener for a particular event with the following syntax: * Register a listener for a particular event with the following syntax:
* (code) * (code)
* layer.events.register(type, obj, listener); * layer.events.register(type, obj, listener);
@@ -87,22 +102,6 @@ OpenLayers.Layer = OpenLayers.Class({
* will receive an object with a *map* property referencing the map and * will receive an object with a *map* property referencing the map and
* a *layer* property referencing the layer. * a *layer* property referencing the layer.
*/ */
/**
* Constant: RESOLUTION_PROPERTIES
* {Array} The properties that are used for calculating resolutions
* information.
*/
RESOLUTION_PROPERTIES: [
'scales', 'resolutions',
'maxScale', 'minScale',
'maxResolution', 'minResolution',
'numZoomLevels', 'maxZoomLevel'
],
/**
* APIProperty: events
* {<OpenLayers.Events>}
*/ */
events: null, events: null,

View File

@@ -24,6 +24,9 @@
OpenLayers.Layer.Vector = OpenLayers.Class(OpenLayers.Layer, { OpenLayers.Layer.Vector = OpenLayers.Class(OpenLayers.Layer, {
/** /**
* APIProperty: events
* {<OpenLayers.Events>}
*
* Register a listener for a particular event with the following syntax: * Register a listener for a particular event with the following syntax:
* (code) * (code)
* layer.events.register(type, obj, listener); * layer.events.register(type, obj, listener);
@@ -36,7 +39,7 @@ OpenLayers.Layer.Vector = OpenLayers.Class(OpenLayers.Layer, {
* object - {Object} A reference to layer.events.object. * object - {Object} A reference to layer.events.object.
* element - {DOMElement} A reference to layer.events.element. * element - {DOMElement} A reference to layer.events.element.
* *
* Supported map event types (in addition to those from <OpenLayers.Layer>): * Supported map event types (in addition to those from <OpenLayers.Layer.events>):
* beforefeatureadded - Triggered before a feature is added. Listeners * beforefeatureadded - Triggered before a feature is added. Listeners
* will receive an object with a *feature* property referencing the * will receive an object with a *feature* property referencing the
* feature to be added. To stop the feature from being added, a * feature to be added. To stop the feature from being added, a

View File

@@ -35,6 +35,9 @@ OpenLayers.Map = OpenLayers.Class({
}, },
/** /**
* APIProperty: events
* {<OpenLayers.Events>}
*
* Register a listener for a particular event with the following syntax: * Register a listener for a particular event with the following syntax:
* (code) * (code)
* map.events.register(type, obj, listener); * map.events.register(type, obj, listener);
@@ -44,43 +47,42 @@ OpenLayers.Map = OpenLayers.Class({
* properties of this event depends on exactly what happened. * properties of this event depends on exactly what happened.
* *
* All event objects have at least the following properties: * All event objects have at least the following properties:
* - *object* {Object} A reference to map.events.object. * object - {Object} A reference to map.events.object.
* - *element* {DOMElement} A reference to map.events.element. * element - {DOMElement} A reference to map.events.element.
* *
* Browser events have the following additional properties: * Browser events have the following additional properties:
* - *xy* {<OpenLayers.Pixel>} The pixel location of the event (relative * xy - {<OpenLayers.Pixel>} The pixel location of the event (relative
* to the the map viewport). * to the the map viewport).
* - other properties that come with browser events
* *
* Supported map event types: * Supported map event types:
* - *preaddlayer* triggered before a layer has been added. The event * preaddlayer - triggered before a layer has been added. The event
* object will include a *layer* property that references the layer * object will include a *layer* property that references the layer
* to be added. When a listener returns "false" the adding will be * to be added. When a listener returns "false" the adding will be
* aborted. * aborted.
* - *addlayer* triggered after a layer has been added. The event object * addlayer - triggered after a layer has been added. The event object
* will include a *layer* property that references the added layer. * will include a *layer* property that references the added layer.
* - *preremovelayer* triggered before a layer has been removed. The event * preremovelayer - triggered before a layer has been removed. The event
* object will include a *layer* property that references the layer * object will include a *layer* property that references the layer
* to be removed. When a listener returns "false" the removal will be * to be removed. When a listener returns "false" the removal will be
* aborted. * aborted.
* - *removelayer* triggered after a layer has been removed. The event * removelayer - triggered after a layer has been removed. The event
* object will include a *layer* property that references the removed * object will include a *layer* property that references the removed
* layer. * layer.
* - *changelayer* triggered after a layer name change, order change, * changelayer* triggered after a layer name change, order change,
* opacity change, params change, visibility change (due to resolution * opacity change, params change, visibility change (due to resolution
* thresholds) or attribution change (due to extent change). Listeners * thresholds) or attribution change (due to extent change). Listeners
* will receive an event object with *layer* and *property* properties. * will receive an event object with *layer* and *property* properties.
* The *layer* property will be a reference to the changed layer. The * The *layer* property will be a reference to the changed layer. The
* *property* property will be a key to the changed property (name, * *property* property will be a key to the changed property (name,
* order, opacity, params, visibility or attribution). * order, opacity, params, visibility or attribution).
* - *movestart* triggered after the start of a drag, pan, or zoom * movestart* triggered after the start of a drag, pan, or zoom
* - *move* triggered after each drag, pan, or zoom * move - triggered after each drag, pan, or zoom
* - *moveend* triggered after a drag, pan, or zoom completes * moveend - triggered after a drag, pan, or zoom completes
* - *zoomend* triggered after a zoom completes * zoomend - triggered after a zoom completes
* - *mouseover* triggered after mouseover the map * mouseover - triggered after mouseover the map
* - *mouseout* triggered after mouseout the map * mouseout - triggered after mouseout the map
* - *mousemove* triggered after mousemove the map * mousemove - triggered after mousemove the map
* - *changebaselayer* triggered after the base layer changes * changebaselayer - triggered after the base layer changes
*/ */
/** /**

View File

@@ -20,15 +20,19 @@
OpenLayers.Strategy.Save = OpenLayers.Class(OpenLayers.Strategy, { OpenLayers.Strategy.Save = OpenLayers.Class(OpenLayers.Strategy, {
/** /**
* APIProperty: events
* {<OpenLayers.Events>} An events object that handles all
* events on the strategy object.
*
* Register a listener for a particular event with the following syntax: * Register a listener for a particular event with the following syntax:
* (code) * (code)
* strategy.events.register(type, obj, listener); * strategy.events.register(type, obj, listener);
* (end) * (end)
* *
* Supported event types: * Supported event types:
* - *start* Triggered before saving * start - Triggered before saving
* - *success* Triggered after a successful transaction * success - Triggered after a successful transaction
* - *fail* Triggered after a failed transaction * fail - Triggered after a failed transaction
* *
*/ */

View File

@@ -23,22 +23,25 @@
*/ */
OpenLayers.Tile = OpenLayers.Class({ OpenLayers.Tile = OpenLayers.Class({
/**
* Supported event types:
* - *beforedraw* Triggered before the tile is drawn. Used to defer
* drawing to an animation queue. To defer drawing, listeners need
* to return false, which will abort drawing. The queue handler needs
* to call <draw>(true) to actually draw the tile.
* - *loadstart* Triggered when tile loading starts.
* - *loadend* Triggered when tile loading ends.
* - *reload* Triggered when an already loading tile is reloaded.
* - *unload* Triggered before a tile is unloaded.
*/
/** /**
* APIProperty: events * APIProperty: events
* {<OpenLayers.Events>} An events object that handles all * {<OpenLayers.Events>} An events object that handles all
* events on the tile. * events on the tile.
*
* Register a listener for a particular event with the following syntax:
* (code)
* tile.events.register(type, obj, listener);
* (end)
*
* Supported event types:
* beforedraw - Triggered before the tile is drawn. Used to defer
* drawing to an animation queue. To defer drawing, listeners need
* to return false, which will abort drawing. The queue handler needs
* to call <draw>(true) to actually draw the tile.
* loadstart - Triggered when tile loading starts.
* loadend - Triggered when tile loading ends.
* reload - Triggered when an already loading tile is reloaded.
* unload - Triggered before a tile is unloaded.
*/ */
events: null, events: null,