Rename ol.ModifyEventType to ol.interaction.Modify.EventType

This commit is contained in:
Frederic Junod
2016-09-07 16:57:03 +02:00
parent c6a9bc66d6
commit f860c94840
2 changed files with 24 additions and 23 deletions
+1
View File
@@ -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.layer.VectorTileRenderType` to `ol.layer.VectorTile.RenderType`
* rename `ol.MapEventType` to `ol.MapEvent.Type` * rename `ol.MapEventType` to `ol.MapEvent.Type`
* rename `ol.MapProperty` to `ol.Map.Property` * rename `ol.MapProperty` to `ol.Map.Property`
* rename `ol.ModifyEventType` to `ol.interaction.Modify.EventType`
* rename `ol.RendererType` to `ol.renderer.Type` * rename `ol.RendererType` to `ol.renderer.Type`
* rename `ol.source.ImageEvent` to `ol.source.Image.Event` * rename `ol.source.ImageEvent` to `ol.source.Image.Event`
* rename `ol.source.ImageEventType` to `ol.source.Image.EventType` * rename `ol.source.ImageEventType` to `ol.source.Image.EventType`
+23 -23
View File
@@ -22,25 +22,6 @@ goog.require('ol.structs.RBush');
goog.require('ol.style.Style'); 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 * @classdesc
* Interaction for modifying feature geometries. * Interaction for modifying feature geometries.
@@ -233,7 +214,7 @@ ol.interaction.Modify.prototype.willModifyFeatures_ = function(evt) {
if (!this.modified_) { if (!this.modified_) {
this.modified_ = true; this.modified_ = true;
this.dispatchEvent(new ol.interaction.Modify.Event( 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_) { if (this.modified_) {
this.dispatchEvent(new ol.interaction.Modify.Event( this.dispatchEvent(new ol.interaction.Modify.Event(
ol.ModifyEventType.MODIFYEND, this.features_, evt)); ol.interaction.Modify.EventType.MODIFYEND, this.features_, evt));
this.modified_ = false; this.modified_ = false;
} }
return false; return false;
@@ -838,7 +819,7 @@ ol.interaction.Modify.prototype.removePoint = function() {
this.willModifyFeatures_(evt); this.willModifyFeatures_(evt);
handled = this.removeVertex_(); handled = this.removeVertex_();
this.dispatchEvent(new ol.interaction.Modify.Event( this.dispatchEvent(new ol.interaction.Modify.Event(
ol.ModifyEventType.MODIFYEND, this.features_, evt)); ol.interaction.Modify.EventType.MODIFYEND, this.features_, evt));
this.modified_ = false; this.modified_ = false;
} }
return handled; return handled;
@@ -1015,7 +996,7 @@ ol.interaction.Modify.getDefaultStyleFunction = function() {
* @constructor * @constructor
* @extends {ol.events.Event} * @extends {ol.events.Event}
* @implements {oli.ModifyEvent} * @implements {oli.ModifyEvent}
* @param {ol.ModifyEventType} type Type. * @param {ol.interaction.Modify.EventType} type Type.
* @param {ol.Collection.<ol.Feature>} features The features modified. * @param {ol.Collection.<ol.Feature>} features The features modified.
* @param {ol.MapBrowserPointerEvent} mapBrowserPointerEvent Associated * @param {ol.MapBrowserPointerEvent} mapBrowserPointerEvent Associated
* {@link ol.MapBrowserPointerEvent}. * {@link ol.MapBrowserPointerEvent}.
@@ -1039,3 +1020,22 @@ ol.interaction.Modify.Event = function(type, features, mapBrowserPointerEvent) {
this.mapBrowserEvent = mapBrowserPointerEvent; this.mapBrowserEvent = mapBrowserPointerEvent;
}; };
ol.inherits(ol.interaction.Modify.Event, ol.events.Event); 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'
};