Merge pull request #2622 from elemoine/apistable-condition
Add @api stable annotations to ol.events.condition
This commit is contained in:
@@ -13,7 +13,7 @@ goog.require('ol.MapBrowserPointerEvent');
|
||||
* `{boolean}`. If the condition is met, true should be returned.
|
||||
*
|
||||
* @typedef {function(ol.MapBrowserEvent): boolean}
|
||||
* @api
|
||||
* @api stable
|
||||
*/
|
||||
ol.events.ConditionType;
|
||||
|
||||
@@ -21,7 +21,7 @@ ol.events.ConditionType;
|
||||
/**
|
||||
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if only the alt key is pressed.
|
||||
* @api
|
||||
* @api stable
|
||||
*/
|
||||
ol.events.condition.altKeyOnly = function(mapBrowserEvent) {
|
||||
var browserEvent = mapBrowserEvent.browserEvent;
|
||||
@@ -35,7 +35,7 @@ ol.events.condition.altKeyOnly = function(mapBrowserEvent) {
|
||||
/**
|
||||
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if only the alt and shift keys are pressed.
|
||||
* @api
|
||||
* @api stable
|
||||
*/
|
||||
ol.events.condition.altShiftKeysOnly = function(mapBrowserEvent) {
|
||||
var browserEvent = mapBrowserEvent.browserEvent;
|
||||
@@ -51,7 +51,7 @@ ol.events.condition.altShiftKeysOnly = function(mapBrowserEvent) {
|
||||
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True.
|
||||
* @function
|
||||
* @api
|
||||
* @api stable
|
||||
*/
|
||||
ol.events.condition.always = goog.functions.TRUE;
|
||||
|
||||
@@ -59,7 +59,7 @@ ol.events.condition.always = goog.functions.TRUE;
|
||||
/**
|
||||
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if the event is a map `click` event.
|
||||
* @api
|
||||
* @api stable
|
||||
*/
|
||||
ol.events.condition.click = function(mapBrowserEvent) {
|
||||
return mapBrowserEvent.type == ol.MapBrowserEvent.EventType.CLICK;
|
||||
@@ -81,7 +81,7 @@ ol.events.condition.mouseMove = function(mapBrowserEvent) {
|
||||
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} False.
|
||||
* @function
|
||||
* @api
|
||||
* @api stable
|
||||
*/
|
||||
ol.events.condition.never = goog.functions.FALSE;
|
||||
|
||||
@@ -89,7 +89,7 @@ ol.events.condition.never = goog.functions.FALSE;
|
||||
/**
|
||||
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if the event is a map `singleclick` event.
|
||||
* @api
|
||||
* @api stable
|
||||
*/
|
||||
ol.events.condition.singleClick = function(mapBrowserEvent) {
|
||||
return mapBrowserEvent.type == ol.MapBrowserEvent.EventType.SINGLECLICK;
|
||||
@@ -99,7 +99,7 @@ ol.events.condition.singleClick = function(mapBrowserEvent) {
|
||||
/**
|
||||
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True only if there no modifier keys are pressed.
|
||||
* @api
|
||||
* @api stable
|
||||
*/
|
||||
ol.events.condition.noModifierKeys = function(mapBrowserEvent) {
|
||||
var browserEvent = mapBrowserEvent.browserEvent;
|
||||
@@ -113,7 +113,7 @@ ol.events.condition.noModifierKeys = function(mapBrowserEvent) {
|
||||
/**
|
||||
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if only the platform modifier key is pressed.
|
||||
* @api
|
||||
* @api stable
|
||||
*/
|
||||
ol.events.condition.platformModifierKeyOnly = function(mapBrowserEvent) {
|
||||
var browserEvent = mapBrowserEvent.browserEvent;
|
||||
@@ -127,7 +127,7 @@ ol.events.condition.platformModifierKeyOnly = function(mapBrowserEvent) {
|
||||
/**
|
||||
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if only the shift key is pressed.
|
||||
* @api
|
||||
* @api stable
|
||||
*/
|
||||
ol.events.condition.shiftKeyOnly = function(mapBrowserEvent) {
|
||||
var browserEvent = mapBrowserEvent.browserEvent;
|
||||
@@ -157,7 +157,7 @@ ol.events.condition.targetNotEditable = function(mapBrowserEvent) {
|
||||
/**
|
||||
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if the event originates from a mouse device.
|
||||
* @api
|
||||
* @api stable
|
||||
*/
|
||||
ol.events.condition.mouseOnly = function(mapBrowserEvent) {
|
||||
goog.asserts.assertInstanceof(mapBrowserEvent, ol.MapBrowserPointerEvent);
|
||||
|
||||
@@ -45,19 +45,19 @@ ol.MapBrowserEvent = function(type, map, browserEvent, opt_frameState) {
|
||||
/**
|
||||
* @const
|
||||
* @type {Event}
|
||||
* @api
|
||||
* @api stable
|
||||
*/
|
||||
this.originalEvent = browserEvent.getBrowserEvent();
|
||||
|
||||
/**
|
||||
* @type {ol.Pixel}
|
||||
* @api
|
||||
* @api stable
|
||||
*/
|
||||
this.pixel = map.getEventPixel(this.originalEvent);
|
||||
|
||||
/**
|
||||
* @type {ol.Coordinate}
|
||||
* @api
|
||||
* @api stable
|
||||
*/
|
||||
this.coordinate = map.getCoordinateFromPixel(this.pixel);
|
||||
|
||||
@@ -69,7 +69,7 @@ goog.inherits(ol.MapBrowserEvent, ol.MapEvent);
|
||||
* Prevents the default browser action.
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/API/event.preventDefault
|
||||
* @override
|
||||
* @api
|
||||
* @api stable
|
||||
*/
|
||||
ol.MapBrowserEvent.prototype.preventDefault = function() {
|
||||
goog.base(this, 'preventDefault');
|
||||
@@ -81,7 +81,7 @@ ol.MapBrowserEvent.prototype.preventDefault = function() {
|
||||
* Prevents further propagation of the current event.
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/API/event.stopPropagation
|
||||
* @override
|
||||
* @api
|
||||
* @api stable
|
||||
*/
|
||||
ol.MapBrowserEvent.prototype.stopPropagation = function() {
|
||||
goog.base(this, 'stopPropagation');
|
||||
|
||||
@@ -43,7 +43,7 @@ ol.MapEvent = function(type, map, opt_frameState) {
|
||||
/**
|
||||
* The map where the event occurred.
|
||||
* @type {ol.Map}
|
||||
* @api
|
||||
* @api stable
|
||||
*/
|
||||
this.map = map;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user