Rename and move some interaction enums
This commit is contained in:
@@ -18,6 +18,7 @@ goog.require('ol.geom.MultiPoint');
|
|||||||
goog.require('ol.geom.MultiPolygon');
|
goog.require('ol.geom.MultiPolygon');
|
||||||
goog.require('ol.geom.Point');
|
goog.require('ol.geom.Point');
|
||||||
goog.require('ol.geom.Polygon');
|
goog.require('ol.geom.Polygon');
|
||||||
|
goog.require('ol.interaction.DrawEventType');
|
||||||
goog.require('ol.interaction.Pointer');
|
goog.require('ol.interaction.Pointer');
|
||||||
goog.require('ol.interaction.Property');
|
goog.require('ol.interaction.Property');
|
||||||
goog.require('ol.layer.Vector');
|
goog.require('ol.layer.Vector');
|
||||||
@@ -483,7 +484,7 @@ ol.interaction.Draw.prototype.startDrawing_ = function(event) {
|
|||||||
this.sketchFeature_.setGeometry(geometry);
|
this.sketchFeature_.setGeometry(geometry);
|
||||||
this.updateSketchFeatures_();
|
this.updateSketchFeatures_();
|
||||||
this.dispatchEvent(new ol.interaction.Draw.Event(
|
this.dispatchEvent(new ol.interaction.Draw.Event(
|
||||||
ol.interaction.Draw.EventType_.DRAWSTART, this.sketchFeature_));
|
ol.interaction.DrawEventType.DRAWSTART, this.sketchFeature_));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -609,7 +610,7 @@ ol.interaction.Draw.prototype.removeLastPoint = function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Stop drawing and add the sketch feature to the target layer.
|
* Stop drawing and add the sketch feature to the target layer.
|
||||||
* The {@link ol.interaction.Draw.EventType_.DRAWEND} event is dispatched before
|
* The {@link ol.interaction.DrawEventType.DRAWEND} event is dispatched before
|
||||||
* inserting the feature.
|
* inserting the feature.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -639,7 +640,7 @@ ol.interaction.Draw.prototype.finishDrawing = function() {
|
|||||||
|
|
||||||
// First dispatch event to allow full set up of feature
|
// First dispatch event to allow full set up of feature
|
||||||
this.dispatchEvent(new ol.interaction.Draw.Event(
|
this.dispatchEvent(new ol.interaction.Draw.Event(
|
||||||
ol.interaction.Draw.EventType_.DRAWEND, sketchFeature));
|
ol.interaction.DrawEventType.DRAWEND, sketchFeature));
|
||||||
|
|
||||||
// Then insert feature
|
// Then insert feature
|
||||||
if (this.features_) {
|
if (this.features_) {
|
||||||
@@ -686,7 +687,7 @@ ol.interaction.Draw.prototype.extend = function(feature) {
|
|||||||
this.sketchCoords_.push(last.slice());
|
this.sketchCoords_.push(last.slice());
|
||||||
this.updateSketchFeatures_();
|
this.updateSketchFeatures_();
|
||||||
this.dispatchEvent(new ol.interaction.Draw.Event(
|
this.dispatchEvent(new ol.interaction.Draw.Event(
|
||||||
ol.interaction.Draw.EventType_.DRAWSTART, this.sketchFeature_));
|
ol.interaction.DrawEventType.DRAWSTART, this.sketchFeature_));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -842,7 +843,7 @@ ol.interaction.Draw.Mode_ = {
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.events.Event}
|
* @extends {ol.events.Event}
|
||||||
* @implements {oli.DrawEvent}
|
* @implements {oli.DrawEvent}
|
||||||
* @param {ol.interaction.Draw.EventType_} type Type.
|
* @param {ol.interaction.DrawEventType} type Type.
|
||||||
* @param {ol.Feature} feature The feature drawn.
|
* @param {ol.Feature} feature The feature drawn.
|
||||||
*/
|
*/
|
||||||
ol.interaction.Draw.Event = function(type, feature) {
|
ol.interaction.Draw.Event = function(type, feature) {
|
||||||
@@ -858,23 +859,3 @@ ol.interaction.Draw.Event = function(type, feature) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
ol.inherits(ol.interaction.Draw.Event, ol.events.Event);
|
ol.inherits(ol.interaction.Draw.Event, ol.events.Event);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @enum {string}
|
|
||||||
* @private
|
|
||||||
*/
|
|
||||||
ol.interaction.Draw.EventType_ = {
|
|
||||||
/**
|
|
||||||
* Triggered upon feature draw start
|
|
||||||
* @event ol.interaction.Draw.Event#drawstart
|
|
||||||
* @api stable
|
|
||||||
*/
|
|
||||||
DRAWSTART: 'drawstart',
|
|
||||||
/**
|
|
||||||
* Triggered upon feature draw end
|
|
||||||
* @event ol.interaction.Draw.Event#drawend
|
|
||||||
* @api stable
|
|
||||||
*/
|
|
||||||
DRAWEND: 'drawend'
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
goog.provide('ol.interaction.DrawEventType');
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @enum {string}
|
||||||
|
*/
|
||||||
|
ol.interaction.DrawEventType = {
|
||||||
|
/**
|
||||||
|
* Triggered upon feature draw start
|
||||||
|
* @event ol.interaction.Draw.Event#drawstart
|
||||||
|
* @api stable
|
||||||
|
*/
|
||||||
|
DRAWSTART: 'drawstart',
|
||||||
|
/**
|
||||||
|
* Triggered upon feature draw end
|
||||||
|
* @event ol.interaction.Draw.Event#drawend
|
||||||
|
* @api stable
|
||||||
|
*/
|
||||||
|
DRAWEND: 'drawend'
|
||||||
|
};
|
||||||
@@ -15,6 +15,7 @@ goog.require('ol.events.condition');
|
|||||||
goog.require('ol.extent');
|
goog.require('ol.extent');
|
||||||
goog.require('ol.geom.GeometryType');
|
goog.require('ol.geom.GeometryType');
|
||||||
goog.require('ol.geom.Point');
|
goog.require('ol.geom.Point');
|
||||||
|
goog.require('ol.interaction.ModifyEventType');
|
||||||
goog.require('ol.interaction.Pointer');
|
goog.require('ol.interaction.Pointer');
|
||||||
goog.require('ol.layer.Vector');
|
goog.require('ol.layer.Vector');
|
||||||
goog.require('ol.source.Vector');
|
goog.require('ol.source.Vector');
|
||||||
@@ -214,7 +215,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.interaction.Modify.EventType_.MODIFYSTART, this.features_, evt));
|
ol.interaction.ModifyEventType.MODIFYSTART, this.features_, evt));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -633,7 +634,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.interaction.Modify.EventType_.MODIFYEND, this.features_, evt));
|
ol.interaction.ModifyEventType.MODIFYEND, this.features_, evt));
|
||||||
this.modified_ = false;
|
this.modified_ = false;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -828,7 +829,7 @@ ol.interaction.Modify.prototype.removePoint = function() {
|
|||||||
this.willModifyFeatures_(evt);
|
this.willModifyFeatures_(evt);
|
||||||
this.removeVertex_();
|
this.removeVertex_();
|
||||||
this.dispatchEvent(new ol.interaction.Modify.Event(
|
this.dispatchEvent(new ol.interaction.Modify.Event(
|
||||||
ol.interaction.Modify.EventType_.MODIFYEND, this.features_, evt));
|
ol.interaction.ModifyEventType.MODIFYEND, this.features_, evt));
|
||||||
this.modified_ = false;
|
this.modified_ = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1004,7 +1005,7 @@ ol.interaction.Modify.getDefaultStyleFunction = function() {
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.events.Event}
|
* @extends {ol.events.Event}
|
||||||
* @implements {oli.ModifyEvent}
|
* @implements {oli.ModifyEvent}
|
||||||
* @param {ol.interaction.Modify.EventType_} type Type.
|
* @param {ol.interaction.ModifyEventType} 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}.
|
||||||
@@ -1028,23 +1029,3 @@ 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}
|
|
||||||
* @private
|
|
||||||
*/
|
|
||||||
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'
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
goog.provide('ol.interaction.ModifyEventType');
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @enum {string}
|
||||||
|
*/
|
||||||
|
ol.interaction.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'
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user