Convert ol.interaction.DragAndDropEvent#get* methods into properties
This commit is contained in:
@@ -115,8 +115,8 @@ var map = new ol.Map({
|
||||
|
||||
dragAndDropInteraction.on('addfeatures', function(event) {
|
||||
var vectorSource = new ol.source.Vector({
|
||||
features: event.getFeatures(),
|
||||
projection: event.getProjection()
|
||||
features: event.features,
|
||||
projection: event.projection
|
||||
});
|
||||
map.getLayers().push(new ol.layer.Image({
|
||||
source: new ol.source.ImageVector({
|
||||
|
||||
@@ -114,8 +114,8 @@ var map = new ol.Map({
|
||||
|
||||
dragAndDropInteraction.on('addfeatures', function(event) {
|
||||
var vectorSource = new ol.source.Vector({
|
||||
features: event.getFeatures(),
|
||||
projection: event.getProjection()
|
||||
features: event.features,
|
||||
projection: event.projection
|
||||
});
|
||||
map.getLayers().push(new ol.layer.Vector({
|
||||
source: vectorSource,
|
||||
|
||||
@@ -29,3 +29,16 @@ oli.control.Control = function() {};
|
||||
* @return {undefined} Undefined.
|
||||
*/
|
||||
oli.control.Control.prototype.setMap = function(map) {};
|
||||
|
||||
|
||||
|
||||
/** @interface */
|
||||
oli.interaction.DragAndDropEvent = function() {};
|
||||
|
||||
|
||||
/** @type {Array.<ol.Feature>} */
|
||||
oli.interaction.DragAndDropEvent.prototype.features;
|
||||
|
||||
|
||||
/** @type {ol.proj.Projection} */
|
||||
oli.interaction.DragAndDropEvent.prototype.projection;
|
||||
|
||||
@@ -1,4 +1 @@
|
||||
@exportSymbol ol.interaction.DragAndDrop
|
||||
|
||||
@exportProperty ol.interaction.DragAndDropEvent.prototype.getFeatures
|
||||
@exportProperty ol.interaction.DragAndDropEvent.prototype.getProjection
|
||||
|
||||
@@ -183,6 +183,7 @@ ol.interaction.DragAndDropEventType = {
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {goog.events.Event}
|
||||
* @implements {oli.interaction.DragAndDropEvent}
|
||||
* @param {ol.interaction.DragAndDropEventType} type Type.
|
||||
* @param {Object=} opt_target Target.
|
||||
* @param {Array.<ol.Feature>=} opt_features Features.
|
||||
@@ -194,32 +195,14 @@ ol.interaction.DragAndDropEvent =
|
||||
goog.base(this, type, opt_target);
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<ol.Feature>|undefined}
|
||||
*/
|
||||
this.features_ = opt_features;
|
||||
this.features = opt_features;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.proj.Projection|undefined}
|
||||
*/
|
||||
this.projection_ = opt_projection;
|
||||
this.projection = opt_projection;
|
||||
|
||||
};
|
||||
goog.inherits(ol.interaction.DragAndDropEvent, goog.events.Event);
|
||||
|
||||
|
||||
/**
|
||||
* @return {Array.<ol.Feature>|undefined} Features.
|
||||
*/
|
||||
ol.interaction.DragAndDropEvent.prototype.getFeatures = function() {
|
||||
return this.features_;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {ol.proj.Projection|undefined} Projection.
|
||||
*/
|
||||
ol.interaction.DragAndDropEvent.prototype.getProjection = function() {
|
||||
return this.projection_;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user