Private enum for draw event types

This commit is contained in:
Tim Schaub
2016-12-27 13:29:29 -07:00
parent f21d5fcdb0
commit 4d52dcda22

View File

@@ -484,7 +484,7 @@ ol.interaction.Draw.prototype.startDrawing_ = function(event) {
this.sketchFeature_.setGeometry(geometry);
this.updateSketchFeatures_();
this.dispatchEvent(new ol.interaction.Draw.Event(
ol.interaction.Draw.EventType.DRAWSTART, this.sketchFeature_));
ol.interaction.Draw.EventType_.DRAWSTART, this.sketchFeature_));
};
@@ -611,7 +611,7 @@ ol.interaction.Draw.prototype.removeLastPoint = function() {
/**
* 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.Draw.EventType_.DRAWEND} event is dispatched before
* inserting the feature.
* @api
*/
@@ -641,7 +641,7 @@ ol.interaction.Draw.prototype.finishDrawing = function() {
// First dispatch event to allow full set up of feature
this.dispatchEvent(new ol.interaction.Draw.Event(
ol.interaction.Draw.EventType.DRAWEND, sketchFeature));
ol.interaction.Draw.EventType_.DRAWEND, sketchFeature));
// Then insert feature
if (this.features_) {
@@ -692,7 +692,7 @@ ol.interaction.Draw.prototype.extend = function(feature) {
this.sketchCoords_.push(last.slice());
this.updateSketchFeatures_();
this.dispatchEvent(new ol.interaction.Draw.Event(
ol.interaction.Draw.EventType.DRAWSTART, this.sketchFeature_));
ol.interaction.Draw.EventType_.DRAWSTART, this.sketchFeature_));
};
@@ -848,7 +848,7 @@ ol.interaction.Draw.Mode_ = {
* @constructor
* @extends {ol.events.Event}
* @implements {oli.DrawEvent}
* @param {ol.interaction.Draw.EventType} type Type.
* @param {ol.interaction.Draw.EventType_} type Type.
* @param {ol.Feature} feature The feature drawn.
*/
ol.interaction.Draw.Event = function(type, feature) {
@@ -868,8 +868,9 @@ ol.inherits(ol.interaction.Draw.Event, ol.events.Event);
/**
* @enum {string}
* @private
*/
ol.interaction.Draw.EventType = {
ol.interaction.Draw.EventType_ = {
/**
* Triggered upon feature draw start
* @event ol.interaction.Draw.Event#drawstart