Get rid of olx.js and typedef.js typedefs for ol

This commit is contained in:
Andreas Hocevar
2018-03-08 18:42:57 +01:00
parent 8f0ffe2043
commit 95d6251dbb
198 changed files with 2262 additions and 2698 deletions
+2 -711
View File
@@ -5,23 +5,6 @@
var olx;
/**
* Options for tile constructors.
* @typedef {{transition: (number|undefined)}}
*/
olx.TileOptions;
/**
* A duration for tile opacity transitions. By default, tiles will render with
* an opacity transition that lasts 250 ms. To change the duration, pass a
* number in milliseconds. A duration of 0 disables the opacity transition.
* @type {number|undefined}
* @api
*/
olx.TileOptions.prototype.transition;
/**
* Object literal with options for the {@link ol.Map#forEachFeatureAtPixel} and
* {@link ol.Map#hasFeatureAtPixel} methods.
@@ -52,153 +35,6 @@ olx.AtPixelOptions.prototype.layerFilter;
olx.AtPixelOptions.prototype.hitTolerance;
/**
* Object literal with config options for the overlay.
* @typedef {{id: (number|string|undefined),
* element: (Element|undefined),
* offset: (Array.<number>|undefined),
* position: (ol.Coordinate|undefined),
* positioning: (ol.OverlayPositioning|string|undefined),
* stopEvent: (boolean|undefined),
* insertFirst: (boolean|undefined),
* autoPan: (boolean|undefined),
* autoPanAnimation: (olx.OverlayPanOptions|undefined),
* autoPanMargin: (number|undefined),
* className: (string|undefined)}}
*/
olx.OverlayOptions;
/**
* Set the overlay id. The overlay id can be used with the
* {@link ol.Map#getOverlayById} method.
* @type {number|string|undefined}
* @api
*/
olx.OverlayOptions.prototype.id;
/**
* The overlay element.
* @type {Element|undefined}
* @api
*/
olx.OverlayOptions.prototype.element;
/**
* Offsets in pixels used when positioning the overlay. The first element in the
* array is the horizontal offset. A positive value shifts the overlay right.
* The second element in the array is the vertical offset. A positive value
* shifts the overlay down. Default is `[0, 0]`.
* @type {Array.<number>|undefined}
* @api
*/
olx.OverlayOptions.prototype.offset;
/**
* The overlay position in map projection.
* @type {ol.Coordinate|undefined}
* @api
*/
olx.OverlayOptions.prototype.position;
/**
* Defines how the overlay is actually positioned with respect to its `position`
* property. Possible values are `'bottom-left'`, `'bottom-center'`,
* `'bottom-right'`, `'center-left'`, `'center-center'`, `'center-right'`,
* `'top-left'`, `'top-center'`, and `'top-right'`. Default is `'top-left'`.
* @type {ol.OverlayPositioning|string|undefined}
* @api
*/
olx.OverlayOptions.prototype.positioning;
/**
* Whether event propagation to the map viewport should be stopped. Default is
* `true`. If `true` the overlay is placed in the same container as that of the
* controls (CSS class name `ol-overlaycontainer-stopevent`); if `false` it is
* placed in the container with CSS class name `ol-overlaycontainer`.
* @type {boolean|undefined}
* @api
*/
olx.OverlayOptions.prototype.stopEvent;
/**
* Whether the overlay is inserted first in the overlay container, or appended.
* Default is `true`. If the overlay is placed in the same container as that of
* the controls (see the `stopEvent` option) you will probably set `insertFirst`
* to `true` so the overlay is displayed below the controls.
* @type {boolean|undefined}
* @api
*/
olx.OverlayOptions.prototype.insertFirst;
/**
* If set to `true` the map is panned when calling `setPosition`, so that the
* overlay is entirely visible in the current viewport.
* The default is `false`.
* @type {boolean|undefined}
* @api
*/
olx.OverlayOptions.prototype.autoPan;
/**
* The animation options used to pan the overlay into view. This animation
* is only used when `autoPan` is enabled. A `duration` and `easing` may be
* provided to customize the animation.
* @type {olx.OverlayPanOptions|undefined}
* @api
*/
olx.OverlayOptions.prototype.autoPanAnimation;
/**
* The margin (in pixels) between the overlay and the borders of the map when
* autopanning. The default is `20`.
* @type {number|undefined}
* @api
*/
olx.OverlayOptions.prototype.autoPanMargin;
/**
* CSS class name. Default is `ol-overlay-container ol-selectable`.
* @type {string|undefined}
* @api
*/
olx.OverlayOptions.prototype.className;
/**
* @typedef {{
* duration: (number|undefined),
* easing: (undefined|function(number):number)
* }}
*/
olx.OverlayPanOptions;
/**
* The duration of the animation in milliseconds. Default is `1000`.
* @type {number|undefined}
* @api
*/
olx.OverlayPanOptions.prototype.duration;
/**
* The easing function to use. Can be an {@link ol.easing} or a custom function.
* Default is {@link ol.easing.inAndOut}.
* @type {undefined|function(number):number}
* @api
*/
olx.OverlayPanOptions.prototype.easing;
/**
* Object literal with config options for the projection.
* @typedef {{code: string,
@@ -281,170 +117,6 @@ olx.ProjectionOptions.prototype.worldExtent;
olx.ProjectionOptions.prototype.getPointResolution;
/**
* Object literal with config options for the view.
* @typedef {{center: (ol.Coordinate|undefined),
* constrainRotation: (boolean|number|undefined),
* enableRotation: (boolean|undefined),
* extent: (ol.Extent|undefined),
* minResolution: (number|undefined),
* maxResolution: (number|undefined),
* minZoom: (number|undefined),
* maxZoom: (number|undefined),
* projection: ol.ProjectionLike,
* resolution: (number|undefined),
* resolutions: (Array.<number>|undefined),
* rotation: (number|undefined),
* zoom: (number|undefined),
* zoomFactor: (number|undefined)}}
*/
olx.ViewOptions;
/**
* The initial center for the view. The coordinate system for the center is
* specified with the `projection` option. Default is `undefined`, and layer
* sources will not be fetched if this is not set.
* @type {ol.Coordinate|undefined}
* @api
*/
olx.ViewOptions.prototype.center;
/**
* Rotation constraint. `false` means no constraint. `true` means no constraint,
* but snap to zero near zero. A number constrains the rotation to that number
* of values. For example, `4` will constrain the rotation to 0, 90, 180, and
* 270 degrees. The default is `true`.
* @type {boolean|number|undefined}
* @api
*/
olx.ViewOptions.prototype.constrainRotation;
/**
* Enable rotation. Default is `true`. If `false` a rotation constraint that
* always sets the rotation to zero is used. The `constrainRotation` option
* has no effect if `enableRotation` is `false`.
* @type {boolean|undefined}
* @api
*/
olx.ViewOptions.prototype.enableRotation;
/**
* The extent that constrains the center, in other words, center cannot be set
* outside this extent. Default is `undefined`.
* @type {ol.Extent|undefined}
* @api
*/
olx.ViewOptions.prototype.extent;
/**
* The maximum resolution used to determine the resolution constraint. It is
* used together with `minResolution` (or `maxZoom`) and `zoomFactor`. If
* unspecified it is calculated in such a way that the projection's validity
* extent fits in a 256x256 px tile. If the projection is Spherical Mercator
* (the default) then `maxResolution` defaults to `40075016.68557849 / 256 =
* 156543.03392804097`.
* @type {number|undefined}
* @api
*/
olx.ViewOptions.prototype.maxResolution;
/**
* The minimum resolution used to determine the resolution constraint. It is
* used together with `maxResolution` (or `minZoom`) and `zoomFactor`. If
* unspecified it is calculated assuming 29 zoom levels (with a factor of 2).
* If the projection is Spherical Mercator (the default) then `minResolution`
* defaults to `40075016.68557849 / 256 / Math.pow(2, 28) =
* 0.0005831682455839253`.
* @type {number|undefined}
* @api
*/
olx.ViewOptions.prototype.minResolution;
/**
* The maximum zoom level used to determine the resolution constraint. It is
* used together with `minZoom` (or `maxResolution`) and `zoomFactor`. Default
* is `28`. Note that if `minResolution` is also provided, it is given
* precedence over `maxZoom`.
* @type {number|undefined}
* @api
*/
olx.ViewOptions.prototype.maxZoom;
/**
* The minimum zoom level used to determine the resolution constraint. It is
* used together with `maxZoom` (or `minResolution`) and `zoomFactor`. Default
* is `0`. Note that if `maxResolution` is also provided, it is given
* precedence over `minZoom`.
* @type {number|undefined}
* @api
*/
olx.ViewOptions.prototype.minZoom;
/**
* The projection. Default is `EPSG:3857` (Spherical Mercator).
* @type {ol.ProjectionLike}
* @api
*/
olx.ViewOptions.prototype.projection;
/**
* The initial resolution for the view. The units are `projection` units per
* pixel (e.g. meters per pixel). An alternative to setting this is to set
* `zoom`. Default is `undefined`, and layer sources will not be fetched if
* neither this nor `zoom` are defined.
* @type {number|undefined}
* @api
*/
olx.ViewOptions.prototype.resolution;
/**
* Resolutions to determine the resolution constraint. If set the
* `maxResolution`, `minResolution`, `minZoom`, `maxZoom`, and `zoomFactor`
* options are ignored.
* @type {Array.<number>|undefined}
* @api
*/
olx.ViewOptions.prototype.resolutions;
/**
* The initial rotation for the view in radians (positive rotation clockwise).
* Default is `0`.
* @type {number|undefined}
* @api
*/
olx.ViewOptions.prototype.rotation;
/**
* Only used if `resolution` is not defined. Zoom level used to calculate the
* initial resolution for the view. The initial resolution is determined using
* the `ol.View#constrainResolution` method.
* @type {number|undefined}
* @api
*/
olx.ViewOptions.prototype.zoom;
/**
* The zoom factor used to determine the resolution constraint. Default is `2`.
* @type {number|undefined}
* @api
*/
olx.ViewOptions.prototype.zoomFactor;
/**
* @typedef {{
* center: (ol.Coordinate|undefined),
@@ -646,65 +318,6 @@ olx.control.ControlOptions.prototype.render;
olx.control.ControlOptions.prototype.target;
/**
* @typedef {{attribution: (boolean|undefined),
* attributionOptions: (olx.control.AttributionOptions|undefined),
* rotate: (boolean|undefined),
* rotateOptions: (olx.control.RotateOptions|undefined),
* zoom: (boolean|undefined),
* zoomOptions: (olx.control.ZoomOptions|undefined)}}
*/
olx.control.DefaultsOptions;
/**
* Attribution. Default is `true`.
* @type {boolean|undefined}
* @api
*/
olx.control.DefaultsOptions.prototype.attribution;
/**
* Attribution options.
* @type {olx.control.AttributionOptions|undefined}
* @api
*/
olx.control.DefaultsOptions.prototype.attributionOptions;
/**
* Rotate. Default is `true`.
* @type {boolean|undefined}
* @api
*/
olx.control.DefaultsOptions.prototype.rotate;
/**
* Rotate options.
* @type {olx.control.RotateOptions|undefined}
* @api
*/
olx.control.DefaultsOptions.prototype.rotateOptions;
/**
* Zoom. Default is `true`.
* @type {boolean|undefined}
* @api
*/
olx.control.DefaultsOptions.prototype.zoom;
/**
* Zoom options.
* @type {olx.control.ZoomOptions|undefined}
* @api
*/
olx.control.DefaultsOptions.prototype.zoomOptions;
/**
* @typedef {{className: (string|undefined),
* label: (string|Node|undefined),
@@ -777,7 +390,7 @@ olx.control.FullScreenOptions.prototype.source;
/**
* @typedef {{className: (string|undefined),
* coordinateFormat: (ol.CoordinateFormatType|undefined),
* coordinateFormat: (module:ol/coordinate~CoordinateFormat|undefined),
* projection: ol.ProjectionLike,
* render: (function(ol.MapEvent)|undefined),
* target: (Element|string|undefined),
@@ -796,7 +409,7 @@ olx.control.MousePositionOptions.prototype.className;
/**
* Coordinate format.
* @type {ol.CoordinateFormatType|undefined}
* @type {module:ol/coordinate~CoordinateFormat|undefined}
* @api
*/
olx.control.MousePositionOptions.prototype.coordinateFormat;
@@ -2012,114 +1625,6 @@ olx.format.WMSGetFeatureInfoOptions.prototype.layers;
olx.interaction;
/**
* Interactions for the map. Default is `true` for all options.
* @typedef {{
* altShiftDragRotate: (boolean|undefined),
* constrainResolution: (boolean|undefined),
* doubleClickZoom: (boolean|undefined),
* keyboard: (boolean|undefined),
* mouseWheelZoom: (boolean|undefined),
* shiftDragZoom: (boolean|undefined),
* dragPan: (boolean|undefined),
* pinchRotate: (boolean|undefined),
* pinchZoom: (boolean|undefined),
* zoomDelta: (number|undefined),
* zoomDuration: (number|undefined)
* }}
*/
olx.interaction.DefaultsOptions;
/**
* Whether Alt-Shift-drag rotate is desired. Default is `true`.
* @type {boolean|undefined}
* @api
*/
olx.interaction.DefaultsOptions.prototype.altShiftDragRotate;
/**
* Zoom to the closest integer zoom level after the wheel/trackpad or
* pinch gesture ends. Default is `false`.
* @type {boolean|undefined}
* @api
*/
olx.interaction.DefaultsOptions.prototype.constrainResolution;
/**
* Whether double click zoom is desired. Default is `true`.
* @type {boolean|undefined}
* @api
*/
olx.interaction.DefaultsOptions.prototype.doubleClickZoom;
/**
* Whether keyboard interaction is desired. Default is `true`.
* @type {boolean|undefined}
* @api
*/
olx.interaction.DefaultsOptions.prototype.keyboard;
/**
* Whether mousewheel zoom is desired. Default is `true`.
* @type {boolean|undefined}
* @api
*/
olx.interaction.DefaultsOptions.prototype.mouseWheelZoom;
/**
* Whether Shift-drag zoom is desired. Default is `true`.
* @type {boolean|undefined}
* @api
*/
olx.interaction.DefaultsOptions.prototype.shiftDragZoom;
/**
* Whether drag pan is desired. Default is `true`.
* @type {boolean|undefined}
* @api
*/
olx.interaction.DefaultsOptions.prototype.dragPan;
/**
* Whether pinch rotate is desired. Default is `true`.
* @type {boolean|undefined}
* @api
*/
olx.interaction.DefaultsOptions.prototype.pinchRotate;
/**
* Whether pinch zoom is desired. Default is `true`.
* @type {boolean|undefined}
* @api
*/
olx.interaction.DefaultsOptions.prototype.pinchZoom;
/**
* Zoom delta.
* @type {number|undefined}
* @api
*/
olx.interaction.DefaultsOptions.prototype.zoomDelta;
/**
* Zoom duration.
* @type {number|undefined}
* @api
*/
olx.interaction.DefaultsOptions.prototype.zoomDuration;
/**
* @typedef {{duration: (number|undefined),
* delta: (number|undefined)}}
@@ -4038,32 +3543,6 @@ olx.render.State.prototype.resolution;
olx.render.State.prototype.rotation;
/**
* @typedef {{size: (ol.Size|undefined),
* pixelRatio: (number|undefined)}}
*/
olx.render.ToContextOptions;
/**
* Desired size of the canvas in css pixels. When provided, both canvas and css
* size will be set according to the `pixelRatio`. If not provided, the current
* canvas and css sizes will not be altered.
* @type {ol.Size|undefined}
* @api
*/
olx.render.ToContextOptions.prototype.size;
/**
* Pixel ratio (canvas pixel to css pixel ratio) for the canvas. Default
* is the detected device pixel ratio.
* @type {number|undefined}
* @api
*/
olx.render.ToContextOptions.prototype.pixelRatio;
/**
* Namespace.
* @type {Object}
@@ -7566,151 +7045,9 @@ olx.tilegrid.XYZOptions.prototype.tileSize;
olx.view;
/**
* @typedef {{
* size: (ol.Size|undefined),
* padding: (!Array.<number>|undefined),
* constrainResolution: (boolean|undefined),
* nearest: (boolean|undefined),
* maxZoom: (number|undefined),
* minResolution: (number|undefined),
* duration: (number|undefined),
* easing: (undefined|function(number):number),
* callback: (undefined|function(boolean))
* }}
*/
olx.view.FitOptions;
/**
* The size in pixels of the box to fit the extent into. Default is
* the current size of the first map in the DOM that uses this view, or
* `[100, 100]` if no such map is found.
* @type {ol.Size|undefined}
* @api
*/
olx.view.FitOptions.prototype.size;
/**
* Padding (in pixels) to be cleared inside the view. Values in the array are
* top, right, bottom and left padding. Default is `[0, 0, 0, 0]`.
* @type {!Array.<number>|undefined}
* @api
*/
olx.view.FitOptions.prototype.padding;
/**
* Constrain the resolution. Default is `true`.
* @type {boolean|undefined}
* @api
*/
olx.view.FitOptions.prototype.constrainResolution;
/**
* Get the nearest extent. Default is `false`.
* @type {boolean|undefined}
* @api
*/
olx.view.FitOptions.prototype.nearest;
/**
* Minimum resolution that we zoom to. Default is `0`.
* @type {number|undefined}
* @api
*/
olx.view.FitOptions.prototype.minResolution;
/**
* Maximum zoom level that we zoom to. If `minResolution` is given,
* this property is ignored.
* @type {number|undefined}
* @api
*/
olx.view.FitOptions.prototype.maxZoom;
/**
* The duration of the animation in milliseconds. By default, there is no
* animations.
* @type {number|undefined}
* @api
*/
olx.view.FitOptions.prototype.duration;
/**
* The easing function used during the animation (defaults to {@link ol.easing.inAndOut}).
* The function will be called for each frame with a number representing a
* fraction of the animation's duration. The function should return a number
* between 0 and 1 representing the progress toward the destination state.
* @type {undefined|function(number):number}
* @api
*/
olx.view.FitOptions.prototype.easing;
/**
* Optional function called when the view is in it's final position. The callback will be
* called with `true` if the animation series completed on its own or `false`
* if it was cancelled.
* @type {undefined|function(boolean)}
* @api
*/
olx.view.FitOptions.prototype.callback;
/* typedefs for object literals exposed by the library */
/**
* @typedef {{animate: boolean,
* coordinateToPixelTransform: ol.Transform,
* extent: (null|ol.Extent),
* focus: ol.Coordinate,
* index: number,
* layerStates: Object.<number, ol.LayerState>,
* layerStatesArray: Array.<ol.LayerState>,
* pixelRatio: number,
* pixelToCoordinateTransform: ol.Transform,
* postRenderFunctions: Array.<ol.PostRenderFunction>,
* size: ol.Size,
* skippedFeatureUids: !Object.<string, boolean>,
* tileQueue: ol.TileQueue,
* time: number,
* usedTiles: Object.<string, Object.<string, ol.TileRange>>,
* viewState: olx.ViewState,
* viewHints: Array.<number>,
* wantedTiles: !Object.<string, Object.<string, boolean>>}}
*/
olx.FrameState;
/**
* @type {number}
* @api
*/
olx.FrameState.prototype.pixelRatio;
/**
* @type {number}
* @api
*/
olx.FrameState.prototype.time;
/**
* @type {olx.ViewState}
* @api
*/
olx.FrameState.prototype.viewState;
/**
* @typedef {{center: ol.Coordinate,
* projection: ol.proj.Projection,
@@ -7788,49 +7125,3 @@ olx.style.AtlasManagerOptions.prototype.maxSize;
* @api
*/
olx.style.AtlasManagerOptions.prototype.space;
/**
* @typedef {{handles: function(ol.renderer.Type):boolean,
* create: function(Element, ol.PluggableMap):ol.renderer.Map}}
*/
olx.MapRendererPlugin;
/**
* Determine if this renderer handles the provided layer.
* @type {function(ol.renderer.Type):boolean}
* @api
*/
olx.MapRendererPlugin.prototype.handles;
/**
* Create the map renderer.
* @type {function(Element, ol.PluggableMap):ol.renderer.Map}
* @api
*/
olx.MapRendererPlugin.prototype.create;
/**
* @typedef {{handles: function(ol.renderer.Type, ol.layer.Layer):boolean,
* create: function(ol.renderer.Map, ol.layer.Layer):ol.renderer.Layer}}
*/
olx.LayerRendererPlugin;
/**
* Determine if this renderer handles the provided layer.
* @type {function(ol.renderer.Type, ol.layer.Layer):boolean}
* @api
*/
olx.LayerRendererPlugin.prototype.handles;
/**
* Create a layer renderer.
* @type {function(ol.renderer.Map, ol.layer.Layer):ol.renderer.Layer}
* @api
*/
olx.LayerRendererPlugin.prototype.create;