Merge pull request #3757 from bjornharrtell/selectevent-browser
Add mapBrowserEvent as a member of ol.SelectEvent
This commit is contained in:
+13
-7
@@ -120,21 +120,27 @@ oli.MapEvent.prototype.frameState;
|
|||||||
/**
|
/**
|
||||||
* @interface
|
* @interface
|
||||||
*/
|
*/
|
||||||
oli.SelectEvent = function() {};
|
oli.SelectEvent = function() {};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Array.<ol.Feature>}
|
* @type {Array.<ol.Feature>}
|
||||||
*/
|
*/
|
||||||
oli.SelectEvent.prototype.deselected;
|
oli.SelectEvent.prototype.deselected;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Array.<ol.Feature>}
|
* @type {Array.<ol.Feature>}
|
||||||
*/
|
*/
|
||||||
oli.SelectEvent.prototype.selected;
|
oli.SelectEvent.prototype.selected;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {ol.MapBrowserEvent}
|
||||||
|
*/
|
||||||
|
oli.SelectEvent.prototype.mapBrowserEvent;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object}
|
* @type {Object}
|
||||||
|
|||||||
@@ -46,11 +46,13 @@ ol.interaction.SelectFilterFunction;
|
|||||||
* @param {string} type The event type.
|
* @param {string} type The event type.
|
||||||
* @param {Array.<ol.Feature>} selected Selected features.
|
* @param {Array.<ol.Feature>} selected Selected features.
|
||||||
* @param {Array.<ol.Feature>} deselected Deselected features.
|
* @param {Array.<ol.Feature>} deselected Deselected features.
|
||||||
|
* @param {ol.MapBrowserEvent} mapBrowserEvent Associated
|
||||||
|
* {@link ol.MapBrowserEvent}.
|
||||||
* @implements {oli.SelectEvent}
|
* @implements {oli.SelectEvent}
|
||||||
* @extends {goog.events.Event}
|
* @extends {goog.events.Event}
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
ol.SelectEvent = function(type, selected, deselected) {
|
ol.SelectEvent = function(type, selected, deselected, mapBrowserEvent) {
|
||||||
goog.base(this, type);
|
goog.base(this, type);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -66,6 +68,13 @@ ol.SelectEvent = function(type, selected, deselected) {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
this.deselected = deselected;
|
this.deselected = deselected;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Associated {@link ol.MapBrowserEvent}.
|
||||||
|
* @type {ol.MapBrowserEvent}
|
||||||
|
* @api
|
||||||
|
*/
|
||||||
|
this.mapBrowserEvent = mapBrowserEvent;
|
||||||
};
|
};
|
||||||
goog.inherits(ol.SelectEvent, goog.events.Event);
|
goog.inherits(ol.SelectEvent, goog.events.Event);
|
||||||
|
|
||||||
@@ -266,7 +275,8 @@ ol.interaction.Select.handleEvent = function(mapBrowserEvent) {
|
|||||||
}
|
}
|
||||||
if (change) {
|
if (change) {
|
||||||
this.dispatchEvent(
|
this.dispatchEvent(
|
||||||
new ol.SelectEvent(ol.SelectEventType.SELECT, selected, deselected));
|
new ol.SelectEvent(ol.SelectEventType.SELECT, selected, deselected,
|
||||||
|
mapBrowserEvent));
|
||||||
}
|
}
|
||||||
return ol.events.condition.pointerMove(mapBrowserEvent);
|
return ol.events.condition.pointerMove(mapBrowserEvent);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user