Merge pull request #3871 from ahocevar/change-event

Document change events properly
This commit is contained in:
Andreas Hocevar
2015-07-18 15:41:05 +02:00
8 changed files with 32 additions and 16 deletions
+1 -1
View File
@@ -68,7 +68,7 @@ var self = this;
} }
?> ?>
<li class="<?js= (eventDoclet || data).stability !== 'stable' ? 'unstable' : '' ?>"> <li class="<?js= (eventDoclet || data).stability !== 'stable' ? 'unstable' : '' ?>">
<code><?js= self.linkto(f, type) ?></code> <code><?js= eventClassName ? self.linkto(f, type) : type ?></code>
<?js if (eventClassName) { <?js if (eventClassName) {
var eventClass = self.find({longname: eventClassName})[0]; var eventClass = self.find({longname: eventClassName})[0];
if (eventClass) { ?> if (eventClass) { ?>
+3 -1
View File
@@ -67,9 +67,11 @@ ol.DeviceOrientationProperty = {
* *
* @see http://www.w3.org/TR/orientation-event/ * @see http://www.w3.org/TR/orientation-event/
* *
* To get notified of device orientation changes, register a listener for the
* generic `change` event on your `ol.DeviceOrientation` instance.
*
* @constructor * @constructor
* @extends {ol.Object} * @extends {ol.Object}
* @fires change Triggered when the device orientation changes.
* @param {olx.DeviceOrientationOptions=} opt_options Options. * @param {olx.DeviceOrientationOptions=} opt_options Options.
* @api * @api
*/ */
+3 -1
View File
@@ -39,6 +39,9 @@ ol.GeolocationProperty = {
* The [Geolocation API](http://www.w3.org/TR/geolocation-API/) * The [Geolocation API](http://www.w3.org/TR/geolocation-API/)
* is used to locate a user's position. * is used to locate a user's position.
* *
* To get notified of position changes, register a listener for the generic
* `change` event on your instance of `ol.Geolocation`.
*
* Example: * Example:
* *
* var geolocation = new ol.Geolocation({ * var geolocation = new ol.Geolocation({
@@ -52,7 +55,6 @@ ol.GeolocationProperty = {
* *
* @constructor * @constructor
* @extends {ol.Object} * @extends {ol.Object}
* @fires change Triggered when the position changes.
* @param {olx.GeolocationOptions=} opt_options Options. * @param {olx.GeolocationOptions=} opt_options Options.
* @api stable * @api stable
*/ */
+3 -1
View File
@@ -50,9 +50,11 @@ ol.geom.GeometryLayout = {
* instantiated in apps. * instantiated in apps.
* Base class for vector geometries. * Base class for vector geometries.
* *
* To get notified of changes to the geometry, register a listener for the
* generic `change` event on your geometry instance.
*
* @constructor * @constructor
* @extends {ol.Object} * @extends {ol.Object}
* @fires change Triggered when the geometry changes.
* @api stable * @api stable
*/ */
ol.geom.Geometry = function() { ol.geom.Geometry = function() {
+2 -1
View File
@@ -19,10 +19,11 @@ goog.require('ol.source.State');
* Layers group together those properties that pertain to how the data is to be * Layers group together those properties that pertain to how the data is to be
* displayed, irrespective of the source of that data. * displayed, irrespective of the source of that data.
* *
* A generic `change` event is fired when the state of the source changes.
*
* @constructor * @constructor
* @extends {ol.layer.Base} * @extends {ol.layer.Base}
* @fires ol.render.Event * @fires ol.render.Event
* @fires change Triggered when the state of the source changes.
* @param {olx.layer.LayerOptions} options Layer options. * @param {olx.layer.LayerOptions} options Layer options.
* @api stable * @api stable
*/ */
+2 -1
View File
@@ -29,9 +29,10 @@ ol.layer.GroupProperty = {
* @classdesc * @classdesc
* A {@link ol.Collection} of layers that are handled together. * A {@link ol.Collection} of layers that are handled together.
* *
* A generic `change` event is triggered when the group/Collection changes.
*
* @constructor * @constructor
* @extends {ol.layer.Base} * @extends {ol.layer.Base}
* @fires change Triggered when the group/Collection changes.
* @param {olx.layer.GroupOptions=} opt_options Layer options. * @param {olx.layer.GroupOptions=} opt_options Layer options.
* @api stable * @api stable
*/ */
+8 -1
View File
@@ -16,6 +16,7 @@ goog.require('goog.events.EventType');
* *
* @constructor * @constructor
* @extends {goog.events.EventTarget} * @extends {goog.events.EventTarget}
* @fires change
* @suppress {checkStructDictInheritance} * @suppress {checkStructDictInheritance}
* @struct * @struct
* @api stable * @api stable
@@ -46,7 +47,6 @@ ol.Observable.unByKey = function(key) {
/** /**
* Increases the revision counter and dispatches a 'change' event. * Increases the revision counter and dispatches a 'change' event.
* @fires change
* @api * @api
*/ */
ol.Observable.prototype.changed = function() { ol.Observable.prototype.changed = function() {
@@ -55,6 +55,13 @@ ol.Observable.prototype.changed = function() {
}; };
/**
* Triggered when the revision counter is increased.
* @event change
* @api
*/
/** /**
* @return {number} Revision. * @return {number} Revision.
* @api * @api
+2 -1
View File
@@ -37,9 +37,10 @@ ol.source.SourceOptions;
* instantiated in apps. * instantiated in apps.
* Base class for {@link ol.layer.Layer} sources. * Base class for {@link ol.layer.Layer} sources.
* *
* A generic `change` event is triggered when the state of the source changes.
*
* @constructor * @constructor
* @extends {ol.Object} * @extends {ol.Object}
* @fires change Triggered when the state of the source changes.
* @param {ol.source.SourceOptions} options Source options. * @param {ol.source.SourceOptions} options Source options.
* @api stable * @api stable
*/ */