From f860c94840c9f01c4dda57e8b78354b6a12be632 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Wed, 7 Sep 2016 16:57:03 +0200 Subject: [PATCH] Rename ol.ModifyEventType to ol.interaction.Modify.EventType --- changelog/upgrade-notes.md | 1 + src/ol/interaction/modify.js | 46 ++++++++++++++++++------------------ 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/changelog/upgrade-notes.md b/changelog/upgrade-notes.md index dca6fc5f64..d0d1c9e152 100644 --- a/changelog/upgrade-notes.md +++ b/changelog/upgrade-notes.md @@ -35,6 +35,7 @@ A number of internal types have been renamed. This will not affect those who us * rename `ol.layer.VectorTileRenderType` to `ol.layer.VectorTile.RenderType` * rename `ol.MapEventType` to `ol.MapEvent.Type` * rename `ol.MapProperty` to `ol.Map.Property` + * rename `ol.ModifyEventType` to `ol.interaction.Modify.EventType` * rename `ol.RendererType` to `ol.renderer.Type` * rename `ol.source.ImageEvent` to `ol.source.Image.Event` * rename `ol.source.ImageEventType` to `ol.source.Image.EventType` diff --git a/src/ol/interaction/modify.js b/src/ol/interaction/modify.js index 8b6f1fbc30..d95c5eb49e 100644 --- a/src/ol/interaction/modify.js +++ b/src/ol/interaction/modify.js @@ -22,25 +22,6 @@ goog.require('ol.structs.RBush'); goog.require('ol.style.Style'); -/** - * @enum {string} - */ -ol.ModifyEventType = { - /** - * Triggered upon feature modification start - * @event ol.interaction.Modify.Event#modifystart - * @api - */ - MODIFYSTART: 'modifystart', - /** - * Triggered upon feature modification end - * @event ol.interaction.Modify.Event#modifyend - * @api - */ - MODIFYEND: 'modifyend' -}; - - /** * @classdesc * Interaction for modifying feature geometries. @@ -233,7 +214,7 @@ ol.interaction.Modify.prototype.willModifyFeatures_ = function(evt) { if (!this.modified_) { this.modified_ = true; this.dispatchEvent(new ol.interaction.Modify.Event( - ol.ModifyEventType.MODIFYSTART, this.features_, evt)); + ol.interaction.Modify.EventType.MODIFYSTART, this.features_, evt)); } }; @@ -640,7 +621,7 @@ ol.interaction.Modify.handleUpEvent_ = function(evt) { } if (this.modified_) { this.dispatchEvent(new ol.interaction.Modify.Event( - ol.ModifyEventType.MODIFYEND, this.features_, evt)); + ol.interaction.Modify.EventType.MODIFYEND, this.features_, evt)); this.modified_ = false; } return false; @@ -838,7 +819,7 @@ ol.interaction.Modify.prototype.removePoint = function() { this.willModifyFeatures_(evt); handled = this.removeVertex_(); this.dispatchEvent(new ol.interaction.Modify.Event( - ol.ModifyEventType.MODIFYEND, this.features_, evt)); + ol.interaction.Modify.EventType.MODIFYEND, this.features_, evt)); this.modified_ = false; } return handled; @@ -1015,7 +996,7 @@ ol.interaction.Modify.getDefaultStyleFunction = function() { * @constructor * @extends {ol.events.Event} * @implements {oli.ModifyEvent} - * @param {ol.ModifyEventType} type Type. + * @param {ol.interaction.Modify.EventType} type Type. * @param {ol.Collection.} features The features modified. * @param {ol.MapBrowserPointerEvent} mapBrowserPointerEvent Associated * {@link ol.MapBrowserPointerEvent}. @@ -1039,3 +1020,22 @@ ol.interaction.Modify.Event = function(type, features, mapBrowserPointerEvent) { this.mapBrowserEvent = mapBrowserPointerEvent; }; ol.inherits(ol.interaction.Modify.Event, ol.events.Event); + + +/** + * @enum {string} + */ +ol.interaction.Modify.EventType = { + /** + * Triggered upon feature modification start + * @event ol.interaction.Modify.Event#modifystart + * @api + */ + MODIFYSTART: 'modifystart', + /** + * Triggered upon feature modification end + * @event ol.interaction.Modify.Event#modifyend + * @api + */ + MODIFYEND: 'modifyend' +};