Remove last reference to ol.MapBrowserPointerEvent from the API
This is a bit of a hack, but in fact it improves the situation for the end user because it asserts the correct event type instead of failing silently.
This commit is contained in:
@@ -202,12 +202,14 @@ ol.events.condition.targetNotEditable = function(mapBrowserEvent) {
|
|||||||
/**
|
/**
|
||||||
* Return `true` if the event originates from a mouse device.
|
* Return `true` if the event originates from a mouse device.
|
||||||
*
|
*
|
||||||
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Map browser event.
|
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||||
* @return {boolean} True if the event originates from a mouse device.
|
* @return {boolean} True if the event originates from a mouse device.
|
||||||
* @api stable
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.events.condition.mouseOnly = function(mapBrowserEvent) {
|
ol.events.condition.mouseOnly = function(mapBrowserEvent) {
|
||||||
// see http://www.w3.org/TR/pointerevents/#widl-PointerEvent-pointerType
|
// see http://www.w3.org/TR/pointerevents/#widl-PointerEvent-pointerType
|
||||||
|
goog.asserts.assertInstanceof(mapBrowserEvent, ol.MapBrowserPointerEvent,
|
||||||
|
'Requires an ol.MapBrowserPointerEvent to work.');
|
||||||
return mapBrowserEvent.pointerEvent.pointerType == 'mouse';
|
return mapBrowserEvent.pointerEvent.pointerType == 'mouse';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user