diff --git a/changelog/upgrade-notes.md b/changelog/upgrade-notes.md index d70878569e..0357b9a517 100644 --- a/changelog/upgrade-notes.md +++ b/changelog/upgrade-notes.md @@ -17,6 +17,7 @@ A number of internal types have been renamed. This will not affect those who us * rename `ol.OverlayProperty` to `ol.Overlay.Property` * rename `ol.control.MousePositionProperty` to `ol.control.MousePosition.Property` * rename `ol.format.IGCZ` to `ol.format.IGC.Z` + * rename `ol.interaction.ExtentEvent` to `ol.interaction.Extent.Event` * rename `ol.interaction.DragAndDropEvent` to `ol.interaction.DragAndDrop.Event` * rename `ol.interaction.DragAndDropEventType` to `ol.interaction.DragAndDrop.EventType` * rename `ol.interaction.TranslateEvent` to `ol.interaction.Translate.Event` diff --git a/src/ol/interaction/extent.js b/src/ol/interaction/extent.js index ddf6f0526f..c8aec8da7e 100644 --- a/src/ol/interaction/extent.js +++ b/src/ol/interaction/extent.js @@ -1,5 +1,4 @@ goog.provide('ol.interaction.Extent'); -goog.provide('ol.interaction.ExtentEvent'); goog.provide('ol.interaction.ExtentEventType'); goog.require('ol'); @@ -24,33 +23,12 @@ goog.require('ol.style.Style'); ol.interaction.ExtentEventType = { /** * Triggered after the extent is changed - * @event ol.interaction.ExtentEvent + * @event ol.interaction.Extent.Event * @api */ EXTENTCHANGED: 'extentchanged' }; -/** - * @classdesc - * Events emitted by {@link ol.interaction.Extent} instances are instances of - * this type. - * - * @constructor - * @param {ol.Extent} extent the new extent - * @extends {ol.events.Event} - */ -ol.interaction.ExtentEvent = function(extent) { - ol.events.Event.call(this, ol.interaction.ExtentEventType.EXTENTCHANGED); - - /** - * The current extent. - * @type {ol.Extent} - * @api - */ - this.extent_ = extent; -}; - -ol.inherits(ol.interaction.ExtentEvent, ol.events.Event); /** * @classdesc @@ -60,7 +38,7 @@ ol.inherits(ol.interaction.ExtentEvent, ol.events.Event); * * @constructor * @extends {ol.interaction.Pointer} - * @fires ol.interaction.ExtentEvent + * @fires ol.interaction.Extent.Event * @param {olx.interaction.ExtentOptions=} opt_options Options. * @api */ @@ -473,5 +451,27 @@ ol.interaction.Extent.prototype.setExtent = function(extent) { //Null extent means no bbox this.extent_ = extent ? extent : null; this.createOrUpdateExtentFeature_(extent); - this.dispatchEvent(new ol.interaction.ExtentEvent(this.extent_)); + this.dispatchEvent(new ol.interaction.Extent.Event(this.extent_)); }; + + +/** + * @classdesc + * Events emitted by {@link ol.interaction.Extent} instances are instances of + * this type. + * + * @constructor + * @param {ol.Extent} extent the new extent + * @extends {ol.events.Event} + */ +ol.interaction.Extent.Event = function(extent) { + ol.events.Event.call(this, ol.interaction.ExtentEventType.EXTENTCHANGED); + + /** + * The current extent. + * @type {ol.Extent} + * @api + */ + this.extent_ = extent; +}; +ol.inherits(ol.interaction.Extent.Event, ol.events.Event);