No olx and ol types for ol/interaction/DragZoom

This commit is contained in:
ahocevar
2018-03-15 17:18:52 +01:00
parent 47d49a802e
commit 2c6afdd5bb
3 changed files with 18 additions and 58 deletions

View File

@@ -7,18 +7,32 @@ import {shiftKeyOnly} from '../events/condition.js';
import {createOrUpdateFromCoordinates, getBottomLeft, getCenter, getTopRight, scaleFromCenter} from '../extent.js';
import DragBox from '../interaction/DragBox.js';
/**
* @typedef {Object} Options
* @property {string} [className='ol-dragzoom'] CSS class name for styling the
* box.
* @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~shiftKeyOnly}.
* @property {number} [duration=200] Animation duration in milliseconds.
* @property {boolean} [out=false] Use interaction for zooming out.
*/
/**
* @classdesc
* Allows the user to zoom the map by clicking and dragging on the map,
* normally combined with an {@link ol.events.condition} that limits
* normally combined with an {@link module:ol/events/condition} that limits
* it to when a key, shift by default, is held down.
*
* To change the style of the box, use CSS and the `.ol-dragzoom` selector, or
* your custom one configured with `className`.
*
* @constructor
* @extends {ol.interaction.DragBox}
* @param {olx.interaction.DragZoomOptions=} opt_options Options.
* @extends {module:ol/interaction/DragBox~DragBox}
* @param {ol/interaction/DragZoom~Options=} opt_options Options.
* @api
*/
const DragZoom = function(opt_options) {
@@ -54,7 +68,7 @@ inherits(DragZoom, DragBox);
DragZoom.prototype.onBoxEnd = function() {
const map = this.getMap();
const view = /** @type {!ol.View} */ (map.getView());
const view = /** @type {!module:ol/View~View} */ (map.getView());
const size = /** @type {!module:ol/size~Size} */ (map.getSize());