No olx and ol types for ol/interaction/MouseWheelZoom

This commit is contained in:
ahocevar
2018-03-16 16:35:39 +01:00
parent d6b177e847
commit 54beb17b55
3 changed files with 22 additions and 75 deletions

View File

@@ -46,61 +46,6 @@ olx.interaction.TranslateOptions.prototype.layers;
olx.interaction.TranslateOptions.prototype.hitTolerance;
/**
* @typedef {{constrainResolution: (boolean|undefined),
* condition: (ol.EventsConditionType|undefined),
* duration: (number|undefined),
* timeout: (number|undefined),
* useAnchor: (boolean|undefined)}}
*/
olx.interaction.MouseWheelZoomOptions;
/**
* 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.always}.
* @type {ol.EventsConditionType|undefined}
* @api
*/
olx.interaction.MouseWheelZoomOptions.prototype.condition;
/**
* Animation duration in milliseconds. Default is `250`.
* @type {number|undefined}
* @api
*/
olx.interaction.MouseWheelZoomOptions.prototype.duration;
/**
* Mouse wheel timeout duration in milliseconds. Default is `80`.
* @type {number|undefined}
* @api
*/
olx.interaction.MouseWheelZoomOptions.prototype.timeout;
/**
* When using a trackpad or magic mouse, zoom to the closest integer zoom level
* after the scroll gesture ends.
* Default is `false`.
* @type {boolean|undefined}
* @api
*/
olx.interaction.MouseWheelZoomOptions.prototype.constrainResolution;
/**
* Enable zooming using the mouse's location as the anchor. Default is `true`.
* When set to false, zooming in and out will zoom to the center of the screen
* instead of zooming on the mouse's location.
* @type {boolean|undefined}
* @api
*/
olx.interaction.MouseWheelZoomOptions.prototype.useAnchor;
/**
* @typedef {{threshold: (number|undefined),
* duration: (number|undefined)}}

View File

@@ -14,21 +14,6 @@
*/
/**
* @typedef {Object} interaction_MouseWheelZoomOptions
* @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.always}.
* @property {number|undefined} duration Animation duration in milliseconds. Default is `250`.
* @property {number|undefined} timeout Mouse wheel timeout duration in milliseconds. Default is `80`.
* @property {boolean|undefined} constrainResolution When using a trackpad or magic mouse, zoom to the closest integer zoom level
* after the scroll gesture ends.
* Default is `false`.
* @property {boolean|undefined} useAnchor Enable zooming using the mouse's location as the anchor. Default is `true`.
* When set to false, zooming in and out will zoom to the center of the screen
* instead of zooming on the mouse's location.
*/
/**
* @typedef {Object} interaction_PinchRotateOptions
* @property {number|undefined} duration The duration of the animation in milliseconds. Default is `250`.

View File

@@ -27,13 +27,30 @@ export const Mode = {
};
/**
* @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~always}.
* @property {number} [duration=250] Animation duration in milliseconds.
* @property {number} [timeout=80] Mouse wheel timeout duration in milliseconds.
* @property {boolean} [constrainResolution=false] When using a trackpad or
* magic mouse, zoom to the closest integer zoom level after the scroll gesture
* ends.
* @property {boolean} [useAnchor=true] Enable zooming using the mouse's
* location as the anchor. When set to `false`, zooming in and out will zoom to
* the center of the screen instead of zooming on the mouse's location.
*/
/**
* @classdesc
* Allows the user to zoom the map by scrolling the mouse wheel.
*
* @constructor
* @extends {ol.interaction.Interaction}
* @param {olx.interaction.MouseWheelZoomOptions=} opt_options Options.
* @extends {module:ol/interaction/Interaction~Interaction}
* @param {module:olx/interaction/MouseWheelZoom~Options=} opt_options Options.
* @api
*/
const MouseWheelZoom = function(opt_options) {
@@ -100,7 +117,7 @@ const MouseWheelZoom = function(opt_options) {
/**
* @private
* @type {ol.interaction.Mode|undefined}
* @type {module:ol/interaction/MouseWheelZoom~Mode|undefined}
*/
this.mode_ = undefined;
@@ -140,7 +157,7 @@ inherits(MouseWheelZoom, Interaction);
* mousewheel-event) and eventually zooms the map.
* @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} Allow event propagation.
* @this {ol.interaction.MouseWheelZoom}
* @this {module:ol/interaction/MouseWheelZoom~MouseWheelZoom}
*/
function handleEvent(mapBrowserEvent) {
if (!this.condition_(mapBrowserEvent)) {
@@ -271,7 +288,7 @@ MouseWheelZoom.prototype.decrementInteractingHint_ = function() {
/**
* @private
* @param {ol.PluggableMap} map Map.
* @param {module:ol/PluggableMap~PluggableMap} map Map.
*/
MouseWheelZoom.prototype.handleWheelZoom_ = function(map) {
const view = map.getView();