PointerInteraction uses MapBrowserPointerEvent not MapBrowserEvent

This commit is contained in:
tsauerwein
2014-02-26 11:54:28 +01:00
parent a696150470
commit fca9c50a3f
3 changed files with 21 additions and 17 deletions

View File

@@ -109,19 +109,15 @@ goog.inherits(ol.interaction.DragBox, ol.interaction.PointerInteraction);
/**
* Returns true if the pointer event is generated by a mouse pointer.
* @param {ol.MapBrowserEvent} mapBrowserEvent
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent
* @return {boolean}
*/
ol.interaction.DragBox.prototype.isMousePointer =
function(mapBrowserEvent) {
goog.asserts.assertInstanceof(mapBrowserEvent, ol.MapBrowserPointerEvent);
var mapBrowserPointerEvent =
/** @type {ol.MapBrowserPointerEvent} */ (mapBrowserEvent);
/* pointerId must be 1 for mouse devices,
* see: http://www.w3.org/Submission/pointer-events/#pointerevent-interface
*/
return mapBrowserPointerEvent.pointerEvent.pointerId == 1;
return mapBrowserEvent.pointerEvent.pointerId == 1;
};