No olx and ol types for ol/interaction/KeyboardPan
This commit is contained in:
@@ -46,41 +46,6 @@ olx.interaction.TranslateOptions.prototype.layers;
|
|||||||
olx.interaction.TranslateOptions.prototype.hitTolerance;
|
olx.interaction.TranslateOptions.prototype.hitTolerance;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @typedef {{condition: (ol.EventsConditionType|undefined),
|
|
||||||
* duration: (number|undefined),
|
|
||||||
* pixelDelta: (number|undefined)}}
|
|
||||||
*/
|
|
||||||
olx.interaction.KeyboardPanOptions;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A function that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a boolean
|
|
||||||
* to indicate whether that event should be handled.
|
|
||||||
* Default is {@link ol.events.condition.noModifierKeys} and
|
|
||||||
* {@link ol.events.condition.targetNotEditable}.
|
|
||||||
* @type {ol.EventsConditionType|undefined}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.interaction.KeyboardPanOptions.prototype.condition;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Animation duration in milliseconds. Default is `100`.
|
|
||||||
* @type {number|undefined}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.interaction.KeyboardPanOptions.prototype.duration;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Pixel The amount to pan on each key press. Default is `128` pixels.
|
|
||||||
* @type {number|undefined}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.interaction.KeyboardPanOptions.prototype.pixelDelta;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {{duration: (number|undefined),
|
* @typedef {{duration: (number|undefined),
|
||||||
* condition: (ol.EventsConditionType|undefined),
|
* condition: (ol.EventsConditionType|undefined),
|
||||||
|
|||||||
@@ -14,17 +14,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @typedef {Object} interaction_KeyboardPanOptions
|
|
||||||
* @property {ol.EventsConditionType|undefined} condition A function that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a boolean
|
|
||||||
* to indicate whether that event should be handled.
|
|
||||||
* Default is {@link ol.events.condition.noModifierKeys} and
|
|
||||||
* {@link ol.events.condition.targetNotEditable}.
|
|
||||||
* @property {number|undefined} duration Animation duration in milliseconds. Default is `100`.
|
|
||||||
* @property {number|undefined} pixelDelta Pixel The amount to pan on each key press. Default is `128` pixels.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} interaction_KeyboardZoomOptions
|
* @typedef {Object} interaction_KeyboardZoomOptions
|
||||||
* @property {number|undefined} duration Animation duration in milliseconds. Default is `100`.
|
* @property {number|undefined} duration Animation duration in milliseconds. Default is `100`.
|
||||||
|
|||||||
@@ -8,6 +8,20 @@ import KeyCode from '../events/KeyCode.js';
|
|||||||
import {noModifierKeys, targetNotEditable} from '../events/condition.js';
|
import {noModifierKeys, targetNotEditable} from '../events/condition.js';
|
||||||
import Interaction, {pan} from '../interaction/Interaction.js';
|
import Interaction, {pan} from '../interaction/Interaction.js';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {Object} Options
|
||||||
|
* @property {module:ol/events/condition~Condition} [condition] A function that
|
||||||
|
* takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a
|
||||||
|
* boolean to indicate whether that event should be handled. Default is
|
||||||
|
* {@link module:ol/events/condition~noModifierKeys} and
|
||||||
|
* {@link module:ol/events/condition~targetNotEditable}.
|
||||||
|
* @property {number} [duration=100] Animation duration in milliseconds.
|
||||||
|
* @property {number} [pixelDelta=128] The amount of pixels to pan on each key
|
||||||
|
* press.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
* Allows the user to pan the map using keyboard arrows.
|
* Allows the user to pan the map using keyboard arrows.
|
||||||
@@ -15,14 +29,14 @@ import Interaction, {pan} from '../interaction/Interaction.js';
|
|||||||
* the keys can only be used when browser focus is on the element to which
|
* the keys can only be used when browser focus is on the element to which
|
||||||
* the keyboard events are attached. By default, this is the map div,
|
* the keyboard events are attached. By default, this is the map div,
|
||||||
* though you can change this with the `keyboardEventTarget` in
|
* though you can change this with the `keyboardEventTarget` in
|
||||||
* {@link ol.Map}. `document` never loses focus but, for any other element,
|
* {@link module:ol/Map~Map}. `document` never loses focus but, for any other
|
||||||
* focus will have to be on, and returned to, this element if the keys are to
|
* element, focus will have to be on, and returned to, this element if the keys
|
||||||
* function.
|
* are to function.
|
||||||
* See also {@link ol.interaction.KeyboardZoom}.
|
* See also {@link module:ol/interaction/KeyboardZoom~KeyboardZoom}.
|
||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.interaction.Interaction}
|
* @extends {module:ol/interaction/Interaction~Interaction}
|
||||||
* @param {olx.interaction.KeyboardPanOptions=} opt_options Options.
|
* @param {module:ol/interaction/KeyboardPan~Options=} opt_options Options.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
const KeyboardPan = function(opt_options) {
|
const KeyboardPan = function(opt_options) {
|
||||||
@@ -73,7 +87,7 @@ inherits(KeyboardPan, Interaction);
|
|||||||
* pressed).
|
* pressed).
|
||||||
* @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
|
* @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||||
* @return {boolean} `false` to stop event propagation.
|
* @return {boolean} `false` to stop event propagation.
|
||||||
* @this {ol.interaction.KeyboardPan}
|
* @this {module:ol/interaction/KeyboardPan~KeyboardPan}
|
||||||
*/
|
*/
|
||||||
function handleEvent(mapBrowserEvent) {
|
function handleEvent(mapBrowserEvent) {
|
||||||
let stopEvent = false;
|
let stopEvent = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user