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

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;

View File

@@ -29,47 +29,53 @@ registerMultiple(PluginType.LAYER_RENDERER, [
* The map is the core component of OpenLayers. For a map to render, a view,
* one or more layers, and a target container are needed:
*
* var map = new ol.CanvasMap({
* view: new ol.View({
* import CanvasMap from 'ol/CanvasMap';
* import TileLayer from 'ol/layer/Tile';
* import OSM from 'ol/source/OSM';
* import View from 'ol/View';
*
* var map = new CanvasMap({
* view: new View({
* center: [0, 0],
* zoom: 1
* }),
* layers: [
* new ol.layer.Tile({
* source: new ol.source.OSM()
* new TileLayer({
* source: new OSM()
* })
* ],
* target: 'map'
* });
*
* The above snippet creates a map using a {@link ol.layer.Tile} to display
* {@link ol.source.OSM} OSM data and render it to a DOM element with the
* id `map`.
* The above snippet creates a map using a {@link module:ol/layer/Tile~Tile} to
* display {@link module:ol/source/OSM~OSM} OSM data and render it to a DOM
* element with the id `map`.
*
* The constructor places a viewport container (with CSS class name
* `ol-viewport`) in the target element (see `getViewport()`), and then two
* further elements within the viewport: one with CSS class name
* `ol-overlaycontainer-stopevent` for controls and some overlays, and one with
* CSS class name `ol-overlaycontainer` for other overlays (see the `stopEvent`
* option of {@link ol.Overlay} for the difference). The map itself is placed in
* a further element within the viewport.
* option of {@link module:ol/Overlay~Overlay} for the difference). The map
* itself is placed in a further element within the viewport.
*
* Layers are stored as a `ol.Collection` in layerGroups. A top-level group is
* provided by the library. This is what is accessed by `getLayerGroup` and
* `setLayerGroup`. Layers entered in the options are added to this group, and
* `addLayer` and `removeLayer` change the layer collection in the group.
* `getLayers` is a convenience function for `getLayerGroup().getLayers()`.
* Note that `ol.layer.Group` is a subclass of `ol.layer.Base`, so layers
* entered in the options or added with `addLayer` can be groups, which can
* contain further groups, and so on.
* Layers are stored as a {@link module:ol/Collection~Collection} in
* layerGroups. A top-level group is provided by the library. This is what is
* accessed by `getLayerGroup` and `setLayerGroup`. Layers entered in the
* options are added to this group, and `addLayer` and `removeLayer` change the
* layer collection in the group. `getLayers` is a convenience function for
* `getLayerGroup().getLayers()`.
* Note that {@link module:ol/layer/Group~Group} is a subclass of
* {@link module:ol/layer/Base~Base}, so layers entered in the options or added
* with `addLayer` can be groups, which can contain further groups, and so on.
*
* @constructor
* @extends {ol.PluggableMap}
* @param {olx.MapOptions} options Map options.
* @fires ol.MapBrowserEvent
* @fires ol.MapEvent
* @fires ol.render.Event#postcompose
* @fires ol.render.Event#precompose
* @extends {module:ol/PluggableMap~PluggableMap}
* @param {module:ol/PluggableMap~MapOptions} options Map options.
* @fires module:ol/MapBrowserEvent~MapBrowserEvent
* @fires module:ol/MapEvent~MapEvent
* @fires module:ol/render/Event~Event#postcompose
* @fires module:ol/render/Event~Event#precompose
* @api
*/
const CanvasMap = function(options) {

View File

@@ -25,7 +25,7 @@ const Property = {
* @constructor
* @extends {module:ol/events/Event~Event}
* @implements {oli.CollectionEvent}
* @param {module:ol/CollectionEventType} type Type.
* @param {module:ol/CollectionEventType~CollectionEventType} type Type.
* @param {*=} opt_element Element.
*/
export const CollectionEvent = function(type, opt_element) {

View File

@@ -8,13 +8,13 @@
export default {
/**
* Triggered when an item is added to the collection.
* @event ol.CollectionEvent#add
* @event module:ol/CollectionEvent~CollectionEvent#add
* @api
*/
ADD: 'add',
/**
* Triggered when an item is removed from the collection.
* @event ol.CollectionEvent#remove
* @event module:ol/CollectionEvent~CollectionEvent#remove
* @api
*/
REMOVE: 'remove'

View File

@@ -18,7 +18,7 @@ import Style from './style/Style.js';
* Features can be styled individually with `setStyle`; otherwise they use the
* style of their vector layer.
*
* Note that attribute properties are set as {@link ol.Object} properties on
* Note that attribute properties are set as {@link module:ol/Object~Object} properties on
* the feature object, so they are observable, and have get/set accessors.
*
* Typically, a feature has a single geometry property. You can set the
@@ -30,9 +30,14 @@ import Style from './style/Style.js';
* property associated with the geometry for the feature. For example:
*
* ```js
* var feature = new ol.Feature({
* geometry: new ol.geom.Polygon(polyCoords),
* labelPoint: new ol.geom.Point(labelCoords),
*
* import Feature from 'ol/Feature';
* import Polygon from 'ol/geom/Polygon';
* import Point from 'ol/geom/Point';
*
* var feature = new Feature({
* geometry: new Polygon(polyCoords),
* labelPoint: new Point(labelCoords),
* name: 'My Polygon'
* });
*
@@ -47,11 +52,11 @@ import Style from './style/Style.js';
* ```
*
* @constructor
* @extends {ol.Object}
* @param {ol.geom.Geometry|Object.<string, *>=} opt_geometryOrProperties
* You may pass a Geometry object directly, or an object literal
* containing properties. If you pass an object literal, you may
* include a Geometry associated with a `geometry` key.
* @extends {module:ol/Object~Object}
* @param {module:ol/geom/Geometry~Geometry|Object.<string, *>=} opt_geometryOrProperties
* You may pass a Geometry object directly, or an object literal containing
* properties. If you pass an object literal, you may include a Geometry
* associated with a `geometry` key.
* @api
*/
const Feature = function(opt_geometryOrProperties) {
@@ -73,19 +78,19 @@ const Feature = function(opt_geometryOrProperties) {
/**
* User provided style.
* @private
* @type {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction}
* @type {module:ol/style/Style~Geometry|Array.<module:ol/style/Style~Geometry>|module:ol/style~StyleFunction}
*/
this.style_ = null;
/**
* @private
* @type {ol.StyleFunction|undefined}
* @type {module:ol/style~StyleFunction|undefined}
*/
this.styleFunction_ = undefined;
/**
* @private
* @type {?ol.EventsKey}
* @type {?module:ol/events~EventsKey}
*/
this.geometryChangeKey_ = null;
@@ -112,7 +117,7 @@ inherits(Feature, BaseObject);
/**
* Clone this feature. If the original feature has a geometry it
* is also cloned. The feature id is not set in the clone.
* @return {ol.Feature} The clone.
* @return {module:ol/Feature~Feature} The clone.
* @api
*/
Feature.prototype.clone = function() {
@@ -133,13 +138,13 @@ Feature.prototype.clone = function() {
/**
* Get the feature's default geometry. A feature may have any number of named
* geometries. The "default" geometry (the one that is rendered by default) is
* set when calling {@link ol.Feature#setGeometry}.
* @return {ol.geom.Geometry|undefined} The default geometry for the feature.
* set when calling {@link module:ol/Feature~Feature#setGeometry}.
* @return {module:ol/geom/Geometry~Geometry|undefined} The default geometry for the feature.
* @api
* @observable
*/
Feature.prototype.getGeometry = function() {
return /** @type {ol.geom.Geometry|undefined} */ (
return /** @type {module:ol/geom/Geometry~Geometry|undefined} */ (
this.get(this.geometryName_));
};
@@ -147,7 +152,7 @@ Feature.prototype.getGeometry = function() {
/**
* Get the feature identifier. This is a stable identifier for the feature and
* is either set when reading data from a remote source or set explicitly by
* calling {@link ol.Feature#setId}.
* calling {@link module:ol/Feature~Feature#setId}.
* @return {number|string|undefined} Id.
* @api
*/
@@ -170,8 +175,8 @@ Feature.prototype.getGeometryName = function() {
/**
* Get the feature's style. Will return what was provided to the
* {@link ol.Feature#setStyle} method.
* @return {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction} The feature style.
* {@link module:ol/Feature~Feature#setStyle} method.
* @return {module:ol/style/Style~Geometry|Array.<module:ol/style/Style~Geometry>|module:ol/style~StyleFunction} The feature style.
* @api
*/
Feature.prototype.getStyle = function() {
@@ -181,7 +186,7 @@ Feature.prototype.getStyle = function() {
/**
* Get the feature's style function.
* @return {ol.StyleFunction|undefined} Return a function
* @return {module:ol/style~StyleFunction|undefined} Return a function
* representing the current style of this feature.
* @api
*/
@@ -217,8 +222,8 @@ Feature.prototype.handleGeometryChanged_ = function() {
/**
* Set the default geometry for the feature. This will update the property
* with the name returned by {@link ol.Feature#getGeometryName}.
* @param {ol.geom.Geometry|undefined} geometry The new geometry.
* with the name returned by {@link module:ol/Feature~Feature#getGeometryName}.
* @param {module:ol/geom/Geometry~Geometry|undefined} geometry The new geometry.
* @api
* @observable
*/
@@ -231,9 +236,9 @@ Feature.prototype.setGeometry = function(geometry) {
* Set the style for the feature. This can be a single style object, an array
* of styles, or a function that takes a resolution and returns an array of
* styles. If it is `null` the feature has no style (a `null` style).
* @param {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction} style Style for this feature.
* @param {module:ol/style/Style~Geometry|Array.<module:ol/style/Style~Geometry>|module:ol/style~StyleFunction} style Style for this feature.
* @api
* @fires ol.events.Event#event:change
* @fires module:ol/events/Event~Event#event:change
*/
Feature.prototype.setStyle = function(style) {
this.style_ = style;
@@ -245,11 +250,11 @@ Feature.prototype.setStyle = function(style) {
/**
* Set the feature id. The feature id is considered stable and may be used when
* requesting features or comparing identifiers returned from a remote source.
* The feature id can be used with the {@link ol.source.Vector#getFeatureById}
* method.
* The feature id can be used with the
* {@link module:ol/source/Vector~Vector#getFeatureById} method.
* @param {number|string|undefined} id The feature id.
* @api
* @fires ol.events.Event#event:change
* @fires module:ol/events/Event~Event#event:change
*/
Feature.prototype.setId = function(id) {
this.id_ = id;
@@ -259,7 +264,7 @@ Feature.prototype.setId = function(id) {
/**
* Set the property name to be used when getting the feature's default geometry.
* When calling {@link ol.Feature#getGeometry}, the value of the property with
* When calling {@link module:ol/Feature~Feature#getGeometry}, the value of the property with
* this name will be returned.
* @param {string} name The property name of the default geometry.
* @api
@@ -278,25 +283,25 @@ Feature.prototype.setGeometryName = function(name) {
/**
* Convert the provided object into a feature style function. Functions passed
* through unchanged. Arrays of ol.style.Style or single style objects wrapped
* through unchanged. Arrays of module:ol/style/Style~Geometry or single style objects wrapped
* in a new feature style function.
* @param {ol.StyleFunction|!Array.<ol.style.Style>|!ol.style.Style} obj
* @param {module:ol/style~StyleFunction|!Array.<module:ol/style/Style~Geometry>|!module:ol/style/Style~Geometry} obj
* A feature style function, a single style, or an array of styles.
* @return {ol.StyleFunction} A style function.
* @return {module:ol/style~StyleFunction} A style function.
*/
export function createStyleFunction(obj) {
if (typeof obj === 'function') {
return obj;
} else {
/**
* @type {Array.<ol.style.Style>}
* @type {Array.<module:ol/style/Style~Geometry>}
*/
let styles;
if (Array.isArray(obj)) {
styles = obj;
} else {
assert(obj instanceof Style,
41); // Expected an `ol.style.Style` or an array of `ol.style.Style`
41); // Expected an `module:ol/style/Style~Geometry` or an array of `module:ol/style/Style~Geometry`
styles = [obj];
}
return function() {

View File

@@ -18,7 +18,7 @@ import {get as getProjection, getTransformFromProjections, identityTransform} fr
* instantiation.
* @property {GeolocationPositionOptions} [trackingOptions] Tracking options.
* See {@link http://www.w3.org/TR/geolocation-API/#position_options_interface}.
* @property {module:ol/types~ProjectionLike} [projection] The projection the position
* @property {module:ol/proj~ProjectionLike} [projection] The projection the position
* is reported in.
*/
@@ -58,13 +58,13 @@ const Geolocation = function(opt_options) {
/**
* The unprojected (EPSG:4326) device position.
* @private
* @type {module:ol/types~Coordinate}
* @type {module:ol/coordinate~Coordinate}
*/
this.position_ = null;
/**
* @private
* @type {module:ol/types~TransformFunction}
* @type {module:ol/proj~TransformFunction}
*/
this.transform_ = identityTransform;
@@ -247,13 +247,13 @@ Geolocation.prototype.getHeading = function() {
/**
* Get the position of the device.
* @return {module:ol/types~Coordinate|undefined} The current position of the device reported
* @return {module:ol/coordinate~Coordinate|undefined} The current position of the device reported
* in the current projection.
* @observable
* @api
*/
Geolocation.prototype.getPosition = function() {
return /** @type {module:ol/types~Coordinate|undefined} */ (this.get(GeolocationProperty.POSITION));
return /** @type {module:ol/coordinate~Coordinate|undefined} */ (this.get(GeolocationProperty.POSITION));
};
@@ -308,7 +308,7 @@ Geolocation.prototype.getTrackingOptions = function() {
/**
* Set the projection to use for transforming the coordinates.
* @param {module:ol/types~ProjectionLike} projection The projection the position is
* @param {module:ol/proj~ProjectionLike} projection The projection the position is
* reported in.
* @observable
* @api

View File

@@ -122,7 +122,7 @@ const Graticule = function(opt_options) {
this.map_ = null;
/**
* @type {?module:ol/types~EventsKey}
* @type {?module:ol/events~EventsKey}
* @private
*/
this.postcomposeListenerKey_ = null;
@@ -211,19 +211,19 @@ const Graticule = function(opt_options) {
this.strokeStyle_ = options.strokeStyle !== undefined ? options.strokeStyle : DEFAULT_STROKE_STYLE;
/**
* @type {module:ol/types~TransformFunction|undefined}
* @type {module:ol/proj~TransformFunction|undefined}
* @private
*/
this.fromLonLatTransform_ = undefined;
/**
* @type {module:ol/types~TransformFunction|undefined}
* @type {module:ol/proj~TransformFunction|undefined}
* @private
*/
this.toLonLatTransform_ = undefined;
/**
* @type {module:ol/types~Coordinate}
* @type {module:ol/coordinate~Coordinate}
* @private
*/
this.projectionCenterLonLat_ = null;
@@ -322,7 +322,7 @@ const Graticule = function(opt_options) {
* @param {number} minLat Minimal latitude.
* @param {number} maxLat Maximal latitude.
* @param {number} squaredTolerance Squared tolerance.
* @param {module:ol/types~Extent} extent Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @param {number} index Index.
* @return {number} Index.
* @private
@@ -344,7 +344,7 @@ Graticule.prototype.addMeridian_ = function(lon, minLat, maxLat, squaredToleranc
/**
* @param {module:ol/geom/LineString~LineString} lineString Meridian
* @param {module:ol/types~Extent} extent Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @param {number} index Index.
* @return {module:ol/geom/Point~Point} Meridian point.
* @private
@@ -369,7 +369,7 @@ Graticule.prototype.getMeridianPoint_ = function(lineString, extent, index) {
* @param {number} minLon Minimal longitude.
* @param {number} maxLon Maximal longitude.
* @param {number} squaredTolerance Squared tolerance.
* @param {module:ol/types~Extent} extent Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @param {number} index Index.
* @return {number} Index.
* @private
@@ -392,7 +392,7 @@ Graticule.prototype.addParallel_ = function(lat, minLon, maxLon, squaredToleranc
/**
* @param {module:ol/geom/LineString~LineString} lineString Parallels.
* @param {module:ol/types~Extent} extent Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @param {number} index Index.
* @return {module:ol/geom/Point~Point} Parallel point.
* @private
@@ -413,8 +413,8 @@ Graticule.prototype.getParallelPoint_ = function(lineString, extent, index) {
/**
* @param {module:ol/types~Extent} extent Extent.
* @param {module:ol/types~Coordinate} center Center.
* @param {module:ol/extent~Extent} extent Extent.
* @param {module:ol/coordinate~Coordinate} center Center.
* @param {number} resolution Resolution.
* @param {number} squaredTolerance Squared tolerance.
* @private

View File

@@ -8,15 +8,35 @@ import {listenOnce, unlistenByKey} from './events.js';
import EventType from './events/EventType.js';
import {getHeight} from './extent.js';
/**
* A function that takes an {@link module:ol/Image~Image} for the image and a
* `{string}` for the src as arguments. It is supposed to make it so the
* underlying image {@link module:ol/Image~Image#getImage} is assigned the
* content specified by the src. If not specified, the default is
*
* function(image, src) {
* image.getImage().src = src;
* }
*
* Providing a custom `imageLoadFunction` can be useful to load images with
* post requests or - in general - through XHR requests, where the src of the
* image element would be set to a data URI when the content is loaded.
*
* @typedef {function(module:ol/Image~Image, string)} LoadFunction
* @api
*/
/**
* @constructor
* @extends {ol.ImageBase}
* @param {ol.Extent} extent Extent.
* @extends {module:ol/ImageBase~ImageBase}
* @param {module:ol/extent~Extent} extent Extent.
* @param {number|undefined} resolution Resolution.
* @param {number} pixelRatio Pixel ratio.
* @param {string} src Image source URI.
* @param {?string} crossOrigin Cross origin.
* @param {ol.ImageLoadFunctionType} imageLoadFunction Image load function.
* @param {module:ol/Image~LoadFunction} imageLoadFunction Image load function.
*/
const ImageWrapper = function(extent, resolution, pixelRatio, src, crossOrigin, imageLoadFunction) {
@@ -39,19 +59,19 @@ const ImageWrapper = function(extent, resolution, pixelRatio, src, crossOrigin,
/**
* @private
* @type {Array.<ol.EventsKey>}
* @type {Array.<module:ol/events~EventsKey>}
*/
this.imageListenerKeys_ = null;
/**
* @protected
* @type {ol.ImageState}
* @type {module:ol/ImageState~ImageState}
*/
this.state = ImageState.IDLE;
/**
* @private
* @type {ol.ImageLoadFunctionType}
* @type {module:ol/Image~LoadFunction}
*/
this.imageLoadFunction_ = imageLoadFunction;

View File

@@ -8,11 +8,11 @@ import EventType from './events/EventType.js';
/**
* @constructor
* @abstract
* @extends {ol.events.EventTarget}
* @param {ol.Extent} extent Extent.
* @extends {module:ol/events/EventTarget~EventTarget}
* @param {module:ol/extent~Extent} extent Extent.
* @param {number|undefined} resolution Resolution.
* @param {number} pixelRatio Pixel ratio.
* @param {ol.ImageState} state State.
* @param {module:ol/ImageState~ImageState} state State.
*/
const ImageBase = function(extent, resolution, pixelRatio, state) {
@@ -20,7 +20,7 @@ const ImageBase = function(extent, resolution, pixelRatio, state) {
/**
* @protected
* @type {ol.Extent}
* @type {module:ol/extent~Extent}
*/
this.extent = extent;
@@ -38,7 +38,7 @@ const ImageBase = function(extent, resolution, pixelRatio, state) {
/**
* @protected
* @type {ol.ImageState}
* @type {module:ol/ImageState~ImageState}
*/
this.state = state;
@@ -56,7 +56,7 @@ ImageBase.prototype.changed = function() {
/**
* @return {ol.Extent} Extent.
* @return {module:ol/extent~Extent} Extent.
*/
ImageBase.prototype.getExtent = function() {
return this.extent;
@@ -87,7 +87,7 @@ ImageBase.prototype.getResolution = function() {
/**
* @return {ol.ImageState} State.
* @return {module:ol/ImageState~ImageState} State.
*/
ImageBase.prototype.getState = function() {
return this.state;

View File

@@ -5,21 +5,32 @@ import {inherits} from './index.js';
import ImageBase from './ImageBase.js';
import ImageState from './ImageState.js';
/**
* A function that is called to trigger asynchronous canvas drawing. It is
* called with a "done" callback that should be called when drawing is done.
* If any error occurs during drawing, the "done" callback should be called with
* that error.
*
* @typedef {function(function(Error))} Loader
*/
/**
* @constructor
* @extends {ol.ImageBase}
* @param {ol.Extent} extent Extent.
* @extends {module:ol/ImageBase~ImageBase}
* @param {module:ol/extent~Extent} extent Extent.
* @param {number} resolution Resolution.
* @param {number} pixelRatio Pixel ratio.
* @param {HTMLCanvasElement} canvas Canvas.
* @param {ol.ImageCanvasLoader=} opt_loader Optional loader function to
* @param {module:ol/ImageCanvas~Loader=} opt_loader Optional loader function to
* support asynchronous canvas drawing.
*/
const ImageCanvas = function(extent, resolution, pixelRatio, canvas, opt_loader) {
/**
* Optional canvas loader function.
* @type {?ol.ImageCanvasLoader}
* @type {?module:ol/ImageCanvas~Loader}
* @private
*/
this.loader_ = opt_loader !== undefined ? opt_loader : null;

View File

@@ -10,13 +10,13 @@ import EventType from './events/EventType.js';
/**
* @constructor
* @extends {ol.Tile}
* @param {ol.TileCoord} tileCoord Tile coordinate.
* @param {ol.TileState} state State.
* @extends {module:ol/Tile~Tile}
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate.
* @param {module:ol/TileState~TileState} state State.
* @param {string} src Image source URI.
* @param {?string} crossOrigin Cross origin.
* @param {ol.TileLoadFunctionType} tileLoadFunction Tile load function.
* @param {olx.TileOptions=} opt_options Tile options.
* @param {module:ol/Tile~LoadFunction} tileLoadFunction Tile load function.
* @param {module:ol/Tile~Options=} opt_options Tile options.
*/
const ImageTile = function(tileCoord, state, src, crossOrigin, tileLoadFunction, opt_options) {
@@ -47,13 +47,13 @@ const ImageTile = function(tileCoord, state, src, crossOrigin, tileLoadFunction,
/**
* @private
* @type {Array.<ol.EventsKey>}
* @type {Array.<module:ol/events~EventsKey>}
*/
this.imageListenerKeys_ = null;
/**
* @private
* @type {ol.TileLoadFunctionType}
* @type {module:ol/Tile~LoadFunction}
*/
this.tileLoadFunction_ = tileLoadFunction;

View File

@@ -41,47 +41,53 @@ registerMultiple(PluginType.LAYER_RENDERER, [
* The map is the core component of OpenLayers. For a map to render, a view,
* one or more layers, and a target container are needed:
*
* import Map from 'ol/Map';
* import View from 'ol/View';
* import TileLayer from 'ol/layer/Tile';
* import OSM from 'ol/source/OSM';
*
* var map = new Map({
* view: new ol.View({
* view: new View({
* center: [0, 0],
* zoom: 1
* }),
* layers: [
* new ol.layer.Tile({
* source: new ol.source.OSM()
* new TileLayer({
* source: new OSM()
* })
* ],
* target: 'map'
* });
*
* The above snippet creates a map using a {@link ol.layer.Tile} to display
* {@link ol.source.OSM} OSM data and render it to a DOM element with the
* id `map`.
* The above snippet creates a map using a {@link module:ol/layer/Tile~Tile} to
* display {@link module:ol/source/OSM~OSM} OSM data and render it to a DOM
* element with the id `map`.
*
* The constructor places a viewport container (with CSS class name
* `ol-viewport`) in the target element (see `getViewport()`), and then two
* further elements within the viewport: one with CSS class name
* `ol-overlaycontainer-stopevent` for controls and some overlays, and one with
* CSS class name `ol-overlaycontainer` for other overlays (see the `stopEvent`
* option of {@link ol.Overlay} for the difference). The map itself is placed in
* a further element within the viewport.
* option of {@link module:ol/Overlay~Overlay} for the difference). The map
* itself is placed in a further element within the viewport.
*
* Layers are stored as a `ol.Collection` in layerGroups. A top-level group is
* provided by the library. This is what is accessed by `getLayerGroup` and
* `setLayerGroup`. Layers entered in the options are added to this group, and
* `addLayer` and `removeLayer` change the layer collection in the group.
* `getLayers` is a convenience function for `getLayerGroup().getLayers()`.
* Note that `ol.layer.Group` is a subclass of `ol.layer.Base`, so layers
* entered in the options or added with `addLayer` can be groups, which can
* contain further groups, and so on.
* Layers are stored as a {@link module:ol/Collection~Collection} in
* layerGroups. A top-level group is provided by the library. This is what is
* accessed by `getLayerGroup` and `setLayerGroup`. Layers entered in the
* options are added to this group, and `addLayer` and `removeLayer` change the
* layer collection in the group. `getLayers` is a convenience function for
* `getLayerGroup().getLayers()`. Note that {@link module:ol/layer/Group~Group}
* is a subclass of {@link module:ol/layer/Base~Base}, so layers entered in the
* options or added with `addLayer` can be groups, which can contain further
* groups, and so on.
*
* @constructor
* @extends {ol.PluggableMap}
* @param {olx.MapOptions} options Map options.
* @fires ol.MapBrowserEvent
* @fires ol.MapEvent
* @fires ol.render.Event#postcompose
* @fires ol.render.Event#precompose
* @extends {module:ol/PluggableMap~PluggableMap}
* @param {module:ol/PluggableMap~MapOptions} options Map options.
* @fires module:ol/MapBrowserEvent~MapBrowserEvent
* @fires module:ol/MapEvent~MapEvent
* @fires module:ol/render/Event~Event#postcompose
* @fires module:ol/render/Event~Event#precompose
* @api
*/
const Map = function(options) {

View File

@@ -7,13 +7,13 @@ import MapEvent from './MapEvent.js';
/**
* @classdesc
* Events emitted as map browser events are instances of this type.
* See {@link ol.Map} for which events trigger a map browser event.
* See {@link module:ol/Map~Map} for which events trigger a map browser event.
*
* @constructor
* @extends {ol.MapEvent}
* @extends {module:ol/MapEvent~MapEvent}
* @implements {oli.MapBrowserEvent}
* @param {string} type Event type.
* @param {ol.PluggableMap} map Map.
* @param {module:ol/PluggableMap~PluggableMap} map Map.
* @param {Event} browserEvent Browser event.
* @param {boolean=} opt_dragging Is the map currently being dragged?
* @param {?olx.FrameState=} opt_frameState Frame state.
@@ -32,14 +32,14 @@ const MapBrowserEvent = function(type, map, browserEvent, opt_dragging, opt_fram
/**
* The map pixel relative to the viewport corresponding to the original browser event.
* @type {ol.Pixel}
* @type {module:ol~Pixel}
* @api
*/
this.pixel = map.getEventPixel(browserEvent);
/**
* The coordinate in view projection corresponding to the original browser event.
* @type {ol.Coordinate}
* @type {module:ol/coordinate~Coordinate}
* @api
*/
this.coordinate = map.getCoordinateFromPixel(this.pixel);

View File

@@ -11,10 +11,12 @@ import PointerEventType from './pointer/EventType.js';
import PointerEventHandler from './pointer/PointerEventHandler.js';
/**
* @param {ol.PluggableMap} map The map with the viewport to listen to events on.
* @param {number|undefined} moveTolerance The minimal distance the pointer must travel to trigger a move.
* @param {module:ol/PluggableMap~PluggableMap} map The map with the viewport to
* listen to events on.
* @param {number=} moveTolerance The minimal distance the pointer must travel
* to trigger a move.
* @constructor
* @extends {ol.events.EventTarget}
* @extends {module:ol/events/EventTarget~EventTarget}
*/
const MapBrowserEventHandler = function(map, moveTolerance) {
@@ -22,7 +24,7 @@ const MapBrowserEventHandler = function(map, moveTolerance) {
/**
* This is the element that we will listen to the real events on.
* @type {ol.PluggableMap}
* @type {module:ol/PluggableMap~PluggableMap}
* @private
*/
this.map_ = map;
@@ -40,7 +42,7 @@ const MapBrowserEventHandler = function(map, moveTolerance) {
this.dragging_ = false;
/**
* @type {!Array.<ol.EventsKey>}
* @type {!Array.<module:ol/events~EventsKey>}
* @private
*/
this.dragListenerKeys_ = [];
@@ -55,7 +57,7 @@ const MapBrowserEventHandler = function(map, moveTolerance) {
/**
* The most recent "down" type event (or null if none have occurred).
* Set on pointerdown.
* @type {ol.pointer.PointerEvent}
* @type {module:ol/pointer/PointerEvent~PointerEvent}
* @private
*/
this.down_ = null;
@@ -78,7 +80,7 @@ const MapBrowserEventHandler = function(map, moveTolerance) {
* Event handler which generates pointer events for
* the viewport element.
*
* @type {ol.pointer.PointerEventHandler}
* @type {module:ol/pointer/PointerEventHandler~PointerEventHandler}
* @private
*/
this.pointerEventHandler_ = new PointerEventHandler(element);
@@ -87,13 +89,13 @@ const MapBrowserEventHandler = function(map, moveTolerance) {
* Event handler which generates pointer events for
* the document (used when dragging).
*
* @type {ol.pointer.PointerEventHandler}
* @type {module:ol/pointer/PointerEventHandler~PointerEventHandler}
* @private
*/
this.documentPointerEventHandler_ = null;
/**
* @type {?ol.EventsKey}
* @type {?module:ol/events~EventsKey}
* @private
*/
this.pointerdownListenerKey_ = listen(this.pointerEventHandler_,
@@ -101,7 +103,7 @@ const MapBrowserEventHandler = function(map, moveTolerance) {
this.handlePointerDown_, this);
/**
* @type {?ol.EventsKey}
* @type {?module:ol/events~EventsKey}
* @private
*/
this.relayedListenerKey_ = listen(this.pointerEventHandler_,
@@ -114,7 +116,8 @@ inherits(MapBrowserEventHandler, EventTarget);
/**
* @param {ol.pointer.PointerEvent} pointerEvent Pointer event.
* @param {module:ol/pointer/PointerEvent~PointerEvent} pointerEvent Pointer
* event.
* @private
*/
MapBrowserEventHandler.prototype.emulateClick_ = function(pointerEvent) {
@@ -143,7 +146,8 @@ MapBrowserEventHandler.prototype.emulateClick_ = function(pointerEvent) {
/**
* Keeps track on how many pointers are currently active.
*
* @param {ol.pointer.PointerEvent} pointerEvent Pointer event.
* @param {module:ol/pointer/PointerEvent~PointerEvent} pointerEvent Pointer
* event.
* @private
*/
MapBrowserEventHandler.prototype.updateActivePointers_ = function(pointerEvent) {
@@ -160,7 +164,8 @@ MapBrowserEventHandler.prototype.updateActivePointers_ = function(pointerEvent)
/**
* @param {ol.pointer.PointerEvent} pointerEvent Pointer event.
* @param {module:ol/pointer/PointerEvent~PointerEvent} pointerEvent Pointer
* event.
* @private
*/
MapBrowserEventHandler.prototype.handlePointerUp_ = function(pointerEvent) {
@@ -191,7 +196,8 @@ MapBrowserEventHandler.prototype.handlePointerUp_ = function(pointerEvent) {
/**
* @param {ol.pointer.PointerEvent} pointerEvent Pointer event.
* @param {module:ol/pointer/PointerEvent~PointerEvent} pointerEvent Pointer
* event.
* @return {boolean} If the left mouse button was pressed.
* @private
*/
@@ -201,7 +207,8 @@ MapBrowserEventHandler.prototype.isMouseActionButton_ = function(pointerEvent) {
/**
* @param {ol.pointer.PointerEvent} pointerEvent Pointer event.
* @param {module:ol/pointer/PointerEvent~PointerEvent} pointerEvent Pointer
* event.
* @private
*/
MapBrowserEventHandler.prototype.handlePointerDown_ = function(pointerEvent) {
@@ -249,7 +256,8 @@ MapBrowserEventHandler.prototype.handlePointerDown_ = function(pointerEvent) {
/**
* @param {ol.pointer.PointerEvent} pointerEvent Pointer event.
* @param {module:ol/pointer/PointerEvent~PointerEvent} pointerEvent Pointer
* event.
* @private
*/
MapBrowserEventHandler.prototype.handlePointerMove_ = function(pointerEvent) {
@@ -275,7 +283,8 @@ MapBrowserEventHandler.prototype.handlePointerMove_ = function(pointerEvent) {
/**
* Wrap and relay a pointer event. Note that this requires that the type
* string for the MapBrowserPointerEvent matches the PointerEvent type.
* @param {ol.pointer.PointerEvent} pointerEvent Pointer event.
* @param {module:ol/pointer/PointerEvent~PointerEvent} pointerEvent Pointer
* event.
* @private
*/
MapBrowserEventHandler.prototype.relayEvent_ = function(pointerEvent) {
@@ -286,7 +295,8 @@ MapBrowserEventHandler.prototype.relayEvent_ = function(pointerEvent) {
/**
* @param {ol.pointer.PointerEvent} pointerEvent Pointer event.
* @param {module:ol/pointer/PointerEvent~PointerEvent} pointerEvent Pointer
* event.
* @return {boolean} Is moving.
* @private
*/

View File

@@ -12,28 +12,28 @@ export default {
/**
* A true single click with no dragging and no double click. Note that this
* event is delayed by 250 ms to ensure that it is not a double click.
* @event ol.MapBrowserEvent#singleclick
* @event module:ol/MapBrowserEvent~MapBrowserEvent#singleclick
* @api
*/
SINGLECLICK: 'singleclick',
/**
* A click with no dragging. A double click will fire two of this.
* @event ol.MapBrowserEvent#click
* @event module:ol/MapBrowserEvent~MapBrowserEvent#click
* @api
*/
CLICK: EventType.CLICK,
/**
* A true double click, with no dragging.
* @event ol.MapBrowserEvent#dblclick
* @event module:ol/MapBrowserEvent~MapBrowserEvent#dblclick
* @api
*/
DBLCLICK: EventType.DBLCLICK,
/**
* Triggered when a pointer is dragged.
* @event ol.MapBrowserEvent#pointerdrag
* @event module:ol/MapBrowserEvent~MapBrowserEvent#pointerdrag
* @api
*/
POINTERDRAG: 'pointerdrag',
@@ -41,7 +41,7 @@ export default {
/**
* Triggered when a pointer is moved. Note that on touch devices this is
* triggered when the map is panned, so is not the same as mousemove.
* @event ol.MapBrowserEvent#pointermove
* @event module:ol/MapBrowserEvent~MapBrowserEvent#pointermove
* @api
*/
POINTERMOVE: 'pointermove',

View File

@@ -6,12 +6,13 @@ import MapBrowserEvent from './MapBrowserEvent.js';
/**
* @constructor
* @extends {ol.MapBrowserEvent}
* @extends {module:ol/MapBrowserEvent~MapBrowserEvent}
* @param {string} type Event type.
* @param {ol.PluggableMap} map Map.
* @param {ol.pointer.PointerEvent} pointerEvent Pointer event.
* @param {module:ol/PluggableMap~PluggableMap} map Map.
* @param {module:ol/pointer/PointerEvent~PointerEvent} pointerEvent Pointer
* event.
* @param {boolean=} opt_dragging Is the map currently being dragged?
* @param {?olx.FrameState=} opt_frameState Frame state.
* @param {?module:ol/PluggableMap~FrameState=} opt_frameState Frame state.
*/
const MapBrowserPointerEvent = function(type, map, pointerEvent, opt_dragging,
opt_frameState) {
@@ -21,7 +22,7 @@ const MapBrowserPointerEvent = function(type, map, pointerEvent, opt_dragging,
/**
* @const
* @type {ol.pointer.PointerEvent}
* @type {module:ol/pointer/PointerEvent~PointerEvent}
*/
this.pointerEvent = pointerEvent;

View File

@@ -7,14 +7,14 @@ import Event from './events/Event.js';
/**
* @classdesc
* Events emitted as map events are instances of this type.
* See {@link ol.Map} for which events trigger a map event.
* See {@link module:ol/Map~Map} for which events trigger a map event.
*
* @constructor
* @extends {ol.events.Event}
* @extends {module:ol/events/Event~Event}
* @implements {oli.MapEvent}
* @param {string} type Event type.
* @param {ol.PluggableMap} map Map.
* @param {?olx.FrameState=} opt_frameState Frame state.
* @param {module:ol/PluggableMap~PluggableMap} map Map.
* @param {?module:ol/PluggableMap~FrameState=} opt_frameState Frame state.
*/
const MapEvent = function(type, map, opt_frameState) {
@@ -22,14 +22,14 @@ const MapEvent = function(type, map, opt_frameState) {
/**
* The map where the event occurred.
* @type {ol.PluggableMap}
* @type {module:ol/PluggableMap~PluggableMap}
* @api
*/
this.map = map;
/**
* The frame state at the time of the event.
* @type {?olx.FrameState}
* @type {?module:ol/PluggableMap~FrameState}
* @api
*/
this.frameState = opt_frameState !== undefined ? opt_frameState : null;

View File

@@ -9,21 +9,21 @@ export default {
/**
* Triggered after a map frame is rendered.
* @event ol.MapEvent#postrender
* @event module:ol/MapEvent~MapEvent#postrender
* @api
*/
POSTRENDER: 'postrender',
/**
* Triggered when the map starts moving.
* @event ol.MapEvent#movestart
* @event module:ol/MapEvent~MapEvent#movestart
* @api
*/
MOVESTART: 'movestart',
/**
* Triggered after the map is moved.
* @event ol.MapEvent#moveend
* @event module:ol/MapEvent~MapEvent#moveend
* @api
*/
MOVEEND: 'moveend'

View File

@@ -10,16 +10,17 @@ import {assign} from './obj.js';
/**
* @classdesc
* Events emitted by {@link ol.Object} instances are instances of this type.
* Events emitted by {@link module:ol/Object~Object} instances are instances of
* this type.
*
* @param {string} type The event type.
* @param {string} key The property name.
* @param {*} oldValue The old value for `key`.
* @extends {ol.events.Event}
* @extends {module:ol/events/Event~Event}
* @implements {oli.Object.Event}
* @constructor
*/
const BaseObjectEvent = function(type, key, oldValue) {
const ObjectEvent = function(type, key, oldValue) {
Event.call(this, type);
/**
@@ -38,7 +39,7 @@ const BaseObjectEvent = function(type, key, oldValue) {
this.oldValue = oldValue;
};
inherits(BaseObjectEvent, Event);
inherits(ObjectEvent, Event);
/**
@@ -47,29 +48,30 @@ inherits(BaseObjectEvent, Event);
* instantiated in apps.
* Most non-trivial classes inherit from this.
*
* This extends {@link ol.Observable} with observable properties, where each
* property is observable as well as the object as a whole.
* This extends {@link module:ol/Observable~Observable} with observable
* properties, where each property is observable as well as the object as a
* whole.
*
* Classes that inherit from this have pre-defined properties, to which you can
* add your owns. The pre-defined properties are listed in this documentation as
* 'Observable Properties', and have their own accessors; for example,
* {@link ol.Map} has a `target` property, accessed with `getTarget()` and
* changed with `setTarget()`. Not all properties are however settable. There
* are also general-purpose accessors `get()` and `set()`. For example,
* `get('target')` is equivalent to `getTarget()`.
* {@link module:ol/Map~Map} has a `target` property, accessed with
* `getTarget()` and changed with `setTarget()`. Not all properties are however
* settable. There are also general-purpose accessors `get()` and `set()`. For
* example, `get('target')` is equivalent to `getTarget()`.
*
* The `set` accessors trigger a change event, and you can monitor this by
* registering a listener. For example, {@link ol.View} has a `center`
* property, so `view.on('change:center', function(evt) {...});` would call the
* function whenever the value of the center property changes. Within the
* function, `evt.target` would be the view, so `evt.target.getCenter()` would
* return the new center.
* registering a listener. For example, {@link module:ol/View~View} has a
* `center` property, so `view.on('change:center', function(evt) {...});` would
* call the function whenever the value of the center property changes. Within
* the function, `evt.target` would be the view, so `evt.target.getCenter()`
* would return the new center.
*
* You can add your own observable properties with
* `object.set('prop', 'value')`, and retrieve that with `object.get('prop')`.
* You can listen for changes on that property value with
* `object.on('change:prop', listener)`. You can get a list of all
* properties with {@link ol.Object#getProperties object.getProperties()}.
* properties with {@link module:ol/Object~Object#getProperties}.
*
* Note that the observable properties are separate from standard JS properties.
* You can, for example, give your map object a title with
@@ -81,18 +83,18 @@ inherits(BaseObjectEvent, Event);
* object.unset('foo').
*
* @constructor
* @extends {ol.Observable}
* @extends {module:ol/Observable~Observable}
* @param {Object.<string, *>=} opt_values An object with key-value pairs.
* @fires ol.Object.Event
* @fires module:ol/Object~ObjectEvent
* @api
*/
const BaseObject = function(opt_values) {
Observable.call(this);
// Call ol.getUid to ensure that the order of objects' ids is the same as
// the order in which they were created. This also helps to ensure that
// object properties are always added in the same order, which helps many
// JavaScript engines generate faster code.
// Call {@link module:ol~getUid} to ensure that the order of objects' ids is
// the same as the order in which they were created. This also helps to
// ensure that object properties are always added in the same order, which
// helps many JavaScript engines generate faster code.
getUid(this);
/**
@@ -168,9 +170,9 @@ BaseObject.prototype.getProperties = function() {
BaseObject.prototype.notify = function(key, oldValue) {
let eventType;
eventType = getChangeEventType(key);
this.dispatchEvent(new BaseObjectEvent(eventType, key, oldValue));
this.dispatchEvent(new ObjectEvent(eventType, key, oldValue));
eventType = ObjectEventType.PROPERTYCHANGE;
this.dispatchEvent(new BaseObjectEvent(eventType, key, oldValue));
this.dispatchEvent(new ObjectEvent(eventType, key, oldValue));
};

View File

@@ -8,7 +8,7 @@
export default {
/**
* Triggered when a property is changed.
* @event ol.Object.Event#propertychange
* @event module:ol/Object~Event#propertychange
* @api
*/
PROPERTYCHANGE: 'propertychange'

View File

@@ -12,11 +12,11 @@ import EventType from './events/EventType.js';
* instantiated in apps.
* An event target providing convenient methods for listener registration
* and unregistration. A generic `change` event is always available through
* {@link ol.Observable#changed}.
* {@link module:ol/Observable~Observable#changed}.
*
* @constructor
* @extends {ol.events.EventTarget}
* @fires ol.events.Event
* @extends {module:ol/events/EventTarget~EventTarget}
* @fires module:ol/events/Event~Event
* @struct
* @api
*/
@@ -37,7 +37,7 @@ inherits(Observable, EventTarget);
/**
* Removes an event listener using the key returned by `on()` or `once()`.
* @param {ol.EventsKey|Array.<ol.EventsKey>} key The key returned by `on()`
* @param {module:ol/events~EventsKey|Array.<module:ol/events~EventsKey>} key The key returned by `on()`
* or `once()` (or an array of keys).
* @api
*/
@@ -47,7 +47,7 @@ export function unByKey(key) {
unlistenByKey(key[i]);
}
} else {
unlistenByKey(/** @type {ol.EventsKey} */ (key));
unlistenByKey(/** @type {module:ol/events~EventsKey} */ (key));
}
}
@@ -68,8 +68,8 @@ Observable.prototype.changed = function() {
* Object with a `type` property.
*
* @param {{type: string,
* target: (EventTarget|ol.events.EventTarget|undefined)}|ol.events.Event|
* string} event Event object.
* target: (EventTarget|module:ol/events/EventTarget~EventTarget|undefined)}|
* module:ol/events/Event~Event|string} event Event object.
* @function
* @api
*/
@@ -91,7 +91,7 @@ Observable.prototype.getRevision = function() {
* Listen for a certain type of event.
* @param {string|Array.<string>} type The event type or array of event types.
* @param {function(?): ?} listener The listener function.
* @return {ol.EventsKey|Array.<ol.EventsKey>} Unique key for the listener. If
* @return {module:ol/events~EventsKey|Array.<module:ol/events~EventsKey>} Unique key for the listener. If
* called with an array of event types as the first argument, the return
* will be an array of keys.
* @api
@@ -114,7 +114,7 @@ Observable.prototype.on = function(type, listener) {
* Listen once for a certain type of event.
* @param {string|Array.<string>} type The event type or array of event types.
* @param {function(?): ?} listener The listener function.
* @return {ol.EventsKey|Array.<ol.EventsKey>} Unique key for the listener. If
* @return {module:ol/events~EventsKey|Array.<module:ol/events~EventsKey>} Unique key for the listener. If
* called with an array of event types as the first argument, the return
* will be an array of keys.
* @api

View File

@@ -11,6 +11,57 @@ import {listen, unlistenByKey} from './events.js';
import {containsExtent} from './extent.js';
/**
* @typedef {Object} OverlayOptions
* @property {number|string} [id] Set the overlay id. The overlay id can be used
* with the {@link module:ol/Map~Map#getOverlayById} method.
* @property {Element} [element] The overlay element.
* @property {Array.<number>} [offset=[0, 0]] 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.
* @property {module:ol/coordinate~Coordinate~Coordinate} [position] The overlay position
* in map projection.
* @property {module:ol/OverlayPositioning~OverlayPositioning} [positioning='top-left'] 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'`.
* @property {boolean} [stopEvent=true] Whether event propagation to the map
* viewport should be stopped. 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`.
* @property {boolean} [insertFirst=true] Whether the overlay is inserted first
* in the overlay container, or appended. 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.
* @property {boolean} [autoPan=false] If set to `true` the map is panned when
* calling `setPosition`, so that the overlay is entirely visible in the current
* viewport.
* @property {module:ol/Overlay~OverlayPanOptions} [autoPanAnimation] 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.
* @property {number} [autoPanMargin=20] The margin (in pixels) between the
* overlay and the borders of the map when autopanning.
* @property {string} [className='ol-overlay-container ol-selectable'] CSS class
* name.
*/
/**
* @typedef {Object} OverlayPanOptions
* @property {number} [duration=1000] The duration of the animation in
* milliseconds.
* @property {function(number):number} [easing] The easing function to use. Can
* be one from {@link module:ol/easing} or a custom function.
* Default is {@link module:ol/easing~inAndOut}.
*/
/**
* @enum {string}
* @protected
@@ -27,21 +78,23 @@ const Property = {
/**
* @classdesc
* An element to be displayed over the map and attached to a single map
* location. Like {@link ol.control.Control}, Overlays are visible widgets.
* Unlike Controls, they are not in a fixed position on the screen, but are tied
* to a geographical coordinate, so panning the map will move an Overlay but not
* a Control.
* location. Like {@link module:ol/control/Control~Control}, Overlays are
* visible widgets. Unlike Controls, they are not in a fixed position on the
* screen, but are tied to a geographical coordinate, so panning the map will
* move an Overlay but not a Control.
*
* Example:
*
* var popup = new ol.Overlay({
* import Overlay from 'ol/Overlay';
*
* var popup = new Overlay({
* element: document.getElementById('popup')
* });
* popup.setPosition(coordinate);
* map.addOverlay(popup);
*
* @constructor
* @extends {ol.Object}
* @extends {module:ol/Object~Object}
* @param {olx.OverlayOptions} options Overlay options.
* @api
*/
@@ -121,7 +174,7 @@ const Overlay = function(options) {
/**
* @protected
* @type {?ol.EventsKey}
* @type {?module:ol/events~EventsKey}
*/
this.mapPostrenderListenerKey = null;
@@ -152,7 +205,7 @@ const Overlay = function(options) {
this.setOffset(options.offset !== undefined ? options.offset : [0, 0]);
this.setPositioning(options.positioning !== undefined ?
/** @type {ol.OverlayPositioning} */ (options.positioning) :
/** @type {module:ol/OverlayPositioning~OverlayPositioning} */ (options.positioning) :
OverlayPositioning.TOP_LEFT);
if (options.position !== undefined) {
@@ -187,12 +240,13 @@ Overlay.prototype.getId = function() {
/**
* Get the map associated with this overlay.
* @return {ol.PluggableMap|undefined} The map that the overlay is part of.
* @return {module:ol/PluggableMap~PluggableMap|undefined} The map that the
* overlay is part of.
* @observable
* @api
*/
Overlay.prototype.getMap = function() {
return /** @type {ol.PluggableMap|undefined} */ (this.get(Property.MAP));
return /** @type {module:ol/PluggableMap~PluggableMap|undefined} */ (this.get(Property.MAP));
};
@@ -209,25 +263,25 @@ Overlay.prototype.getOffset = function() {
/**
* Get the current position of this overlay.
* @return {ol.Coordinate|undefined} The spatial point that the overlay is
* @return {module:ol/coordinate~Coordinate|undefined} The spatial point that the overlay is
* anchored at.
* @observable
* @api
*/
Overlay.prototype.getPosition = function() {
return /** @type {ol.Coordinate|undefined} */ (this.get(Property.POSITION));
return /** @type {module:ol/coordinate~Coordinate|undefined} */ (this.get(Property.POSITION));
};
/**
* Get the current positioning of this overlay.
* @return {ol.OverlayPositioning} How the overlay is positioned
* @return {module:ol/OverlayPositioning~OverlayPositioning} How the overlay is positioned
* relative to its point on the map.
* @observable
* @api
*/
Overlay.prototype.getPositioning = function() {
return /** @type {ol.OverlayPositioning} */ (this.get(Property.POSITIONING));
return /** @type {module:ol/OverlayPositioning~OverlayPositioning} */ (this.get(Property.POSITIONING));
};
@@ -316,7 +370,8 @@ Overlay.prototype.setElement = function(element) {
/**
* Set the map to be associated with this overlay.
* @param {ol.PluggableMap|undefined} map The map that the overlay is part of.
* @param {module:ol/PluggableMap~PluggableMap|undefined} map The map that the
* overlay is part of.
* @observable
* @api
*/
@@ -339,7 +394,7 @@ Overlay.prototype.setOffset = function(offset) {
/**
* Set the position for this overlay. If the position is `undefined` the
* overlay is hidden.
* @param {ol.Coordinate|undefined} position The spatial point that the overlay
* @param {module:ol/coordinate~Coordinate|undefined} position The spatial point that the overlay
* is anchored at.
* @observable
* @api
@@ -390,7 +445,7 @@ Overlay.prototype.panIntoView = function() {
}
if (delta[0] !== 0 || delta[1] !== 0) {
const center = /** @type {ol.Coordinate} */ (map.getView().getCenter());
const center = /** @type {module:ol/coordinate~Coordinate} */ (map.getView().getCenter());
const centerPx = map.getPixelFromCoordinate(center);
const newCenterPx = [
centerPx[0] + delta[0],
@@ -410,8 +465,8 @@ Overlay.prototype.panIntoView = function() {
/**
* Get the extent of an element relative to the document
* @param {Element|undefined} element The element.
* @param {ol.Size|undefined} size The size of the element.
* @return {ol.Extent} The extent.
* @param {module:ol/size~Size|undefined} size The size of the element.
* @return {module:ol/extent~Extent} The extent.
* @protected
*/
Overlay.prototype.getRect = function(element, size) {
@@ -429,7 +484,7 @@ Overlay.prototype.getRect = function(element, size) {
/**
* Set the positioning for this overlay.
* @param {ol.OverlayPositioning} positioning how the overlay is
* @param {module:ol/OverlayPositioning~OverlayPositioning} positioning how the overlay is
* positioned relative to its point on the map.
* @observable
* @api
@@ -471,8 +526,8 @@ Overlay.prototype.updatePixelPosition = function() {
/**
* @param {ol.Pixel} pixel The pixel location.
* @param {ol.Size|undefined} mapSize The map size.
* @param {module:ol~Pixel} pixel The pixel location.
* @param {module:ol/size~Size|undefined} mapSize The map size.
* @protected
*/
Overlay.prototype.updateRenderedPosition = function(pixel, mapSize) {

View File

@@ -31,6 +31,36 @@ import {DROP} from './structs/PriorityQueue.js';
import {create as createTransform, apply as applyTransform} from './transform.js';
/**
* State of the current frame. Only `pixelRatio`, `time` and `viewState` should
* be used in applications.
* @typedef {Object} FrameState
* @property {number} pixelRatio The pixel ratio of the frame.
* @property {number} time The time when rendering of the frame was requested.
* @property {olx.ViewState} viewState The state of the current view.
* @property {boolean} animate
* @property {module:ol/transform~Transform} coordinateToPixelTransform
* @property {null|module:ol/extent~Extent} extent
* @property {module:ol/coordinate~Coordinate} focus
* @property {number} index
* @property {Object.<number, module:ol/layer/Layer~State>} layerStates
* @property {Array.<module:ol/layer/Layer~State} layerStatesArray
* @property {module:ol/transform~Transform} pixelToCoordinateTransform
* @property {Array.<module:ol/PluggableMap~PostRenderFunction>} postRenderFunctions
* @property {module:ol/size~Size} size
* @property {!Object.<string, boolean>} skippedFeatureUids
* @property {module:ol/TileQueue~TileQueue} tileQueue
* @property {Object.<string, Object.<string, module:ol/TileRange~TileRange>>} usedTiles
* @property {Array.<number>} viewHints
* @property {!Object.<string, Object.<string, boolean>>} wantedTiles
*/
/**
* @typedef {function(module:ol/PluggableMap~PluggableMap, ?olx.FrameState): boolean} PostRenderFunction
*/
/**
* @typedef {Object} MapOptionsInternal
* @property {module:ol/Collection~Collection.<module:ol/control/Control~Control>} [controls]
@@ -45,7 +75,7 @@ import {create as createTransform, apply as applyTransform} from './transform.js
/**
* Object literal with config options for the map.
* @typedef {Object} MapOptions
* @property {module:ol/Collection~Collectiion.<module:ol/control/Control~Control>|Array.<module:ol/control/Control~Control>} [controls]
* @property {module:ol/Collection~Collection.<module:ol/control/Control~Control>|Array.<module:ol/control/Control~Control>} [controls]
* Controls initially added to the map. If not specified,
* {@link module:ol/control~defaults} is used.
* @property {number} [pixelRatio=window.devicePixelRatio] The ratio between
@@ -157,13 +187,13 @@ const PluggableMap = function(options) {
/**
* @private
* @type {module:ol/types~Transform}
* @type {module:ol/transform~Transform}
*/
this.coordinateToPixelTransform_ = createTransform();
/**
* @private
* @type {module:ol/types~Transform}
* @type {module:ol/transform~Transform}
*/
this.pixelToCoordinateTransform_ = createTransform();
@@ -182,25 +212,25 @@ const PluggableMap = function(options) {
/**
* The extent at the previous 'moveend' event.
* @private
* @type {module:ol/types~Extent}
* @type {module:ol/extent~Extent}
*/
this.previousExtent_ = null;
/**
* @private
* @type {?module:ol/types~EventsKey}
* @type {?module:ol/events~EventsKey}
*/
this.viewPropertyListenerKey_ = null;
/**
* @private
* @type {?module:ol/types~EventsKey}
* @type {?module:ol/events~EventsKey}
*/
this.viewChangeListenerKey_ = null;
/**
* @private
* @type {Array.<module:ol/types~EventsKey>}
* @type {Array.<module:ol/events~EventsKey>}
*/
this.layerGroupPropertyListenerKeys_ = null;
@@ -265,7 +295,7 @@ const PluggableMap = function(options) {
/**
* @private
* @type {Array.<module:ol/types~EventsKey>}
* @type {Array.<module:ol/events~EventsKey>}
*/
this.keyHandlerKeys_ = null;
@@ -315,13 +345,13 @@ const PluggableMap = function(options) {
/**
* @private
* @type {module:ol/types~Coordinate}
* @type {module:ol/coordinate~Coordinate}
*/
this.focus_ = null;
/**
* @private
* @type {!Array.<module:ol/types~PostRenderFunction>}
* @type {!Array.<module:ol/PluggableMap~PostRenderFunction>}
*/
this.postRenderFunctions_ = [];
@@ -515,7 +545,7 @@ PluggableMap.prototype.disposeInternal = function() {
* Detect features that intersect a pixel on the viewport, and execute a
* callback with each intersecting feature. Layers included in the detection can
* be configured through the `layerFilter` option in `opt_options`.
* @param {module:ol/types~Pixel} pixel Pixel.
* @param {module:ol~Pixel} pixel Pixel.
* @param {function(this: S, (module:ol/Feature~Feature|module:ol/render/Feature~Feature),
* module:ol/layer/Layer~Layer): T} callback Feature callback. The callback will be
* called with two arguments. The first argument is one
@@ -548,7 +578,7 @@ PluggableMap.prototype.forEachFeatureAtPixel = function(pixel, callback, opt_opt
/**
* Get all features that intersect a pixel on the viewport.
* @param {module:ol/types~Pixel} pixel Pixel.
* @param {module:ol~Pixel} pixel Pixel.
* @param {olx.AtPixelOptions=} opt_options Optional options.
* @return {Array.<module:ol/Feature~Feature|module:ol/render/Feature~Feature>} The detected features or
* `null` if none were found.
@@ -569,7 +599,7 @@ PluggableMap.prototype.getFeaturesAtPixel = function(pixel, opt_options) {
* Detect layers that have a color value at a pixel on the viewport, and
* execute a callback with each matching layer. Layers included in the
* detection can be configured through `opt_layerFilter`.
* @param {module:ol/types~Pixel} pixel Pixel.
* @param {module:ol~Pixel} pixel Pixel.
* @param {function(this: S, module:ol/layer/Layer~Layer, (Uint8ClampedArray|Uint8Array)): T} callback
* Layer callback. This callback will receive two arguments: first is the
* {@link module:ol/layer/Layer~Layer layer}, second argument is an array representing
@@ -605,7 +635,7 @@ PluggableMap.prototype.forEachLayerAtPixel = function(pixel, callback, opt_this,
/**
* Detect if features intersect a pixel on the viewport. Layers included in the
* detection can be configured through `opt_layerFilter`.
* @param {module:ol/types~Pixel} pixel Pixel.
* @param {module:ol~Pixel} pixel Pixel.
* @param {olx.AtPixelOptions=} opt_options Optional options.
* @return {boolean} Is there a feature at the given pixel?
* @template U
@@ -628,7 +658,7 @@ PluggableMap.prototype.hasFeatureAtPixel = function(pixel, opt_options) {
/**
* Returns the coordinate in view projection for a browser event.
* @param {Event} event Event.
* @return {module:ol/types~Coordinate} Coordinate.
* @return {module:ol/coordinate~Coordinate} Coordinate.
* @api
*/
PluggableMap.prototype.getEventCoordinate = function(event) {
@@ -639,7 +669,7 @@ PluggableMap.prototype.getEventCoordinate = function(event) {
/**
* Returns the map pixel position for a browser event relative to the viewport.
* @param {Event} event Event.
* @return {module:ol/types~Pixel} Pixel.
* @return {module:ol~Pixel} Pixel.
* @api
*/
PluggableMap.prototype.getEventPixel = function(event) {
@@ -686,8 +716,8 @@ PluggableMap.prototype.getTargetElement = function() {
/**
* Get the coordinate for a given pixel. This returns a coordinate in the
* map view projection.
* @param {module:ol/types~Pixel} pixel Pixel position in the map viewport.
* @return {module:ol/types~Coordinate} The coordinate for the pixel position.
* @param {module:ol~Pixel} pixel Pixel position in the map viewport.
* @return {module:ol/coordinate~Coordinate} The coordinate for the pixel position.
* @api
*/
PluggableMap.prototype.getCoordinateFromPixel = function(pixel) {
@@ -774,8 +804,8 @@ PluggableMap.prototype.getLayers = function() {
/**
* Get the pixel for a coordinate. This takes a coordinate in the map view
* projection and returns the corresponding pixel.
* @param {module:ol/types~Coordinate} coordinate A map coordinate.
* @return {module:ol/types~Pixel} A pixel position in the map viewport.
* @param {module:ol/coordinate~Coordinate} coordinate A map coordinate.
* @return {module:ol~Pixel} A pixel position in the map viewport.
* @api
*/
PluggableMap.prototype.getPixelFromCoordinate = function(coordinate) {
@@ -799,12 +829,12 @@ PluggableMap.prototype.getRenderer = function() {
/**
* Get the size of this map.
* @return {module:ol/types~Size|undefined} The size in pixels of the map in the DOM.
* @return {module:ol/size~Size|undefined} The size in pixels of the map in the DOM.
* @observable
* @api
*/
PluggableMap.prototype.getSize = function() {
return /** @type {module:ol/types~Size|undefined} */ (this.get(MapProperty.SIZE));
return /** @type {module:ol/size~Size|undefined} */ (this.get(MapProperty.SIZE));
};
@@ -857,7 +887,7 @@ PluggableMap.prototype.getOverlayContainerStopEvent = function() {
/**
* @param {module:ol/Tile~Tile} tile Tile.
* @param {string} tileSourceKey Tile source key.
* @param {module:ol/types~Coordinate} tileCenter Tile center.
* @param {module:ol/coordinate~Coordinate} tileCenter Tile center.
* @param {number} tileResolution Tile resolution.
* @return {number} Tile priority.
*/
@@ -1277,7 +1307,7 @@ PluggableMap.prototype.setLayerGroup = function(layerGroup) {
/**
* Set the size of this map.
* @param {module:ol/types~Size|undefined} size The size in pixels of the map in the DOM.
* @param {module:ol/size~Size|undefined} size The size in pixels of the map in the DOM.
* @observable
* @api
*/

View File

@@ -7,16 +7,52 @@ import {easeIn} from './easing.js';
import EventTarget from './events/EventTarget.js';
import EventType from './events/EventType.js';
/**
* A function that takes an {@link module:ol/Tile~Tile} for the tile and a
* `{string}` for the url as arguments.
*
* @typedef {function(module:ol/Tile~Tile, string)} LoadFunction
* @api
*/
/**
* {@link module:ol/source/Tile~Tile} sources use a function of this type to get
* the url that provides a tile for a given tile coordinate.
*
* This function takes an {@link module:ol/tilecoord~TileCoord} for the tile
* coordinate, a `{number}` representing the pixel ratio and a
* {@link module:ol/proj/Projection~Projection} for the projection as arguments
* and returns a `{string}` representing the tile URL, or undefined if no tile
* should be requested for the passed tile coordinate.
*
* @typedef {function(module:ol/tilecoord~TileCoord, number,
* module:ol/proj/Projection~Projection): (string|undefined)} Type
* @api
*/
/**
* @typedef {Object} Options
* @property {number|undefined} transition 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.
* @api
*/
/**
* @classdesc
* Base class for tiles.
*
* @constructor
* @abstract
* @extends {ol.events.EventTarget}
* @param {ol.TileCoord} tileCoord Tile coordinate.
* @param {ol.TileState} state State.
* @param {olx.TileOptions=} opt_options Tile options.
* @extends {module:ol/events/EventTarget~EventTarget}
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate.
* @param {module:ol/TileState~TileState} state State.
* @param {module:ol/Tile~Options=} opt_options Tile options.
*/
const Tile = function(tileCoord, state, opt_options) {
EventTarget.call(this);
@@ -24,13 +60,13 @@ const Tile = function(tileCoord, state, opt_options) {
const options = opt_options ? opt_options : {};
/**
* @type {ol.TileCoord}
* @type {module:ol/tilecoord~TileCoord}
*/
this.tileCoord = tileCoord;
/**
* @protected
* @type {ol.TileState}
* @type {module:ol/TileState~TileState}
*/
this.state = state;
@@ -38,7 +74,7 @@ const Tile = function(tileCoord, state, opt_options) {
* An "interim" tile for this tile. The interim tile may be used while this
* one is loading, for "smooth" transitions when changing params/dimensions
* on the source.
* @type {ol.Tile}
* @type {module:ol/Tile~Tile}
*/
this.interimTile = null;
@@ -88,7 +124,7 @@ Tile.prototype.getKey = function() {
* Get the interim tile most suitable for rendering using the chain of interim
* tiles. This corresponds to the most recent tile that has been loaded, if no
* such tile exists, the original tile is returned.
* @return {!ol.Tile} Best tile for rendering.
* @return {!module:ol/Tile~Tile} Best tile for rendering.
*/
Tile.prototype.getInterimTile = function() {
if (!this.interimTile) {
@@ -148,7 +184,7 @@ Tile.prototype.refreshInterimChain = function() {
/**
* Get the tile coordinate for this tile.
* @return {ol.TileCoord} The tile coordinate.
* @return {module:ol/tilecoord~TileCoord} The tile coordinate.
* @api
*/
Tile.prototype.getTileCoord = function() {
@@ -157,14 +193,14 @@ Tile.prototype.getTileCoord = function() {
/**
* @return {ol.TileState} State.
* @return {module:ol/TileState~TileState} State.
*/
Tile.prototype.getState = function() {
return this.state;
};
/**
* @param {ol.TileState} state State.
* @param {module:ol/TileState~TileState} state State.
*/
Tile.prototype.setState = function(state) {
this.state = state;

View File

@@ -7,7 +7,7 @@ import {fromKey, getKey} from './tilecoord.js';
/**
* @constructor
* @extends {ol.structs.LRUCache.<ol.Tile>}
* @extends {module:ol/structs/LRUCache~LRUCache.<module:ol/Tile~Tile>}
* @param {number=} opt_highWaterMark High water mark.
* @struct
*/
@@ -21,7 +21,7 @@ inherits(TileCache, LRUCache);
/**
* @param {!Object.<string, ol.TileRange>} usedTiles Used tiles.
* @param {!Object.<string, module:ol/TileRange~TileRange>} usedTiles Used tiles.
*/
TileCache.prototype.expireCache = function(usedTiles) {
while (this.canExpireCache()) {

View File

@@ -7,10 +7,16 @@ import {listen, unlisten} from './events.js';
import EventType from './events/EventType.js';
import PriorityQueue from './structs/PriorityQueue.js';
/**
* @typedef {function(module:ol/Tile~Tile, string, module:ol/coordinate~Coordinate, number): number} PriorityFunction
*/
/**
* @constructor
* @extends {ol.structs.PriorityQueue.<Array>}
* @param {ol.TilePriorityFunction} tilePriorityFunction
* @extends {module:ol/structs/PriorityQueue~PriorityQueue.<Array>}
* @param {module:ol/TileQueue~PriorityFunction} tilePriorityFunction
* Tile priority function.
* @param {function(): ?} tileChangeCallback
* Function called on each tile change event.
@@ -32,7 +38,7 @@ const TileQueue = function(tilePriorityFunction, tileChangeCallback) {
* @return {string} Key.
*/
function(element) {
return /** @type {ol.Tile} */ (element[0]).getKey();
return /** @type {module:ol/Tile~Tile} */ (element[0]).getKey();
});
/**
@@ -81,11 +87,11 @@ TileQueue.prototype.getTilesLoading = function() {
/**
* @param {ol.events.Event} event Event.
* @param {module:ol/events/Event~Event} event Event.
* @protected
*/
TileQueue.prototype.handleTileChange = function(event) {
const tile = /** @type {ol.Tile} */ (event.target);
const tile = /** @type {module:ol/Tile~Tile} */ (event.target);
const state = tile.getState();
if (state === TileState.LOADED || state === TileState.ERROR ||
state === TileState.EMPTY || state === TileState.ABORT) {
@@ -111,7 +117,7 @@ TileQueue.prototype.loadMoreTiles = function(maxTotalLoading, maxNewLoads) {
let state, tile, tileKey;
while (this.tilesLoading_ < maxTotalLoading && newLoads < maxNewLoads &&
this.getCount() > 0) {
tile = /** @type {ol.Tile} */ (this.dequeue()[0]);
tile = /** @type {module:ol/Tile~Tile} */ (this.dequeue()[0]);
tileKey = tile.getKey();
state = tile.getState();
if (state === TileState.ABORT) {

View File

@@ -42,8 +42,8 @@ const TileRange = function(minX, maxX, minY, maxY) {
* @param {number} maxX Maximum X.
* @param {number} minY Minimum Y.
* @param {number} maxY Maximum Y.
* @param {ol.TileRange|undefined} tileRange TileRange.
* @return {ol.TileRange} Tile range.
* @param {module:ol/TileRange~TileRange=} tileRange TileRange.
* @return {module:ol/TileRange~TileRange} Tile range.
*/
export function createOrUpdate(minX, maxX, minY, maxY, tileRange) {
if (tileRange !== undefined) {
@@ -59,7 +59,7 @@ export function createOrUpdate(minX, maxX, minY, maxY, tileRange) {
/**
* @param {ol.TileCoord} tileCoord Tile coordinate.
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate.
* @return {boolean} Contains tile coordinate.
*/
TileRange.prototype.contains = function(tileCoord) {
@@ -68,7 +68,7 @@ TileRange.prototype.contains = function(tileCoord) {
/**
* @param {ol.TileRange} tileRange Tile range.
* @param {module:ol/TileRange~TileRange} tileRange Tile range.
* @return {boolean} Contains.
*/
TileRange.prototype.containsTileRange = function(tileRange) {
@@ -88,7 +88,7 @@ TileRange.prototype.containsXY = function(x, y) {
/**
* @param {ol.TileRange} tileRange Tile range.
* @param {module:ol/TileRange~TileRange} tileRange Tile range.
* @return {boolean} Equals.
*/
TileRange.prototype.equals = function(tileRange) {
@@ -98,7 +98,7 @@ TileRange.prototype.equals = function(tileRange) {
/**
* @param {ol.TileRange} tileRange Tile range.
* @param {module:ol/TileRange~TileRange} tileRange Tile range.
*/
TileRange.prototype.extend = function(tileRange) {
if (tileRange.minX < this.minX) {
@@ -125,7 +125,7 @@ TileRange.prototype.getHeight = function() {
/**
* @return {ol.Size} Size.
* @return {module:ol/size~Size} Size.
*/
TileRange.prototype.getSize = function() {
return [this.getWidth(), this.getHeight()];
@@ -141,7 +141,7 @@ TileRange.prototype.getWidth = function() {
/**
* @param {ol.TileRange} tileRange Tile range.
* @param {module:ol/TileRange~TileRange} tileRange Tile range.
* @return {boolean} Intersects.
*/
TileRange.prototype.intersects = function(tileRange) {

View File

@@ -10,27 +10,37 @@ import {getHeight, getIntersection, getWidth} from './extent.js';
import EventType from './events/EventType.js';
import {loadFeaturesXhr} from './featureloader.js';
/**
* @typedef {Object} ReplayState
* @property {boolean} dirty
* @property {null|module:ol/render~OrderFunction} renderedRenderOrder
* @property {number} renderedTileRevision
* @property {number} renderedRevision
*/
/**
* @constructor
* @extends {ol.Tile}
* @param {ol.TileCoord} tileCoord Tile coordinate.
* @param {ol.TileState} state State.
* @extends {module:ol/Tile~Tile}
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate.
* @param {module:ol/TileState~TileState} state State.
* @param {number} sourceRevision Source revision.
* @param {ol.format.Feature} format Feature format.
* @param {ol.TileLoadFunctionType} tileLoadFunction Tile load function.
* @param {ol.TileCoord} urlTileCoord Wrapped tile coordinate for source urls.
* @param {ol.TileUrlFunctionType} tileUrlFunction Tile url function.
* @param {ol.tilegrid.TileGrid} sourceTileGrid Tile grid of the source.
* @param {ol.tilegrid.TileGrid} tileGrid Tile grid of the renderer.
* @param {Object.<string,ol.VectorTile>} sourceTiles Source tiles.
* @param {module:ol/format/Feature~Feature} format Feature format.
* @param {module:ol/Tile~LoadFunction} tileLoadFunction Tile load function.
* @param {module:ol/tilecoord~TileCoord} urlTileCoord Wrapped tile coordinate for source urls.
* @param {module:ol/Tile~UrlFunction} tileUrlFunction Tile url function.
* @param {module:ol/tilegrid/TileGrid~TileGrid} sourceTileGrid Tile grid of the source.
* @param {module:ol/tilegrid/TileGrid~TileGrid} tileGrid Tile grid of the renderer.
* @param {Object.<string, module:ol/VectorTile~VectorTile>} sourceTiles Source tiles.
* @param {number} pixelRatio Pixel ratio.
* @param {ol.proj.Projection} projection Projection.
* @param {function(new: ol.VectorTile, ol.TileCoord, ol.TileState, string,
* ol.format.Feature, ol.TileLoadFunctionType)} tileClass Class to
* @param {module:ol/proj/Projection~Projection} projection Projection.
* @param {function(new: module:ol/VectorTile~VectorTile, module:ol/tilecoord~TileCoord, module:ol/TileState~TileState, string,
* module:ol/format/Feature~Feature, module:ol/Tile~LoadFunction)} tileClass Class to
* instantiate for source tiles.
* @param {function(this: ol.source.VectorTile, ol.events.Event)} handleTileChange
* @param {function(this: module:ol/source/VectorTile~VectorTile, module:ol/events/Event~Event)} handleTileChange
* Function to call when a source tile's state changes.
* @param {olx.TileOptions=} opt_options Tile options.
* @param {module:ol/Tile~Options=} opt_options Tile options.
*/
const VectorImageTile = function(tileCoord, state, sourceRevision, format,
tileLoadFunction, urlTileCoord, tileUrlFunction, sourceTileGrid, tileGrid,
@@ -46,19 +56,19 @@ const VectorImageTile = function(tileCoord, state, sourceRevision, format,
/**
* @private
* @type {ol.FeatureLoader}
* @type {module:ol/featureloader~FeatureLoader}
*/
this.loader_;
/**
* @private
* @type {!Object.<string, ol.TileReplayState>}
* @type {!Object.<string, module:ol/VectorImageTile~ReplayState>}
*/
this.replayState_ = {};
/**
* @private
* @type {Object.<string,ol.VectorTile>}
* @type {Object.<string, module:ol/VectorTile~VectorTile>}
*/
this.sourceTiles_ = sourceTiles;
@@ -74,17 +84,17 @@ const VectorImageTile = function(tileCoord, state, sourceRevision, format,
this.sourceRevision_ = sourceRevision;
/**
* @type {ol.TileCoord}
* @type {module:ol/tilecoord~TileCoord}
*/
this.wrappedTileCoord = urlTileCoord;
/**
* @type {Array.<ol.EventsKey>}
* @type {Array.<module:ol/events~EventsKey>}
*/
this.loadListenerKeys_ = [];
/**
* @type {Array.<ol.EventsKey>}
* @type {Array.<module:ol/events~EventsKey>}
*/
this.sourceTileListenerKeys_ = [];
@@ -154,7 +164,7 @@ VectorImageTile.prototype.disposeInternal = function() {
/**
* @param {ol.layer.Layer} layer Layer.
* @param {module:ol/layer/Layer~Layer} layer Layer.
* @return {CanvasRenderingContext2D} The rendering context.
*/
VectorImageTile.prototype.getContext = function(layer) {
@@ -168,7 +178,7 @@ VectorImageTile.prototype.getContext = function(layer) {
/**
* Get the Canvas for this tile.
* @param {ol.layer.Layer} layer Layer.
* @param {module:ol/layer/Layer~Layer} layer Layer.
* @return {HTMLCanvasElement} Canvas.
*/
VectorImageTile.prototype.getImage = function(layer) {
@@ -178,8 +188,8 @@ VectorImageTile.prototype.getImage = function(layer) {
/**
* @param {ol.layer.Layer} layer Layer.
* @return {ol.TileReplayState} The replay state.
* @param {module:ol/layer/Layer~Layer} layer Layer.
* @return {module:ol/VectorImageTile~ReplayState} The replay state.
*/
VectorImageTile.prototype.getReplayState = function(layer) {
const key = getUid(layer).toString();
@@ -205,7 +215,7 @@ VectorImageTile.prototype.getKey = function() {
/**
* @param {string} tileKey Key (tileCoord) of the source tile.
* @return {ol.VectorTile} Source tile.
* @return {module:ol/VectorTile~VectorTile} Source tile.
*/
VectorImageTile.prototype.getTile = function(tileKey) {
return this.sourceTiles_[tileKey];
@@ -289,7 +299,7 @@ export default VectorImageTile;
/**
* Sets the loader for a tile.
* @param {ol.VectorTile} tile Vector tile.
* @param {module:ol/VectorTile~VectorTile} tile Vector tile.
* @param {string} url URL.
*/
export function defaultLoadFunction(tile, url) {

View File

@@ -7,13 +7,13 @@ import TileState from './TileState.js';
/**
* @constructor
* @extends {ol.Tile}
* @param {ol.TileCoord} tileCoord Tile coordinate.
* @param {ol.TileState} state State.
* @extends {module:ol/Tile~Tile}
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate.
* @param {module:ol/TileState~TileState} state State.
* @param {string} src Data source url.
* @param {ol.format.Feature} format Feature format.
* @param {ol.TileLoadFunctionType} tileLoadFunction Tile load function.
* @param {olx.TileOptions=} opt_options Tile options.
* @param {module:ol/format/Feature~Feature} format Feature format.
* @param {module:ol/Tile~LoadFunction} tileLoadFunction Tile load function.
* @param {module:ol/Tile~Options=} opt_options Tile options.
*/
const VectorTile = function(tileCoord, state, src, format, tileLoadFunction, opt_options) {
@@ -26,44 +26,44 @@ const VectorTile = function(tileCoord, state, src, format, tileLoadFunction, opt
/**
* @private
* @type {ol.Extent}
* @type {module:ol/extent~Extent}
*/
this.extent_ = null;
/**
* @private
* @type {ol.format.Feature}
* @type {module:ol/format/Feature~Feature}
*/
this.format_ = format;
/**
* @private
* @type {Array.<ol.Feature>}
* @type {Array.<module:ol/Feature~Feature>}
*/
this.features_ = null;
/**
* @private
* @type {ol.FeatureLoader}
* @type {module:ol/featureloader~FeatureLoader}
*/
this.loader_;
/**
* Data projection
* @private
* @type {ol.proj.Projection}
* @type {module:ol/proj/Projection~Projection}
*/
this.projection_;
/**
* @private
* @type {Object.<string, ol.render.ReplayGroup>}
* @type {Object.<string, module:ol/render/ReplayGroup~ReplayGroup>}
*/
this.replayGroups_ = {};
/**
* @private
* @type {ol.TileLoadFunctionType}
* @type {module:ol/Tile~LoadFunction}
*/
this.tileLoadFunction_ = tileLoadFunction;
@@ -79,7 +79,7 @@ inherits(VectorTile, Tile);
/**
* @const
* @type {ol.Extent}
* @type {module:ol/extent~Extent}
*/
const DEFAULT_EXTENT = [0, 0, 4096, 4096];
@@ -98,7 +98,7 @@ VectorTile.prototype.disposeInternal = function() {
/**
* Gets the extent of the vector tile.
* @return {ol.Extent} The extent.
* @return {module:ol/extent~Extent} The extent.
* @api
*/
VectorTile.prototype.getExtent = function() {
@@ -108,7 +108,7 @@ VectorTile.prototype.getExtent = function() {
/**
* Get the feature format assigned for reading this tile's features.
* @return {ol.format.Feature} Feature format.
* @return {module:ol/format/Feature~Feature} Feature format.
* @api
*/
VectorTile.prototype.getFormat = function() {
@@ -118,8 +118,8 @@ VectorTile.prototype.getFormat = function() {
/**
* Get the features for this tile. Geometries will be in the projection returned
* by {@link ol.VectorTile#getProjection}.
* @return {Array.<ol.Feature|ol.render.Feature>} Features.
* by {@link module:ol/VectorTile~VectorTile#getProjection}.
* @return {Array.<module:ol/Feature~Feature|module:ol/render/Feature~Feature>} Features.
* @api
*/
VectorTile.prototype.getFeatures = function() {
@@ -137,8 +137,8 @@ VectorTile.prototype.getKey = function() {
/**
* Get the feature projection of features returned by
* {@link ol.VectorTile#getFeatures}.
* @return {ol.proj.Projection} Feature projection.
* {@link module:ol/VectorTile~VectorTile#getFeatures}.
* @return {module:ol/proj/Projection~Projection} Feature projection.
* @api
*/
VectorTile.prototype.getProjection = function() {
@@ -147,9 +147,9 @@ VectorTile.prototype.getProjection = function() {
/**
* @param {ol.layer.Layer} layer Layer.
* @param {module:ol/layer/Layer~Layer} layer Layer.
* @param {string} key Key.
* @return {ol.render.ReplayGroup} Replay group.
* @return {module:ol/render/ReplayGroup~ReplayGroup} Replay group.
*/
VectorTile.prototype.getReplayGroup = function(layer, key) {
return this.replayGroups_[getUid(layer) + ',' + key];
@@ -170,9 +170,9 @@ VectorTile.prototype.load = function() {
/**
* Handler for successful tile load.
* @param {Array.<ol.Feature>} features The loaded features.
* @param {ol.proj.Projection} dataProjection Data projection.
* @param {ol.Extent} extent Extent.
* @param {Array.<module:ol/Feature~Feature>} features The loaded features.
* @param {module:ol/proj/Projection~Projection} dataProjection Data projection.
* @param {module:ol/extent~Extent} extent Extent.
*/
VectorTile.prototype.onLoad = function(features, dataProjection, extent) {
this.setProjection(dataProjection);
@@ -190,15 +190,15 @@ VectorTile.prototype.onError = function() {
/**
* Function for use in an {@link ol.source.VectorTile}'s `tileLoadFunction`.
* Sets the extent of the vector tile. This is only required for tiles in
* projections with `tile-pixels` as units. The extent should be set to
* `[0, 0, tilePixelSize, tilePixelSize]`, where `tilePixelSize` is calculated
* by multiplying the tile size with the tile pixel ratio. For sources using
* {@link ol.format.MVT} as feature format, the
* {@link ol.format.MVT#getLastExtent} method will return the correct extent.
* The default is `[0, 0, 4096, 4096]`.
* @param {ol.Extent} extent The extent.
* Function for use in an {@link module:ol/source/VectorTile~VectorTile}'s
* `tileLoadFunction`. Sets the extent of the vector tile. This is only required
* for tiles in projections with `tile-pixels` as units. The extent should be
* set to `[0, 0, tilePixelSize, tilePixelSize]`, where `tilePixelSize` is
* calculated by multiplying the tile size with the tile pixel ratio. For
* sources using {@link module:ol/format/MVT~MVT} as feature format, the
* {@link module:ol/format/MVT~MVT#getLastExtent} method will return the correct
* extent. The default is `[0, 0, 4096, 4096]`.
* @param {module:ol/extent~Extent} extent The extent.
* @api
*/
VectorTile.prototype.setExtent = function(extent) {
@@ -207,9 +207,9 @@ VectorTile.prototype.setExtent = function(extent) {
/**
* Function for use in an {@link ol.source.VectorTile}'s `tileLoadFunction`.
* Function for use in an {@link module:ol/source/VectorTile~VectorTile}'s `tileLoadFunction`.
* Sets the features for the tile.
* @param {Array.<ol.Feature>} features Features.
* @param {Array.<module:ol/Feature~Feature>} features Features.
* @api
*/
VectorTile.prototype.setFeatures = function(features) {
@@ -219,10 +219,10 @@ VectorTile.prototype.setFeatures = function(features) {
/**
* Function for use in an {@link ol.source.VectorTile}'s `tileLoadFunction`.
* Function for use in an {@link module:ol/source/VectorTile~VectorTile}'s `tileLoadFunction`.
* Sets the projection of the features that were added with
* {@link ol.VectorTile#setFeatures}.
* @param {ol.proj.Projection} projection Feature projection.
* {@link module:ol/VectorTile~VectorTile#setFeatures}.
* @param {module:ol/proj/Projection~Projection} projection Feature projection.
* @api
*/
VectorTile.prototype.setProjection = function(projection) {
@@ -231,9 +231,9 @@ VectorTile.prototype.setProjection = function(projection) {
/**
* @param {ol.layer.Layer} layer Layer.
* @param {module:ol/layer/Layer~Layer} layer Layer.
* @param {string} key Key.
* @param {ol.render.ReplayGroup} replayGroup Replay group.
* @param {module:ol/render/ReplayGroup~ReplayGroup} replayGroup Replay group.
*/
VectorTile.prototype.setReplayGroup = function(layer, key, replayGroup) {
this.replayGroups_[getUid(layer) + ',' + key] = replayGroup;
@@ -242,7 +242,7 @@ VectorTile.prototype.setReplayGroup = function(layer, key, replayGroup) {
/**
* Set the feature loader for reading this tile's features.
* @param {ol.FeatureLoader} loader Feature loader.
* @param {module:ol/featureloader~FeatureLoader} loader Feature loader.
* @api
*/
VectorTile.prototype.setLoader = function(loader) {

View File

@@ -24,6 +24,116 @@ import {createProjection, METERS_PER_UNIT} from './proj.js';
import Units from './proj/Units.js';
/**
* An animation configuration
*
* @typedef {Object} Animation
* @property {module:ol/coordinate~Coordinate} [sourceCenter]
* @property {module:ol/coordinate~Coordinate} [targetCenter]
* @property {number} [sourceResolution]
* @property {number} [targetResolution]
* @property {number} [sourceRotation]
* @property {number} [sourceRotation]
* @property {module:ol/coordinate~Coordinate} [anchor]
* @property {number} start
* @property {number} duration
* @property {boolean} complete
* @property {function(number):number} easing
* @property {function(boolean)} callback
*/
/**
* @typedef {Object} Constraints
* @property {module:ol/centerconstraint~Type} center
* @property {module:ol/resolutionconstraint~Type} resolution
* @property {module:ol/rotationconstraint~Type} rotation
*/
/**
* @typedef {Object} FitOptions
* @property {module:ol/size~Size} [size] 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.
* @property {!Array.<number>} [padding=[0, 0, 0, 0]] Padding (in pixels) to be
* cleared inside the view. Values in the array are top, right, bottom and left
* padding.
* @property {boolean} [constrainResolution=true] Constrain the resolution.
* @property {boolean} [nearest=false] If `constrainResolution` is `true`, get
* the nearest extent instead of the closest that actually fits the view.
* @property {number} [minResolution=0] Minimum resolution that we zoom to.
* @property {number} [maxZoom] Maximum zoom level that we zoom to. If
* `minResolution` is given, this property is ignored.
* @property {number} [duration] The duration of the animation in milliseconds.
* By default, there is no animation to the target extent.
* @property {function(number):number} [easing] The easing function used during
* the animation (defaults to {@link module: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.
* @property {function(boolean)} [callback] Function called when the view is in
* its final position. The callback will be called with `true` if the animation
* series completed on its own or `false` if it was cancelled.
*/
/**
* @typedef {Object} ViewOptions
* @property {module:ol/coordinate~Coordinate~Coordinate} [center] The initial center for
* the view. The coordinate system for the center is specified with the
* `projection` option. Layer sources will not be fetched if this is not set,
* but the center can be set later with {@link #setCenter}.
* @property {boolean|number} [constrainRotation=true] 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.
* @property {boolean} [enableRotation=true] Enable rotation.
* If `false`, a rotation constraint that always sets the rotation to zero is
* used. The `constrainRotation` option has no effect if `enableRotation` is
* `false`.
* @property {module:ol/extent~Extent} [extent] The extent that constrains the
* center, in other words, center cannot be set outside this extent.
* @property {number} [maxResolution] 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`.
* @property {number} [minResolution] 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`.
* @property {number} [maxZoom=28] The maximum zoom level used to determine the
* resolution constraint. It is used together with `minZoom` (or
* `maxResolution`) and `zoomFactor`. Note that if `minResolution` is also
* provided, it is given precedence over `maxZoom`.
* @property {number} [minZoom=0] The minimum zoom level used to determine the
* resolution constraint. It is used together with `maxZoom` (or
* `minResolution`) and `zoomFactor`. Note that if `maxResolution` is also
* provided, it is given precedence over `minZoom`.
* @property {module:ol/proj~ProjectionLike} [projection='EPSG:3857'] The
* projection. The default is Spherical Mercator.
* @property {number} [resolution] 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`. Layer sources will not be
* fetched if neither this nor `zoom` are defined, but they can be set later
* with {@link #setZoom} or {@link #setResolution}.
* @property {Array.<number>} [resolutions] Resolutions to determine the
* resolution constraint. If set the `maxResolution`, `minResolution`,
* `minZoom`, `maxZoom`, and `zoomFactor` options are ignored.
* @property {number} [rotation=0] The initial rotation for the view in radians
* (positive rotation clockwise, 0 means North).
* @property {number} [zoom] 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 {@link #constrainResolution} method.
* @property {number} [zoomFactor=2] The zoom factor used to determine the
* resolution constraint.
*/
/**
* Default min zoom level for the map view.
* @type {number}
@@ -33,18 +143,18 @@ const DEFAULT_MIN_ZOOM = 0;
/**
* @classdesc
* An ol.View object represents a simple 2D view of the map.
* A View object represents a simple 2D view of the map.
*
* This is the object to act upon to change the center, resolution,
* and rotation of the map.
*
* ### The view states
*
* An `ol.View` is determined by three states: `center`, `resolution`,
* An View is determined by three states: `center`, `resolution`,
* and `rotation`. Each state has a corresponding getter and setter, e.g.
* `getCenter` and `setCenter` for the `center` state.
*
* An `ol.View` has a `projection`. The projection determines the
* An View has a `projection`. The projection determines the
* coordinate system of the center, and its units determine the units of the
* resolution (projection units per pixel). The default projection is
* Spherical Mercator (EPSG:3857).
@@ -56,7 +166,7 @@ const DEFAULT_MIN_ZOOM = 0;
* that is passed to a setter will effectively be the value set in the view,
* and returned by the corresponding getter.
*
* But an `ol.View` object also has a *resolution constraint*, a
* But a View object also has a *resolution constraint*, a
* *rotation constraint* and a *center constraint*.
*
* As said above, no constraints are applied when the setters are used to set
@@ -84,8 +194,8 @@ const DEFAULT_MIN_ZOOM = 0;
* default the center is not constrained at all.
*
* @constructor
* @extends {ol.Object}
* @param {olx.ViewOptions=} opt_options View options.
* @extends {module:ol/Object~Object}
* @param {module:ol/View~ViewOptions=} opt_options View options.
* @api
*/
const View = function(opt_options) {
@@ -101,7 +211,7 @@ const View = function(opt_options) {
/**
* @private
* @type {Array.<Array.<ol.ViewAnimation>>}
* @type {Array.<Array.<module:ol/View~Animation>>}
*/
this.animations_ = [];
@@ -116,7 +226,7 @@ const View = function(opt_options) {
/**
* @private
* @const
* @type {ol.proj.Projection}
* @type {module:ol/proj/Projection~Projection}
*/
this.projection_ = createProjection(options.projection, 'EPSG:3857');
@@ -128,7 +238,7 @@ inherits(View, BaseObject);
/**
* Set up the view with the given options.
* @param {olx.ViewOptions} options View options.
* @param {module:ol/View~ViewOptions} options View options.
*/
View.prototype.applyOptions_ = function(options) {
@@ -178,7 +288,7 @@ View.prototype.applyOptions_ = function(options) {
/**
* @private
* @type {ol.Constraints}
* @type {module:ol/View~Constraints}
*/
this.constraints_ = {
center: centerConstraint,
@@ -203,7 +313,7 @@ View.prototype.applyOptions_ = function(options) {
/**
* @private
* @type {olx.ViewOptions}
* @type {module:ol/View~ViewOptions}
*/
this.options_ = options;
@@ -214,8 +324,8 @@ View.prototype.applyOptions_ = function(options) {
* current resolution (or zoom), center, and rotation are applied to any stored
* options. The provided options can be uesd to apply new min/max zoom or
* resolution limits.
* @param {olx.ViewOptions} newOptions New options to be applied.
* @return {olx.ViewOptions} New options updated with the current view state.
* @param {module:ol/View~ViewOptions} newOptions New options to be applied.
* @return {module:ol/View~ViewOptions} New options updated with the current view state.
*/
View.prototype.getUpdatedOptions_ = function(newOptions) {
const options = assign({}, this.options_);
@@ -246,7 +356,7 @@ View.prototype.getUpdatedOptions_ = function(newOptions) {
*
* By default, the animation lasts one second and uses in-and-out easing. You
* can customize this behavior by including `duration` (in milliseconds) and
* `easing` options (see {@link ol.easing}).
* `easing` options (see {@link module:ol/easing}).
*
* To chain together multiple animations, call the method with multiple
* animation objects. For example, to first zoom and then pan:
@@ -304,7 +414,7 @@ View.prototype.animate = function(var_args) {
for (let i = 0; i < animationCount; ++i) {
const options = /** @type {olx.AnimationOptions} */ (arguments[i]);
const animation = /** @type {ol.ViewAnimation} */ ({
const animation = /** @type {module:ol/View~Animation} */ ({
start: start,
complete: false,
anchor: options.anchor,
@@ -472,8 +582,8 @@ View.prototype.updateAnimations_ = function() {
/**
* @param {number} rotation Target rotation.
* @param {ol.Coordinate} anchor Rotation anchor.
* @return {ol.Coordinate|undefined} Center for rotation and anchor.
* @param {module:ol/coordinate~Coordinate} anchor Rotation anchor.
* @return {module:ol/coordinate~Coordinate|undefined} Center for rotation and anchor.
*/
View.prototype.calculateCenterRotate = function(rotation, anchor) {
let center;
@@ -489,8 +599,8 @@ View.prototype.calculateCenterRotate = function(rotation, anchor) {
/**
* @param {number} resolution Target resolution.
* @param {ol.Coordinate} anchor Zoom anchor.
* @return {ol.Coordinate|undefined} Center for resolution and anchor.
* @param {module:ol/coordinate~Coordinate} anchor Zoom anchor.
* @return {module:ol/coordinate~Coordinate|undefined} Center for resolution and anchor.
*/
View.prototype.calculateCenterZoom = function(resolution, anchor) {
let center;
@@ -509,7 +619,7 @@ View.prototype.calculateCenterZoom = function(resolution, anchor) {
/**
* @private
* @return {ol.Size} Viewport size or `[100, 100]` when no viewport is found.
* @return {module:ol/size~Size} Viewport size or `[100, 100]` when no viewport is found.
*/
View.prototype.getSizeFromViewport_ = function() {
const size = [100, 100];
@@ -526,8 +636,8 @@ View.prototype.getSizeFromViewport_ = function() {
/**
* Get the constrained center of this view.
* @param {ol.Coordinate|undefined} center Center.
* @return {ol.Coordinate|undefined} Constrained center.
* @param {module:ol/coordinate~Coordinate|undefined} center Center.
* @return {module:ol/coordinate~Coordinate|undefined} Constrained center.
* @api
*/
View.prototype.constrainCenter = function(center) {
@@ -565,17 +675,17 @@ View.prototype.constrainRotation = function(rotation, opt_delta) {
/**
* Get the view center.
* @return {ol.Coordinate|undefined} The center of the view.
* @return {module:ol/coordinate~Coordinate|undefined} The center of the view.
* @observable
* @api
*/
View.prototype.getCenter = function() {
return /** @type {ol.Coordinate|undefined} */ (this.get(ViewProperty.CENTER));
return /** @type {module:ol/coordinate~Coordinate|undefined} */ (this.get(ViewProperty.CENTER));
};
/**
* @return {ol.Constraints} Constraints.
* @return {module:ol/View~Constraints} Constraints.
*/
View.prototype.getConstraints = function() {
return this.constraints_;
@@ -602,14 +712,14 @@ View.prototype.getHints = function(opt_hints) {
* The size is the pixel dimensions of the box into which the calculated extent
* should fit. In most cases you want to get the extent of the entire map,
* that is `map.getSize()`.
* @param {ol.Size=} opt_size Box pixel size. If not provided, the size of the
* @param {module:ol/size~Size=} opt_size Box pixel size. If not provided, the size of the
* first map that uses this view will be used.
* @return {ol.Extent} Extent.
* @return {module:ol/extent~Extent} Extent.
* @api
*/
View.prototype.calculateExtent = function(opt_size) {
const size = opt_size || this.getSizeFromViewport_();
const center = /** @type {!ol.Coordinate} */ (this.getCenter());
const center = /** @type {!module:ol/coordinate~Coordinate} */ (this.getCenter());
assert(center, 1); // The view center is not defined
const resolution = /** @type {!number} */ (this.getResolution());
assert(resolution !== undefined, 2); // The view resolution is not defined
@@ -682,7 +792,7 @@ View.prototype.setMinZoom = function(zoom) {
/**
* Get the view projection.
* @return {ol.proj.Projection} The projection of the view.
* @return {module:ol/proj/Projection~Projection} The projection of the view.
* @api
*/
View.prototype.getProjection = function() {
@@ -703,7 +813,7 @@ View.prototype.getResolution = function() {
/**
* Get the resolutions for the view. This returns the array of resolutions
* passed to the constructor of the {ol.View}, or undefined if none were given.
* passed to the constructor of the View, or undefined if none were given.
* @return {Array.<number>|undefined} The resolutions of the view.
* @api
*/
@@ -714,8 +824,8 @@ View.prototype.getResolutions = function() {
/**
* Get the resolution for a provided extent (in map units) and size (in pixels).
* @param {ol.Extent} extent Extent.
* @param {ol.Size=} opt_size Box pixel size.
* @param {module:ol/extent~Extent} extent Extent.
* @param {module:ol/size~Size=} opt_size Box pixel size.
* @return {number} The resolution at which the provided extent will render at
* the given size.
* @api
@@ -790,7 +900,7 @@ View.prototype.getValueForResolutionFunction = function(opt_power) {
* @return {olx.ViewState} View state.
*/
View.prototype.getState = function() {
const center = /** @type {ol.Coordinate} */ (this.getCenter());
const center = /** @type {module:ol/coordinate~Coordinate} */ (this.getCenter());
const projection = this.getProjection();
const resolution = /** @type {number} */ (this.getResolution());
const rotation = this.getRotation();
@@ -864,7 +974,7 @@ View.prototype.getResolutionForZoom = function(zoom) {
* The size is pixel dimensions of the box to fit the extent into.
* In most cases you will want to use the map size, that is `map.getSize()`.
* Takes care of the map angle.
* @param {ol.geom.SimpleGeometry|ol.Extent} geometryOrExtent The geometry or
* @param {module:ol/geom/SimpleGeometry~SimpleGeometry|module:ol/extent~Extent} geometryOrExtent The geometry or
* extent to fit the view to.
* @param {olx.view.FitOptions=} opt_options Options.
* @api
@@ -875,7 +985,7 @@ View.prototype.fit = function(geometryOrExtent, opt_options) {
if (!size) {
size = this.getSizeFromViewport_();
}
/** @type {ol.geom.SimpleGeometry} */
/** @type {module:ol/geom/SimpleGeometry~SimpleGeometry} */
let geometry;
if (!(geometryOrExtent instanceof SimpleGeometry)) {
assert(Array.isArray(geometryOrExtent),
@@ -967,9 +1077,9 @@ View.prototype.fit = function(geometryOrExtent, opt_options) {
/**
* Center on coordinate and view position.
* @param {ol.Coordinate} coordinate Coordinate.
* @param {ol.Size} size Box pixel size.
* @param {ol.Pixel} position Position on the view to center on.
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
* @param {module:ol/size~Size} size Box pixel size.
* @param {module:ol~Pixel} position Position on the view to center on.
* @api
*/
View.prototype.centerOn = function(coordinate, size, position) {
@@ -1003,7 +1113,7 @@ View.prototype.isDef = function() {
/**
* Rotate the view around a given coordinate.
* @param {number} rotation New rotation value for the view.
* @param {ol.Coordinate=} opt_anchor The rotation center.
* @param {module:ol/coordinate~Coordinate=} opt_anchor The rotation center.
* @api
*/
View.prototype.rotate = function(rotation, opt_anchor) {
@@ -1017,7 +1127,7 @@ View.prototype.rotate = function(rotation, opt_anchor) {
/**
* Set the center of the current view.
* @param {ol.Coordinate|undefined} center The center of the view.
* @param {module:ol/coordinate~Coordinate|undefined} center The center of the view.
* @observable
* @api
*/
@@ -1030,7 +1140,7 @@ View.prototype.setCenter = function(center) {
/**
* @param {ol.ViewHint} hint Hint.
* @param {module:ol/ViewHint~ViewHint} hint Hint.
* @param {number} delta Delta.
* @return {number} New value.
*/
@@ -1080,8 +1190,8 @@ View.prototype.setZoom = function(zoom) {
/**
* @param {olx.ViewOptions} options View options.
* @return {ol.CenterConstraintType} The constraint.
* @param {module:ol/View~ViewOptions} options View options.
* @return {module:ol/centerconstraint~Type} The constraint.
*/
export function createCenterConstraint(options) {
if (options.extent !== undefined) {
@@ -1093,8 +1203,8 @@ export function createCenterConstraint(options) {
/**
* @param {olx.ViewOptions} options View options.
* @return {{constraint: ol.ResolutionConstraintType, maxResolution: number,
* @param {module:ol/View~ViewOptions} options View options.
* @return {{constraint: module:ol/resolutionconstraint~Type, maxResolution: number,
* minResolution: number, zoomFactor: number}} The constraint.
*/
export function createResolutionConstraint(options) {
@@ -1175,8 +1285,8 @@ export function createResolutionConstraint(options) {
/**
* @param {olx.ViewOptions} options View options.
* @return {ol.RotationConstraintType} Rotation constraint.
* @param {module:ol/View~ViewOptions} options View options.
* @return {module:ol/rotationconstraint~Type} Rotation constraint.
*/
export function createRotationConstraint(options) {
const enableRotation = options.enableRotation !== undefined ?
@@ -1200,7 +1310,7 @@ export function createRotationConstraint(options) {
/**
* Determine if an animation involves no view change.
* @param {ol.ViewAnimation} animation The animation.
* @param {module:ol/View~Animation} animation The animation.
* @return {boolean} The animation involves no view change.
*/
export function isNoopAnimation(animation) {

View File

@@ -5,14 +5,19 @@ import {clamp} from './math.js';
/**
* @param {ol.Extent} extent Extent.
* @return {ol.CenterConstraintType} The constraint.
* @typedef {function((module:ol/coordinate~Coordinate|undefined)): (module:ol/coordinate~Coordinate|undefined)} Type
*/
/**
* @param {module:ol/extent~Extent} extent Extent.
* @return {module:ol/centerconstraint~Type} The constraint.
*/
export function createExtent(extent) {
return (
/**
* @param {ol.Coordinate|undefined} center Center.
* @return {ol.Coordinate|undefined} Center.
* @param {module:ol/coordinate~Coordinate=} center Center.
* @return {module:ol/coordinate~Coordinate|undefined} Center.
*/
function(center) {
if (center) {
@@ -29,8 +34,8 @@ export function createExtent(extent) {
/**
* @param {ol.Coordinate|undefined} center Center.
* @return {ol.Coordinate|undefined} Center.
* @param {module:ol/coordinate~Coordinate=} center Center.
* @return {module:ol/coordinate~Coordinate|undefined} Center.
*/
export function none(center) {
return center;

View File

@@ -5,6 +5,16 @@ import {assert} from './asserts.js';
import {clamp} from './math.js';
/**
* A color represented as a short array [red, green, blue, alpha].
* red, green, and blue should be integers in the range 0..255 inclusive.
* alpha should be a float in the range 0..1 inclusive. If no alpha value is
* given then `1` will be used.
* @typedef {Array.<number>} Color
* @api
*/
/**
* This RegExp matches # followed by 3, 4, 6, or 8 hex digits.
* @const
@@ -25,7 +35,7 @@ const NAMED_COLOR_RE_ = /^([a-z]*)$/i;
/**
* Return the color as an rgba string.
* @param {ol.Color|string} color Color.
* @param {module:ol/color~Color|string} color Color.
* @return {string} Rgba string.
* @api
*/
@@ -58,7 +68,7 @@ function fromNamed(color) {
/**
* @param {string} s String.
* @return {ol.Color} Color.
* @return {module:ol/color~Color} Color.
*/
export const fromString = (
function() {
@@ -74,7 +84,7 @@ export const fromString = (
const MAX_CACHE_SIZE = 1024;
/**
* @type {Object.<string, ol.Color>}
* @type {Object.<string, module:ol/color~Color>}
*/
const cache = {};
@@ -86,7 +96,7 @@ export const fromString = (
return (
/**
* @param {string} s String.
* @return {ol.Color} Color.
* @return {module:ol/color~Color} Color.
*/
function(s) {
let color;
@@ -115,8 +125,8 @@ export const fromString = (
/**
* Return the color as an array. This function maintains a cache of calculated
* arrays which means the result should not be modified.
* @param {ol.Color|string} color Color.
* @return {ol.Color} Color.
* @param {module:ol/color~Color|string} color Color.
* @return {module:ol/color~Color} Color.
* @api
*/
export function asArray(color) {
@@ -130,7 +140,7 @@ export function asArray(color) {
/**
* @param {string} s String.
* @private
* @return {ol.Color} Color.
* @return {module:ol/color~Color} Color.
*/
function fromStringInternal_(s) {
let r, g, b, a, color;
@@ -175,14 +185,14 @@ function fromStringInternal_(s) {
} else {
assert(false, 14); // Invalid color
}
return /** @type {ol.Color} */ (color);
return /** @type {module:ol/color~Color} */ (color);
}
/**
* TODO this function is only used in the test, we probably shouldn't export it
* @param {ol.Color} color Color.
* @return {ol.Color} Clamped color.
* @param {module:ol/color~Color} color Color.
* @return {module:ol/color~Color} Clamped color.
*/
export function normalize(color) {
color[0] = clamp((color[0] + 0.5) | 0, 0, 255);
@@ -194,7 +204,7 @@ export function normalize(color) {
/**
* @param {ol.Color} color Color.
* @param {module:ol/color~Color} color Color.
* @return {string} String.
*/
export function toString(color) {

View File

@@ -1,8 +0,0 @@
/**
* Colors can be defined as a {@link ol.Color} array, or as strings in
* `rgb(r,g,b)` or `rgba(r,g,b,a)` format, or in hex `#rrggbb` or `#rgb` format.
* Color names, like 'red', 'blue' or 'green', may also be used with the
* Canvas renderer.
*
* @namespace ol.color
*/

View File

@@ -5,22 +5,34 @@ import {toString} from './color.js';
/**
* @param {ol.Color|ol.ColorLike} color Color.
* @return {ol.ColorLike} The color as an ol.ColorLike
* A type accepted by CanvasRenderingContext2D.fillStyle
* or CanvasRenderingContext2D.strokeStyle.
* Represents a color, pattern, or gradient. The origin for patterns and
* gradients as fill style is the top-left corner of the extent of the geometry
* being filled.
*
* @typedef {string|CanvasPattern|CanvasGradient} ColorLike
* @api
*/
/**
* @param {module:ol/color~Color|module:ol/colorlike~ColorLike} color Color.
* @return {module:ol/color~ColorLike} The color as an {@link ol/color~ColorLike}.
* @api
*/
export function asColorLike(color) {
if (isColorLike(color)) {
return /** @type {string|CanvasPattern|CanvasGradient} */ (color);
} else {
return toString(/** @type {ol.Color} */ (color));
return toString(/** @type {module:ol/color~Color} */ (color));
}
}
/**
* @param {?} color The value that is potentially an ol.ColorLike
* @return {boolean} Whether the color is an ol.ColorLike
* @param {?} color The value that is potentially an {@link ol/color~ColorLike}.
* @return {boolean} The color is an {@link ol/color~ColorLike}.
*/
export function isColorLike(color) {
return (

View File

@@ -1,5 +0,0 @@
/**
* An {@link ol.ColorLike} can be a color, gradient or pattern accepted by
* [CanvasRenderingContext2D.fillStyle](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle).
* @namespace ol.colorlike
*/

View File

@@ -7,16 +7,35 @@ import Rotate from './control/Rotate.js';
import Zoom from './control/Zoom.js';
/**
* @typedef {Object} DefaultsOptions
* @property {boolean|undefined} [attribution=true] Include
* {@link module:ol/control/Attribution~Attribution}.
* @property {module:ol/control/Attribution~AttributionOptions} [attributionOptions]
* Options for {@link module:ol/control/Attribution~Attribution}.
* @property {boolean} [rotate=true] Include
* {@link module:ol/control/Rotate~Rotate}.
* @property {module:ol/control/Rotate~RotateOptions} [rotateOptions] Options
* for {@link module:ol/control/Rotate~Rotate}.
* @property {boolean} [zoom] Include {@link module:ol/control/Zoom~Zoom}.
* @property {module:ol/control/Zoom~ZoomOptions} [zoomOptions] Options for
* {@link module:ol/control/Zoom~Zoom}.
* @api
*/
/**
* Set of controls included in maps by default. Unless configured otherwise,
* this returns a collection containing an instance of each of the following
* controls:
* * {@link ol.control.Zoom}
* * {@link ol.control.Rotate}
* * {@link ol.control.Attribution}
* * {@link module:ol/control/Zoom~Zoom}
* * {@link module:ol/control/Rotate~Rotate}
* * {@link module:ol/control/Attribution~Attribution}
*
* @param {olx.control.DefaultsOptions=} opt_options Defaults options.
* @return {ol.Collection.<ol.control.Control>} Controls.
* @param {module:ol/control~DefaultsOptions~DefaultsOptions=} opt_options
* Defaults options.
* @return {module:ol/Collection~Collection.<module:ol/control/Control~Control>}
* Controls.
* @api
*/
export function defaults(opt_options) {

View File

@@ -61,7 +61,7 @@ const Control = function(options) {
/**
* @protected
* @type {!Array.<ol.EventsKey>}
* @type {!Array.<module:ol/events~EventsKey>}
*/
this.listenerKeys = [];

View File

@@ -78,13 +78,13 @@ const MousePosition = function(opt_options) {
/**
* @private
* @type {?ol.TransformFunction}
* @type {?module:ol/proj~TransformFunction}
*/
this.transform_ = null;
/**
* @private
* @type {ol.Pixel}
* @type {module:ol~Pixel}
*/
this.lastMouseMovePixel_ = null;
@@ -124,13 +124,13 @@ MousePosition.prototype.handleProjectionChanged_ = function() {
/**
* Return the coordinate format type used to render the current position or
* undefined.
* @return {ol.CoordinateFormatType|undefined} The format to render the current
* @return {module:ol/coordinate~CoordinateFormat|undefined} The format to render the current
* position in.
* @observable
* @api
*/
MousePosition.prototype.getCoordinateFormat = function() {
return /** @type {ol.CoordinateFormatType|undefined} */ (this.get(COORDINATE_FORMAT));
return /** @type {module:ol/coordinate~CoordinateFormat|undefined} */ (this.get(COORDINATE_FORMAT));
};
@@ -187,7 +187,7 @@ MousePosition.prototype.setMap = function(map) {
/**
* Set the coordinate format type used to render the current position.
* @param {ol.CoordinateFormatType} format The format to render the current
* @param {module:ol/coordinate~CoordinateFormat} format The format to render the current
* position in.
* @observable
* @api
@@ -199,7 +199,7 @@ MousePosition.prototype.setCoordinateFormat = function(format) {
/**
* Set the projection that is used to report the mouse position.
* @param {ol.ProjectionLike} projection The projection to report mouse
* @param {module:ol/proj~ProjectionLike} projection The projection to report mouse
* position in.
* @observable
* @api
@@ -210,7 +210,7 @@ MousePosition.prototype.setProjection = function(projection) {
/**
* @param {?ol.Pixel} pixel Pixel.
* @param {?module:ol~Pixel} pixel Pixel.
* @private
*/
MousePosition.prototype.updateHTML_ = function(pixel) {

View File

@@ -329,12 +329,12 @@ OverviewMap.prototype.validateExtent_ = function() {
return;
}
const mapSize = /** @type {ol.Size} */ (map.getSize());
const mapSize = /** @type {module:ol/size~Size} */ (map.getSize());
const view = map.getView();
const extent = view.calculateExtent(mapSize);
const ovmapSize = /** @type {ol.Size} */ (ovmap.getSize());
const ovmapSize = /** @type {module:ol/size~Size} */ (ovmap.getSize());
const ovview = ovmap.getView();
const ovextent = ovview.calculateExtent(ovmapSize);
@@ -374,7 +374,7 @@ OverviewMap.prototype.resetExtent_ = function() {
const map = this.getMap();
const ovmap = this.ovmap_;
const mapSize = /** @type {ol.Size} */ (map.getSize());
const mapSize = /** @type {module:ol/size~Size} */ (map.getSize());
const view = map.getView();
const extent = view.calculateExtent(mapSize);
@@ -421,7 +421,7 @@ OverviewMap.prototype.updateBox_ = function() {
return;
}
const mapSize = /** @type {ol.Size} */ (map.getSize());
const mapSize = /** @type {module:ol/size~Size} */ (map.getSize());
const view = map.getView();
@@ -450,8 +450,8 @@ OverviewMap.prototype.updateBox_ = function() {
/**
* @param {number} rotation Target rotation.
* @param {ol.Coordinate} coordinate Coordinate.
* @return {ol.Coordinate|undefined} Coordinate for rotation and center anchor.
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
* @return {module:ol/coordinate~Coordinate|undefined} Coordinate for rotation and center anchor.
* @private
*/
OverviewMap.prototype.calculateCoordinateRotate_ = function(

View File

@@ -92,7 +92,7 @@ const ZoomSlider = function(opt_options) {
/**
* The calculated thumb size (border box plus margins). Set when initSlider_
* is called.
* @type {ol.Size}
* @type {module:ol/size~Size}
* @private
*/
this.thumbSize_ = null;

View File

@@ -21,7 +21,7 @@ const ZoomToExtent = function(opt_options) {
const options = opt_options ? opt_options : {};
/**
* @type {ol.Extent}
* @type {module:ol/extent~Extent}
* @protected
*/
this.extent = options.extent ? options.extent : null;

View File

@@ -5,19 +5,38 @@ import {modulo} from './math.js';
import {padNumber} from './string.js';
/**
* An array of numbers representing an xy coordinate. Example: `[16, 48]`.
* @typedef {Array.<number>} Coordinate
* @api
*/
/**
* A function that takes a {@link module:ol/coordinate~Coordinate} and
* transforms it into a `{string}`.
*
* @typedef {function((module:ol/coordinate~CoordinateFormat|undefined)): string} CoordinateFormat
* @api
*/
/**
* Add `delta` to `coordinate`. `coordinate` is modified in place and returned
* by the function.
*
* Example:
*
* import {add} from 'ol/coordinate';
*
* var coord = [7.85, 47.983333];
* ol.coordinate.add(coord, [-2, 4]);
* add(coord, [-2, 4]);
* // coord is now [5.85, 51.983333]
*
* @param {ol.Coordinate} coordinate Coordinate.
* @param {ol.Coordinate} delta Delta.
* @return {ol.Coordinate} The input coordinate adjusted by the given delta.
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
* @param {module:ol/coordinate~Coordinate} delta Delta.
* @return {module:ol/coordinate~Coordinate} The input coordinate adjusted by
* the given delta.
* @api
*/
export function add(coordinate, delta) {
@@ -30,9 +49,9 @@ export function add(coordinate, delta) {
/**
* Calculates the point closest to the passed coordinate on the passed circle.
*
* @param {ol.Coordinate} coordinate The coordinate.
* @param {ol.geom.Circle} circle The circle.
* @return {ol.Coordinate} Closest point on the circumference
* @param {module:ol/coordinate~Coordinate} coordinate The coordinate.
* @param {module:ol/geom/Circle~Circle} circle The circle.
* @return {module:ol/coordinate~Coordinate} Closest point on the circumference.
*/
export function closestOnCircle(coordinate, circle) {
const r = circle.getRadius();
@@ -62,10 +81,11 @@ export function closestOnCircle(coordinate, circle) {
* the foot is on the segment, or the closest segment coordinate when the foot
* is outside the segment.
*
* @param {ol.Coordinate} coordinate The coordinate.
* @param {Array.<ol.Coordinate>} segment The two coordinates of the segment.
* @return {ol.Coordinate} The foot of the perpendicular of the coordinate to
* the segment.
* @param {module:ol/coordinate~Coordinate} coordinate The coordinate.
* @param {Array.<module:ol/coordinate~Coordinate>} segment The two coordinates
* of the segment.
* @return {module:ol/coordinate~Coordinate} The foot of the perpendicular of
* the coordinate to the segment.
*/
export function closestOnSegment(coordinate, segment) {
const x0 = coordinate[0];
@@ -96,32 +116,37 @@ export function closestOnSegment(coordinate, segment) {
/**
* Returns a {@link ol.CoordinateFormatType} function that can be used to format
* a {ol.Coordinate} to a string.
* Returns a {@link module:ol/coordinate~CoordinateFormat} function that can be
* used to format
* a {module:ol/coordinate~Coordinate} to a string.
*
* Example without specifying the fractional digits:
*
* import {createStringXY} from 'ol/coordinate';
*
* var coord = [7.85, 47.983333];
* var stringifyFunc = ol.coordinate.createStringXY();
* var stringifyFunc = createStringXY();
* var out = stringifyFunc(coord);
* // out is now '8, 48'
*
* Example with explicitly specifying 2 fractional digits:
*
* import {createStringXY} from 'ol/coordinate';
*
* var coord = [7.85, 47.983333];
* var stringifyFunc = ol.coordinate.createStringXY(2);
* var stringifyFunc = createStringXY(2);
* var out = stringifyFunc(coord);
* // out is now '7.85, 47.98'
*
* @param {number=} opt_fractionDigits The number of digits to include
* after the decimal point. Default is `0`.
* @return {ol.CoordinateFormatType} Coordinate format.
* @return {module:ol/coordinate~CoordinateFormat} Coordinate format.
* @api
*/
export function createStringXY(opt_fractionDigits) {
return (
/**
* @param {ol.Coordinate|undefined} coordinate Coordinate.
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
* @return {string} String XY.
*/
function(coordinate) {
@@ -166,25 +191,29 @@ export function degreesToStringHDMS(hemispheres, degrees, opt_fractionDigits) {
/**
* Transforms the given {@link ol.Coordinate} to a string using the given string
* template. The strings `{x}` and `{y}` in the template will be replaced with
* the first and second coordinate values respectively.
* Transforms the given {@link module:ol/coordinate~Coordinate} to a string
* using the given string template. The strings `{x}` and `{y}` in the template
* will be replaced with the first and second coordinate values respectively.
*
* Example without specifying the fractional digits:
*
* import {format} from 'ol/coordinate';
*
* var coord = [7.85, 47.983333];
* var template = 'Coordinate is ({x}|{y}).';
* var out = ol.coordinate.format(coord, template);
* var out = format(coord, template);
* // out is now 'Coordinate is (8|48).'
*
* Example explicitly specifying the fractional digits:
*
* import {format} from 'ol/coordinate';
*
* var coord = [7.85, 47.983333];
* var template = 'Coordinate is ({x}|{y}).';
* var out = ol.coordinate.format(coord, template, 2);
* var out = format(coord, template, 2);
* // out is now 'Coordinate is (7.85|47.98).'
*
* @param {ol.Coordinate|undefined} coordinate Coordinate.
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
* @param {string} template A template string with `{x}` and `{y}` placeholders
* that will be replaced by first and second coordinate values.
* @param {number=} opt_fractionDigits The number of digits to include
@@ -204,8 +233,8 @@ export function format(coordinate, template, opt_fractionDigits) {
/**
* @param {ol.Coordinate} coordinate1 First coordinate.
* @param {ol.Coordinate} coordinate2 Second coordinate.
* @param {module:ol/coordinate~Coordinate} coordinate1 First coordinate.
* @param {module:ol/coordinate~Coordinate} coordinate2 Second coordinate.
* @return {boolean} The two coordinates are equal.
*/
export function equals(coordinate1, coordinate2) {
@@ -226,14 +255,16 @@ export function equals(coordinate1, coordinate2) {
*
* Example:
*
* import {rotate} from 'ol/coordinate';
*
* var coord = [7.85, 47.983333];
* var rotateRadians = Math.PI / 2; // 90 degrees
* ol.coordinate.rotate(coord, rotateRadians);
* rotate(coord, rotateRadians);
* // coord is now [-47.983333, 7.85]
*
* @param {ol.Coordinate} coordinate Coordinate.
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
* @param {number} angle Angle in radian.
* @return {ol.Coordinate} Coordinate.
* @return {module:ol/coordinate~Coordinate} Coordinate.
* @api
*/
export function rotate(coordinate, angle) {
@@ -253,14 +284,16 @@ export function rotate(coordinate, angle) {
*
* Example:
*
* import {scale as scaleCoordinate} from 'ol/coordinate';
*
* var coord = [7.85, 47.983333];
* var scale = 1.2;
* ol.coordinate.scale(coord, scale);
* scaleCoordinate(coord, scale);
* // coord is now [9.42, 57.5799996]
*
* @param {ol.Coordinate} coordinate Coordinate.
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
* @param {number} scale Scale factor.
* @return {ol.Coordinate} Coordinate.
* @return {module:ol/coordinate~Coordinate} Coordinate.
*/
export function scale(coordinate, scale) {
coordinate[0] *= scale;
@@ -270,8 +303,8 @@ export function scale(coordinate, scale) {
/**
* @param {ol.Coordinate} coord1 First coordinate.
* @param {ol.Coordinate} coord2 Second coordinate.
* @param {module:ol/coordinate~Coordinate} coord1 First coordinate.
* @param {module:ol/coordinate~Coordinate} coord2 Second coordinate.
* @return {number} Squared distance between coord1 and coord2.
*/
export function squaredDistance(coord1, coord2) {
@@ -282,8 +315,8 @@ export function squaredDistance(coord1, coord2) {
/**
* @param {ol.Coordinate} coord1 First coordinate.
* @param {ol.Coordinate} coord2 Second coordinate.
* @param {module:ol/coordinate~Coordinate} coord1 First coordinate.
* @param {module:ol/coordinate~Coordinate} coord2 Second coordinate.
* @return {number} Distance between coord1 and coord2.
*/
export function distance(coord1, coord2) {
@@ -294,8 +327,9 @@ export function distance(coord1, coord2) {
/**
* Calculate the squared distance from a coordinate to a line segment.
*
* @param {ol.Coordinate} coordinate Coordinate of the point.
* @param {Array.<ol.Coordinate>} segment Line segment (2 coordinates).
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate of the point.
* @param {Array.<module:ol/coordinate~Coordinate>} segment Line segment (2
* coordinates).
* @return {number} Squared distance from the point to the line segment.
*/
export function squaredDistanceToSegment(coordinate, segment) {
@@ -310,17 +344,21 @@ export function squaredDistanceToSegment(coordinate, segment) {
*
* Example without specifying fractional digits:
*
* import {toStringHDMS} from 'ol/coordinate';
*
* var coord = [7.85, 47.983333];
* var out = ol.coordinate.toStringHDMS(coord);
* var out = toStringHDMS(coord);
* // out is now '47° 58 60″ N 7° 50 60″ E'
*
* Example explicitly specifying 1 fractional digit:
*
* import {toStringHDMS} from 'ol/coordinate';
*
* var coord = [7.85, 47.983333];
* var out = ol.coordinate.toStringHDMS(coord, 1);
* var out = toStringHDMS(coord, 1);
* // out is now '47° 58 60.0″ N 7° 50 60.0″ E'
*
* @param {ol.Coordinate|undefined} coordinate Coordinate.
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
* @param {number=} opt_fractionDigits The number of digits to include
* after the decimal point. Default is `0`.
* @return {string} Hemisphere, degrees, minutes and seconds.
@@ -341,17 +379,21 @@ export function toStringHDMS(coordinate, opt_fractionDigits) {
*
* Example without specifying fractional digits:
*
* import {toStringXY} from 'ol/coordinate';
*
* var coord = [7.85, 47.983333];
* var out = ol.coordinate.toStringXY(coord);
* var out = toStringXY(coord);
* // out is now '8, 48'
*
* Example explicitly specifying 1 fractional digit:
*
* import {toStringXY} from 'ol/coordinate';
*
* var coord = [7.85, 47.983333];
* var out = ol.coordinate.toStringXY(coord, 1);
* var out = toStringXY(coord, 1);
* // out is now '7.8, 48.0'
*
* @param {ol.Coordinate|undefined} coordinate Coordinate.
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
* @param {number=} opt_fractionDigits The number of digits to include
* after the decimal point. Default is `0`.
* @return {string} XY.

View File

@@ -1,3 +0,0 @@
/**
* @namespace ol.coordinate
*/

View File

@@ -49,8 +49,8 @@ export function linear(t) {
/**
* Start slow, speed up, and at the very end slow down again. This has the
* same general behavior as {@link ol.easing.inAndOut}, but the final slowdown
* is delayed.
* same general behavior as {@link module:ol/easing~inAndOut}, but the final
* slowdown is delayed.
* @param {number} t Input between 0 and 1.
* @return {number} Output between 0 and 1.
* @api

View File

@@ -1,4 +0,0 @@
/**
* Easing functions for {@link ol.View#animate}.
* @namespace ol.easing
*/

View File

@@ -5,8 +5,31 @@ import {clear} from './obj.js';
/**
* @param {ol.EventsKey} listenerObj Listener object.
* @return {ol.EventsListenerFunctionType} Bound listener.
* Key to use with {@link module:ol/Observable~Observable#unByKey}.
* @typedef {Object} EventsKey
* @property {Object} [bindTo]
* @property {module:ol/events~ListenerFunction} [boundListener]
* @property {boolean} callOnce
* @property {number} [deleteIndex]
* @property {module:ol/events~ListenerFunction} listener
* @property {EventTarget|module:ol/events/EventTarget~EventTarget} target
* @property {string} type
* @api
*/
/**
* Listener function. This function is called with an event object as argument.
* When the function returns `false`, event propagation will stop.
*
* @typedef {function(module:ol/events/Event~Event)|function(module:ol/events/Event~Event): boolean} ListenerFunction
* @api
*/
/**
* @param {module:ol/events~EventsKey} listenerObj Listener object.
* @return {module:ol/events~ListenerFunction} Bound listener.
*/
export function bindListener(listenerObj) {
const boundListener = function(evt) {
@@ -23,15 +46,15 @@ export function bindListener(listenerObj) {
/**
* Finds the matching {@link ol.EventsKey} in the given listener
* Finds the matching {@link module:ol/events~EventsKey} in the given listener
* array.
*
* @param {!Array<!ol.EventsKey>} listeners Array of listeners.
* @param {!Array<!module:ol/events~EventsKey>} listeners Array of listeners.
* @param {!Function} listener The listener function.
* @param {Object=} opt_this The `this` value inside the listener.
* @param {boolean=} opt_setDeleteIndex Set the deleteIndex on the matching
* listener, for {@link ol.events.unlistenByKey}.
* @return {ol.EventsKey|undefined} The matching listener object.
* listener, for {@link module:ol/events~unlistenByKey}.
* @return {module:ol/events~EventsKey|undefined} The matching listener object.
*/
export function findListener(listeners, listener, opt_this, opt_setDeleteIndex) {
let listenerObj;
@@ -50,9 +73,9 @@ export function findListener(listeners, listener, opt_this, opt_setDeleteIndex)
/**
* @param {ol.EventTargetLike} target Target.
* @param {module:ol/events/EventTarget~EventTargetLike} target Target.
* @param {string} type Type.
* @return {Array.<ol.EventsKey>|undefined} Listeners.
* @return {Array.<module:ol/events~EventsKey>|undefined} Listeners.
*/
export function getListeners(target, type) {
const listenerMap = target.ol_lm;
@@ -63,8 +86,8 @@ export function getListeners(target, type) {
/**
* Get the lookup of listeners. If one does not exist on the target, it is
* created.
* @param {ol.EventTargetLike} target Target.
* @return {!Object.<string, Array.<ol.EventsKey>>} Map of
* @param {module:ol/events/EventTarget~EventTargetLike} target Target.
* @return {!Object.<string, Array.<module:ol/events~EventsKey>>} Map of
* listeners by event type.
*/
function getListenerMap(target) {
@@ -80,7 +103,7 @@ function getListenerMap(target) {
* Clean up all listener objects of the given type. All properties on the
* listener objects will be removed, and if no listeners remain in the listener
* map, it will be removed from the target.
* @param {ol.EventTargetLike} target Target.
* @param {module:ol/events/EventTarget~EventTargetLike} target Target.
* @param {string} type Type.
*/
function removeListeners(target, type) {
@@ -107,15 +130,15 @@ function removeListeners(target, type) {
* {@link https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html}
*
* This function efficiently binds a `listener` to a `this` object, and returns
* a key for use with {@link ol.events.unlistenByKey}.
* a key for use with {@link module:ol/events~unlistenByKey}.
*
* @param {ol.EventTargetLike} target Event target.
* @param {module:ol/events/EventTarget~EventTargetLike} target Event target.
* @param {string} type Event type.
* @param {ol.EventsListenerFunctionType} listener Listener.
* @param {module:ol/events~ListenerFunction} listener Listener.
* @param {Object=} opt_this Object referenced by the `this` keyword in the
* listener. Default is the `target`.
* @param {boolean=} opt_once If true, add the listener as one-off listener.
* @return {ol.EventsKey} Unique key for the listener.
* @return {module:ol/events~EventsKey} Unique key for the listener.
*/
export function listen(target, type, listener, opt_this, opt_once) {
const listenerMap = getListenerMap(target);
@@ -130,7 +153,7 @@ export function listen(target, type, listener, opt_this, opt_once) {
listenerObj.callOnce = false;
}
} else {
listenerObj = /** @type {ol.EventsKey} */ ({
listenerObj = /** @type {module:ol/events~EventsKey} */ ({
bindTo: opt_this,
callOnce: !!opt_once,
listener: listener,
@@ -151,19 +174,19 @@ export function listen(target, type, listener, opt_this, opt_once) {
*
* This function efficiently binds a `listener` as self-unregistering listener
* to a `this` object, and returns a key for use with
* {@link ol.events.unlistenByKey} in case the listener needs to be unregistered
* before it is called.
* {@link module:ol/events~unlistenByKey} in case the listener needs to be
* unregistered before it is called.
*
* When {@link ol.events.listen} is called with the same arguments after this
* When {@link module:ol/events~listen} is called with the same arguments after this
* function, the self-unregistering listener will be turned into a permanent
* listener.
*
* @param {ol.EventTargetLike} target Event target.
* @param {module:ol/events/EventTarget~EventTargetLike} target Event target.
* @param {string} type Event type.
* @param {ol.EventsListenerFunctionType} listener Listener.
* @param {module:ol/events~ListenerFunction} listener Listener.
* @param {Object=} opt_this Object referenced by the `this` keyword in the
* listener. Default is the `target`.
* @return {ol.EventsKey} Key for unlistenByKey.
* @return {module:ol/events~EventsKey} Key for unlistenByKey.
*/
export function listenOnce(target, type, listener, opt_this) {
return listen(target, type, listener, opt_this, true);
@@ -175,11 +198,11 @@ export function listenOnce(target, type, listener, opt_this) {
* {@link https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html}
*
* To return a listener, this function needs to be called with the exact same
* arguments that were used for a previous {@link ol.events.listen} call.
* arguments that were used for a previous {@link module:ol/events~listen} call.
*
* @param {ol.EventTargetLike} target Event target.
* @param {module:ol/events/EventTarget~EventTargetLike} target Event target.
* @param {string} type Event type.
* @param {ol.EventsListenerFunctionType} listener Listener.
* @param {module:ol/events~ListenerFunction} listener Listener.
* @param {Object=} opt_this Object referenced by the `this` keyword in the
* listener. Default is the `target`.
*/
@@ -199,9 +222,9 @@ export function unlisten(target, type, listener, opt_this) {
* {@link https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html}
*
* The argument passed to this function is the key returned from
* {@link ol.events.listen} or {@link ol.events.listenOnce}.
* {@link module:ol/events~listen} or {@link module:ol/events~listenOnce}.
*
* @param {ol.EventsKey} key The key.
* @param {module:ol/events~EventsKey} key The key.
*/
export function unlistenByKey(key) {
if (key && key.target) {
@@ -225,7 +248,7 @@ export function unlistenByKey(key) {
* Unregisters all event listeners on an event target. Inspired by
* {@link https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html}
*
* @param {ol.EventTargetLike} target Target.
* @param {module:ol/events/EventTarget~EventTargetLike} target Target.
*/
export function unlistenAll(target) {
const listenerMap = getListenerMap(target);

View File

@@ -9,7 +9,7 @@
* This implementation only provides `type` and `target` properties, and
* `stopPropagation` and `preventDefault` methods. It is meant as base class
* for higher level events defined in the library, and works with
* {@link ol.events.EventTarget}.
* {@link module:ol/events/EventTarget~EventTarget}.
*
* @constructor
* @implements {oli.events.Event}

View File

@@ -7,6 +7,12 @@ import {unlistenAll} from '../events.js';
import {UNDEFINED} from '../functions.js';
import Event from '../events/Event.js';
/**
* @typedef {EventTarget|module:ol/events/EventTarget~EventTarget} EventTargetLike
*/
/**
* @classdesc
* A simplified implementation of the W3C DOM Level 2 EventTarget interface.
@@ -43,7 +49,7 @@ const EventTarget = function() {
/**
* @private
* @type {!Object.<string, Array.<ol.EventsListenerFunctionType>>}
* @type {!Object.<string, Array.<module:ol/events~ListenerFunction>>}
*/
this.listeners_ = {};
@@ -54,7 +60,7 @@ inherits(EventTarget, Disposable);
/**
* @param {string} type Type.
* @param {ol.EventsListenerFunctionType} listener Listener.
* @param {module:ol/events~ListenerFunction} listener Listener.
*/
EventTarget.prototype.addEventListener = function(type, listener) {
let listeners = this.listeners_[type];
@@ -69,7 +75,7 @@ EventTarget.prototype.addEventListener = function(type, listener) {
/**
* @param {{type: string,
* target: (EventTarget|ol.events.EventTarget|undefined)}|ol.events.Event|
* target: (EventTarget|module:ol/events/EventTarget~EventTarget|undefined)}|ol.events.Event|
* string} event Event or event type.
* @return {boolean|undefined} `false` if anyone called preventDefault on the
* event object or if any of the listeners returned false.
@@ -119,7 +125,7 @@ EventTarget.prototype.disposeInternal = function() {
* order that they will be called in.
*
* @param {string} type Type.
* @return {Array.<ol.EventsListenerFunctionType>} Listeners.
* @return {Array.<module:ol/events~ListenerFunction>} Listeners.
*/
EventTarget.prototype.getListeners = function(type) {
return this.listeners_[type];
@@ -140,7 +146,7 @@ EventTarget.prototype.hasListener = function(opt_type) {
/**
* @param {string} type Type.
* @param {ol.EventsListenerFunctionType} listener Listener.
* @param {module:ol/events~ListenerFunction} listener Listener.
*/
EventTarget.prototype.removeEventListener = function(type, listener) {
const listeners = this.listeners_[type];

View File

@@ -6,11 +6,17 @@ import Corner from './extent/Corner.js';
import Relationship from './extent/Relationship.js';
/**
* An array of numbers representing an extent: `[minx, miny, maxx, maxy]`.
* @typedef {Array.<number>} Extent
* @api
*/
/**
* Build an extent that includes all given coordinates.
*
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
* @return {ol.Extent} Bounding extent.
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
* @return {module:ol/extent~Extent} Bounding extent.
* @api
*/
export function boundingExtent(coordinates) {
@@ -25,9 +31,9 @@ export function boundingExtent(coordinates) {
/**
* @param {Array.<number>} xs Xs.
* @param {Array.<number>} ys Ys.
* @param {ol.Extent=} opt_extent Destination extent.
* @param {module:ol/extent~Extent=} opt_extent Destination extent.
* @private
* @return {ol.Extent} Extent.
* @return {module:ol/extent~Extent} Extent.
*/
function _boundingExtentXYs(xs, ys, opt_extent) {
const minX = Math.min.apply(null, xs);
@@ -40,10 +46,10 @@ function _boundingExtentXYs(xs, ys, opt_extent) {
/**
* Return extent increased by the provided value.
* @param {ol.Extent} extent Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @param {number} value The amount by which the extent should be buffered.
* @param {ol.Extent=} opt_extent Extent.
* @return {ol.Extent} Extent.
* @param {module:ol/extent~Extent=} opt_extent Extent.
* @return {module:ol/extent~Extent} Extent.
* @api
*/
export function buffer(extent, value, opt_extent) {
@@ -67,9 +73,9 @@ export function buffer(extent, value, opt_extent) {
/**
* Creates a clone of an extent.
*
* @param {ol.Extent} extent Extent to clone.
* @param {ol.Extent=} opt_extent Extent.
* @return {ol.Extent} The clone.
* @param {module:ol/extent~Extent} extent Extent to clone.
* @param {module:ol/extent~Extent=} opt_extent Extent.
* @return {module:ol/extent~Extent} The clone.
*/
export function clone(extent, opt_extent) {
if (opt_extent) {
@@ -85,7 +91,7 @@ export function clone(extent, opt_extent) {
/**
* @param {ol.Extent} extent Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @param {number} x X.
* @param {number} y Y.
* @return {number} Closest squared distance.
@@ -113,8 +119,8 @@ export function closestSquaredDistanceXY(extent, x, y) {
/**
* Check if the passed coordinate is contained or on the edge of the extent.
*
* @param {ol.Extent} extent Extent.
* @param {ol.Coordinate} coordinate Coordinate.
* @param {module:ol/extent~Extent} extent Extent.
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
* @return {boolean} The coordinate is contained in the extent.
* @api
*/
@@ -129,8 +135,8 @@ export function containsCoordinate(extent, coordinate) {
* An extent is deemed contained if it lies completely within the other extent,
* including if they share one or more edges.
*
* @param {ol.Extent} extent1 Extent 1.
* @param {ol.Extent} extent2 Extent 2.
* @param {module:ol/extent~Extent} extent1 Extent 1.
* @param {module:ol/extent~Extent} extent2 Extent 2.
* @return {boolean} The second extent is contained by or on the edge of the
* first.
* @api
@@ -144,7 +150,7 @@ export function containsExtent(extent1, extent2) {
/**
* Check if the passed coordinate is contained or on the edge of the extent.
*
* @param {ol.Extent} extent Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @param {number} x X coordinate.
* @param {number} y Y coordinate.
* @return {boolean} The x, y values are contained in the extent.
@@ -157,10 +163,10 @@ export function containsXY(extent, x, y) {
/**
* Get the relationship between a coordinate and extent.
* @param {ol.Extent} extent The extent.
* @param {ol.Coordinate} coordinate The coordinate.
* @param {module:ol/extent~Extent} extent The extent.
* @param {module:ol/coordinate~Coordinate} coordinate The coordinate.
* @return {number} The relationship (bitwise compare with
* ol.extent.Relationship).
* module:ol/extent~Extent.Relationship).
*/
export function coordinateRelationship(extent, coordinate) {
const minX = extent[0];
@@ -189,7 +195,7 @@ export function coordinateRelationship(extent, coordinate) {
/**
* Create an empty extent.
* @return {ol.Extent} Empty extent.
* @return {module:ol/extent~Extent} Empty extent.
* @api
*/
export function createEmpty() {
@@ -203,8 +209,8 @@ export function createEmpty() {
* @param {number} minY Minimum Y.
* @param {number} maxX Maximum X.
* @param {number} maxY Maximum Y.
* @param {ol.Extent=} opt_extent Destination extent.
* @return {ol.Extent} Extent.
* @param {module:ol/extent~Extent=} opt_extent Destination extent.
* @return {module:ol/extent~Extent} Extent.
*/
export function createOrUpdate(minX, minY, maxX, maxY, opt_extent) {
if (opt_extent) {
@@ -221,8 +227,8 @@ export function createOrUpdate(minX, minY, maxX, maxY, opt_extent) {
/**
* Create a new empty extent or make the provided one empty.
* @param {ol.Extent=} opt_extent Extent.
* @return {ol.Extent} Extent.
* @param {module:ol/extent~Extent=} opt_extent Extent.
* @return {module:ol/extent~Extent} Extent.
*/
export function createOrUpdateEmpty(opt_extent) {
return createOrUpdate(
@@ -231,9 +237,9 @@ export function createOrUpdateEmpty(opt_extent) {
/**
* @param {ol.Coordinate} coordinate Coordinate.
* @param {ol.Extent=} opt_extent Extent.
* @return {ol.Extent} Extent.
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
* @param {module:ol/extent~Extent=} opt_extent Extent.
* @return {module:ol/extent~Extent} Extent.
*/
export function createOrUpdateFromCoordinate(coordinate, opt_extent) {
const x = coordinate[0];
@@ -243,9 +249,9 @@ export function createOrUpdateFromCoordinate(coordinate, opt_extent) {
/**
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
* @param {ol.Extent=} opt_extent Extent.
* @return {ol.Extent} Extent.
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
* @param {module:ol/extent~Extent=} opt_extent Extent.
* @return {module:ol/extent~Extent} Extent.
*/
export function createOrUpdateFromCoordinates(coordinates, opt_extent) {
const extent = createOrUpdateEmpty(opt_extent);
@@ -258,8 +264,8 @@ export function createOrUpdateFromCoordinates(coordinates, opt_extent) {
* @param {number} offset Offset.
* @param {number} end End.
* @param {number} stride Stride.
* @param {ol.Extent=} opt_extent Extent.
* @return {ol.Extent} Extent.
* @param {module:ol/extent~Extent=} opt_extent Extent.
* @return {module:ol/extent~Extent} Extent.
*/
export function createOrUpdateFromFlatCoordinates(flatCoordinates, offset, end, stride, opt_extent) {
const extent = createOrUpdateEmpty(opt_extent);
@@ -267,9 +273,9 @@ export function createOrUpdateFromFlatCoordinates(flatCoordinates, offset, end,
}
/**
* @param {Array.<Array.<ol.Coordinate>>} rings Rings.
* @param {ol.Extent=} opt_extent Extent.
* @return {ol.Extent} Extent.
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} rings Rings.
* @param {module:ol/extent~Extent=} opt_extent Extent.
* @return {module:ol/extent~Extent} Extent.
*/
export function createOrUpdateFromRings(rings, opt_extent) {
const extent = createOrUpdateEmpty(opt_extent);
@@ -279,8 +285,8 @@ export function createOrUpdateFromRings(rings, opt_extent) {
/**
* Determine if two extents are equivalent.
* @param {ol.Extent} extent1 Extent 1.
* @param {ol.Extent} extent2 Extent 2.
* @param {module:ol/extent~Extent} extent1 Extent 1.
* @param {module:ol/extent~Extent} extent2 Extent 2.
* @return {boolean} The two extents are equivalent.
* @api
*/
@@ -292,9 +298,9 @@ export function equals(extent1, extent2) {
/**
* Modify an extent to include another extent.
* @param {ol.Extent} extent1 The extent to be modified.
* @param {ol.Extent} extent2 The extent that will be included in the first.
* @return {ol.Extent} A reference to the first (extended) extent.
* @param {module:ol/extent~Extent} extent1 The extent to be modified.
* @param {module:ol/extent~Extent} extent2 The extent that will be included in the first.
* @return {module:ol/extent~Extent} A reference to the first (extended) extent.
* @api
*/
export function extend(extent1, extent2) {
@@ -315,8 +321,8 @@ export function extend(extent1, extent2) {
/**
* @param {ol.Extent} extent Extent.
* @param {ol.Coordinate} coordinate Coordinate.
* @param {module:ol/extent~Extent} extent Extent.
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
*/
export function extendCoordinate(extent, coordinate) {
if (coordinate[0] < extent[0]) {
@@ -335,9 +341,9 @@ export function extendCoordinate(extent, coordinate) {
/**
* @param {ol.Extent} extent Extent.
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
* @return {ol.Extent} Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
* @return {module:ol/extent~Extent} Extent.
*/
export function extendCoordinates(extent, coordinates) {
for (let i = 0, ii = coordinates.length; i < ii; ++i) {
@@ -348,12 +354,12 @@ export function extendCoordinates(extent, coordinates) {
/**
* @param {ol.Extent} extent Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @param {Array.<number>} flatCoordinates Flat coordinates.
* @param {number} offset Offset.
* @param {number} end End.
* @param {number} stride Stride.
* @return {ol.Extent} Extent.
* @return {module:ol/extent~Extent} Extent.
*/
export function extendFlatCoordinates(extent, flatCoordinates, offset, end, stride) {
for (; offset < end; offset += stride) {
@@ -364,9 +370,9 @@ export function extendFlatCoordinates(extent, flatCoordinates, offset, end, stri
/**
* @param {ol.Extent} extent Extent.
* @param {Array.<Array.<ol.Coordinate>>} rings Rings.
* @return {ol.Extent} Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} rings Rings.
* @return {module:ol/extent~Extent} Extent.
*/
export function extendRings(extent, rings) {
for (let i = 0, ii = rings.length; i < ii; ++i) {
@@ -377,7 +383,7 @@ export function extendRings(extent, rings) {
/**
* @param {ol.Extent} extent Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @param {number} x X.
* @param {number} y Y.
*/
@@ -393,8 +399,8 @@ export function extendXY(extent, x, y) {
* This function calls `callback` for each corner of the extent. If the
* callback returns a truthy value the function returns that value
* immediately. Otherwise the function returns `false`.
* @param {ol.Extent} extent Extent.
* @param {function(this:T, ol.Coordinate): S} callback Callback.
* @param {module:ol/extent~Extent} extent Extent.
* @param {function(this:T, module:ol/coordinate~Coordinate): S} callback Callback.
* @param {T=} opt_this Value to use as `this` when executing `callback`.
* @return {S|boolean} Value.
* @template S, T
@@ -423,7 +429,7 @@ export function forEachCorner(extent, callback, opt_this) {
/**
* Get the size of an extent.
* @param {ol.Extent} extent Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @return {number} Area.
* @api
*/
@@ -438,8 +444,8 @@ export function getArea(extent) {
/**
* Get the bottom left coordinate of an extent.
* @param {ol.Extent} extent Extent.
* @return {ol.Coordinate} Bottom left coordinate.
* @param {module:ol/extent~Extent} extent Extent.
* @return {module:ol/coordinate~Coordinate} Bottom left coordinate.
* @api
*/
export function getBottomLeft(extent) {
@@ -449,8 +455,8 @@ export function getBottomLeft(extent) {
/**
* Get the bottom right coordinate of an extent.
* @param {ol.Extent} extent Extent.
* @return {ol.Coordinate} Bottom right coordinate.
* @param {module:ol/extent~Extent} extent Extent.
* @return {module:ol/coordinate~Coordinate} Bottom right coordinate.
* @api
*/
export function getBottomRight(extent) {
@@ -460,8 +466,8 @@ export function getBottomRight(extent) {
/**
* Get the center coordinate of an extent.
* @param {ol.Extent} extent Extent.
* @return {ol.Coordinate} Center.
* @param {module:ol/extent~Extent} extent Extent.
* @return {module:ol/coordinate~Coordinate} Center.
* @api
*/
export function getCenter(extent) {
@@ -471,9 +477,9 @@ export function getCenter(extent) {
/**
* Get a corner coordinate of an extent.
* @param {ol.Extent} extent Extent.
* @param {ol.extent.Corner} corner Corner.
* @return {ol.Coordinate} Corner coordinate.
* @param {module:ol/extent~Extent} extent Extent.
* @param {module:ol/extent~Extent.Corner} corner Corner.
* @return {module:ol/coordinate~Coordinate} Corner coordinate.
*/
export function getCorner(extent, corner) {
let coordinate;
@@ -488,13 +494,13 @@ export function getCorner(extent, corner) {
} else {
assert(false, 13); // Invalid corner
}
return /** @type {!ol.Coordinate} */ (coordinate);
return /** @type {!module:ol/coordinate~Coordinate} */ (coordinate);
}
/**
* @param {ol.Extent} extent1 Extent 1.
* @param {ol.Extent} extent2 Extent 2.
* @param {module:ol/extent~Extent} extent1 Extent 1.
* @param {module:ol/extent~Extent} extent2 Extent 2.
* @return {number} Enlarged area.
*/
export function getEnlargedArea(extent1, extent2) {
@@ -507,12 +513,12 @@ export function getEnlargedArea(extent1, extent2) {
/**
* @param {ol.Coordinate} center Center.
* @param {module:ol/coordinate~Coordinate} center Center.
* @param {number} resolution Resolution.
* @param {number} rotation Rotation.
* @param {ol.Size} size Size.
* @param {ol.Extent=} opt_extent Destination extent.
* @return {ol.Extent} Extent.
* @param {module:ol/size~Size} size Size.
* @param {module:ol/extent~Extent=} opt_extent Destination extent.
* @return {module:ol/extent~Extent} Extent.
*/
export function getForViewAndSize(center, resolution, rotation, size, opt_extent) {
const dx = resolution * size[0] / 2;
@@ -542,7 +548,7 @@ export function getForViewAndSize(center, resolution, rotation, size, opt_extent
/**
* Get the height of an extent.
* @param {ol.Extent} extent Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @return {number} Height.
* @api
*/
@@ -552,8 +558,8 @@ export function getHeight(extent) {
/**
* @param {ol.Extent} extent1 Extent 1.
* @param {ol.Extent} extent2 Extent 2.
* @param {module:ol/extent~Extent} extent1 Extent 1.
* @param {module:ol/extent~Extent} extent2 Extent 2.
* @return {number} Intersection area.
*/
export function getIntersectionArea(extent1, extent2) {
@@ -564,10 +570,10 @@ export function getIntersectionArea(extent1, extent2) {
/**
* Get the intersection of two extents.
* @param {ol.Extent} extent1 Extent 1.
* @param {ol.Extent} extent2 Extent 2.
* @param {ol.Extent=} opt_extent Optional extent to populate with intersection.
* @return {ol.Extent} Intersecting extent.
* @param {module:ol/extent~Extent} extent1 Extent 1.
* @param {module:ol/extent~Extent} extent2 Extent 2.
* @param {module:ol/extent~Extent=} opt_extent Optional extent to populate with intersection.
* @return {module:ol/extent~Extent} Intersecting extent.
* @api
*/
export function getIntersection(extent1, extent2, opt_extent) {
@@ -601,7 +607,7 @@ export function getIntersection(extent1, extent2, opt_extent) {
/**
* @param {ol.Extent} extent Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @return {number} Margin.
*/
export function getMargin(extent) {
@@ -611,8 +617,8 @@ export function getMargin(extent) {
/**
* Get the size (width, height) of an extent.
* @param {ol.Extent} extent The extent.
* @return {ol.Size} The extent size.
* @param {module:ol/extent~Extent} extent The extent.
* @return {module:ol/size~Size} The extent size.
* @api
*/
export function getSize(extent) {
@@ -622,8 +628,8 @@ export function getSize(extent) {
/**
* Get the top left coordinate of an extent.
* @param {ol.Extent} extent Extent.
* @return {ol.Coordinate} Top left coordinate.
* @param {module:ol/extent~Extent} extent Extent.
* @return {module:ol/coordinate~Coordinate} Top left coordinate.
* @api
*/
export function getTopLeft(extent) {
@@ -633,8 +639,8 @@ export function getTopLeft(extent) {
/**
* Get the top right coordinate of an extent.
* @param {ol.Extent} extent Extent.
* @return {ol.Coordinate} Top right coordinate.
* @param {module:ol/extent~Extent} extent Extent.
* @return {module:ol/coordinate~Coordinate} Top right coordinate.
* @api
*/
export function getTopRight(extent) {
@@ -644,7 +650,7 @@ export function getTopRight(extent) {
/**
* Get the width of an extent.
* @param {ol.Extent} extent Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @return {number} Width.
* @api
*/
@@ -655,8 +661,8 @@ export function getWidth(extent) {
/**
* Determine if one extent intersects another.
* @param {ol.Extent} extent1 Extent 1.
* @param {ol.Extent} extent2 Extent.
* @param {module:ol/extent~Extent} extent1 Extent 1.
* @param {module:ol/extent~Extent} extent2 Extent.
* @return {boolean} The two extents intersect.
* @api
*/
@@ -670,7 +676,7 @@ export function intersects(extent1, extent2) {
/**
* Determine if an extent is empty.
* @param {ol.Extent} extent Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @return {boolean} Is empty.
* @api
*/
@@ -680,9 +686,9 @@ export function isEmpty(extent) {
/**
* @param {ol.Extent} extent Extent.
* @param {ol.Extent=} opt_extent Extent.
* @return {ol.Extent} Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @param {module:ol/extent~Extent=} opt_extent Extent.
* @return {module:ol/extent~Extent} Extent.
*/
export function returnOrUpdate(extent, opt_extent) {
if (opt_extent) {
@@ -698,7 +704,7 @@ export function returnOrUpdate(extent, opt_extent) {
/**
* @param {ol.Extent} extent Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @param {number} value Value.
*/
export function scaleFromCenter(extent, value) {
@@ -714,9 +720,9 @@ export function scaleFromCenter(extent, value) {
/**
* Determine if the segment between two coordinates intersects (crosses,
* touches, or is contained by) the provided extent.
* @param {ol.Extent} extent The extent.
* @param {ol.Coordinate} start Segment start coordinate.
* @param {ol.Coordinate} end Segment end coordinate.
* @param {module:ol/extent~Extent} extent The extent.
* @param {module:ol/coordinate~Coordinate} start Segment start coordinate.
* @param {module:ol/coordinate~Coordinate} end Segment end coordinate.
* @return {boolean} The segment intersects the extent.
*/
export function intersectsSegment(extent, start, end) {
@@ -769,11 +775,11 @@ export function intersectsSegment(extent, start, end) {
/**
* Apply a transform function to the extent.
* @param {ol.Extent} extent Extent.
* @param {ol.TransformFunction} transformFn Transform function. Called with
* [minX, minY, maxX, maxY] extent coordinates.
* @param {ol.Extent=} opt_extent Destination extent.
* @return {ol.Extent} Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @param {module:ol/proj~TransformFunction} transformFn Transform function.
* Called with `[minX, minY, maxX, maxY]` extent coordinates.
* @param {module:ol/extent~Extent=} opt_extent Destination extent.
* @return {module:ol/extent~Extent} Extent.
* @api
*/
export function applyTransform(extent, transformFn, opt_extent) {

View File

@@ -1,3 +0,0 @@
/**
* @namespace ol.extent
*/

View File

@@ -6,23 +6,54 @@ import FormatType from './format/FormatType.js';
/**
* @param {string|ol.FeatureUrlFunction} url Feature URL service.
* @param {ol.format.Feature} format Feature format.
* @param {function(this:ol.VectorTile, Array.<ol.Feature>, ol.proj.Projection, ol.Extent)|function(this:ol.source.Vector, Array.<ol.Feature>)} success
* {@link module:ol/source/Vector~Vector} sources use a function of this type to
* load features.
*
* This function takes an {@link module:ol/extent~Extent} representing the area to be loaded,
* a `{number}` representing the resolution (map units per pixel) and an
* {@link module:ol/proj/Projection~Projection} for the projection as
* arguments. `this` within the function is bound to the
* {@link module:ol/source/Vector~Vector} it's called from.
*
* The function is responsible for loading the features and adding them to the
* source.
* @typedef {function(this:module:ol/source/Vector~Vector, module:ol/extent~Extent, number,
* module:ol/proj/Projection~Projection)} FeatureLoader
* @api
*/
/**
* {@link module:ol/source/Vector~Vector} sources use a function of this type to
* get the url to load features from.
*
* This function takes an {@link module:ol/extent~Extent} representing the area
* to be loaded, a `{number}` representing the resolution (map units per pixel)
* and an {@link module:ol/proj/Projection~Projection} for the projection as
* arguments and returns a `{string}` representing the URL.
* @typedef {function(module:ol/extent~Extent, number, module:ol/proj/Projection~Projection): string} FeatureUrlFunction
* @api
*/
/**
* @param {string|module:ol/featureloader~FeatureUrlFunction} url Feature URL service.
* @param {module:ol/format/Feature~Feature} format Feature format.
* @param {function(this:module:ol/VectorTile~VectorTile, Array.<module:ol/Feature~Feature>, module:ol/proj/Projection~Projection, module:ol/extent~Extent)|function(this:module:ol/source/Vector~Vector, Array.<module:ol/Feature~Feature>)} success
* Function called with the loaded features and optionally with the data
* projection. Called with the vector tile or source as `this`.
* @param {function(this:ol.VectorTile)|function(this:ol.source.Vector)} failure
* @param {function(this:module:ol/VectorTile~VectorTile)|function(this:module:ol/source/Vector~Vector)} failure
* Function called when loading failed. Called with the vector tile or
* source as `this`.
* @return {ol.FeatureLoader} The feature loader.
* @return {module:ol/featureloader~FeatureLoader} The feature loader.
*/
export function loadFeaturesXhr(url, format, success, failure) {
return (
/**
* @param {ol.Extent} extent Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @param {number} resolution Resolution.
* @param {ol.proj.Projection} projection Projection.
* @this {ol.source.Vector|ol.VectorTile}
* @param {module:ol/proj/Projection~Projection} projection Projection.
* @this {module:ol/source/Vector~Vector|module:ol/VectorTile~VectorTile}
*/
function(extent, resolution, projection) {
const xhr = new XMLHttpRequest();
@@ -79,17 +110,18 @@ export function loadFeaturesXhr(url, format, success, failure) {
* Create an XHR feature loader for a `url` and `format`. The feature loader
* loads features (with XHR), parses the features, and adds them to the
* vector source.
* @param {string|ol.FeatureUrlFunction} url Feature URL service.
* @param {ol.format.Feature} format Feature format.
* @return {ol.FeatureLoader} The feature loader.
* @param {string|module:ol/featureloader~FeatureUrlFunction} url Feature URL service.
* @param {module:ol/format/Feature~Feature} format Feature format.
* @return {module:ol/featureloader~FeatureLoader} The feature loader.
* @api
*/
export function xhr(url, format) {
return loadFeaturesXhr(url, format,
/**
* @param {Array.<ol.Feature>} features The loaded features.
* @param {ol.proj.Projection} dataProjection Data projection.
* @this {ol.source.Vector}
* @param {Array.<module:ol/Feature~Feature>} features The loaded features.
* @param {module:ol/proj/Projection~Projection} dataProjection Data
* projection.
* @this {module:ol/source/Vector~Vector}
*/
function(features, dataProjection) {
this.addFeatures(features);

View File

@@ -1,4 +0,0 @@
/**
* Loading mechanisms for vector data.
* @namespace ol.featureloader
*/

View File

@@ -74,7 +74,7 @@ FeatureFormat.prototype.adaptOptions = function(options) {
/**
* Get the extent from the source of the last {@link readFeatures} call.
* @return {ol.Extent} Tile extent.
* @return {module:ol/extent~Extent} Tile extent.
*/
FeatureFormat.prototype.getLastExtent = function() {
return null;
@@ -166,11 +166,11 @@ FeatureFormat.prototype.writeGeometry = function(geometry, opt_options) {};
export default FeatureFormat;
/**
* @param {ol.geom.Geometry|ol.Extent} geometry Geometry.
* @param {ol.geom.Geometry|module:ol/extent~Extent} geometry Geometry.
* @param {boolean} write Set to true for writing, false for reading.
* @param {(olx.format.WriteOptions|olx.format.ReadOptions)=} opt_options
* Options.
* @return {ol.geom.Geometry|ol.Extent} Transformed geometry.
* @return {ol.geom.Geometry|module:ol/extent~Extent} Transformed geometry.
*/
export function transformWithOptions(geometry, write, opt_options) {
const featureProjection = opt_options ?
@@ -178,7 +178,7 @@ export function transformWithOptions(geometry, write, opt_options) {
const dataProjection = opt_options ?
getProjection(opt_options.dataProjection) : null;
/**
* @type {ol.geom.Geometry|ol.Extent}
* @type {ol.geom.Geometry|module:ol/extent~Extent}
*/
let transformed;
if (featureProjection && dataProjection &&

View File

@@ -59,7 +59,7 @@ inherits(GML2, GMLBase);
*/
GML2.prototype.readFlatCoordinates_ = function(node, objectStack) {
const s = getAllTextContent(node, false).replace(/^\s*|\s*$/g, '');
const context = /** @type {ol.XmlNodeStackItem} */ (objectStack[0]);
const context = /** @type {module:ol/xml~NodeStackItem} */ (objectStack[0]);
const containerSrs = context['srsName'];
let axisOrientation = 'enu';
if (containerSrs) {
@@ -89,7 +89,7 @@ GML2.prototype.readFlatCoordinates_ = function(node, objectStack) {
* @param {Node} node Node.
* @param {Array.<*>} objectStack Object stack.
* @private
* @return {ol.Extent|undefined} Envelope.
* @return {module:ol/extent~Extent|undefined} Envelope.
*/
GML2.prototype.readBox_ = function(node, objectStack) {
/** @type {Array.<number>} */
@@ -205,7 +205,7 @@ GML2.prototype.writeFeatureElement = function(node, feature, objectStack) {
}
const item = assign({}, context);
item.node = node;
pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
(item), context.serializers,
makeSimpleNodeFactory(undefined, featureNS),
values,
@@ -278,7 +278,7 @@ GML2.prototype.writeMultiCurveOrLineString_ = function(node, geometry, objectSta
/**
* @param {Node} node Node.
* @param {ol.geom.Geometry|ol.Extent} geometry Geometry.
* @param {ol.geom.Geometry|module:ol/extent~Extent} geometry Geometry.
* @param {Array.<*>} objectStack Node stack.
*/
GML2.prototype.writeGeometryElement = function(node, geometry, objectStack) {
@@ -296,7 +296,7 @@ GML2.prototype.writeGeometryElement = function(node, geometry, objectStack) {
} else {
value = transformWithOptions(/** @type {ol.geom.Geometry} */ (geometry), true, context);
}
pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
(item), this.GEOMETRY_SERIALIZERS_,
this.GEOMETRY_NODE_FACTORY_, [value],
objectStack, undefined, this);
@@ -565,7 +565,7 @@ GML2.prototype.writeSurfaceOrPolygonMember_ = function(node, polygon, objectStac
/**
* @param {Node} node Node.
* @param {ol.Extent} extent Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @param {Array.<*>} objectStack Node stack.
* @private
*/
@@ -577,7 +577,7 @@ GML2.prototype.writeEnvelope = function(node, extent, objectStack) {
}
const keys = ['lowerCorner', 'upperCorner'];
const values = [extent[0] + ' ' + extent[1], extent[2] + ' ' + extent[3]];
pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
({node: node}), this.ENVELOPE_SERIALIZERS_,
OBJECT_PROPERTY_NODE_FACTORY,
values,
@@ -614,7 +614,7 @@ GML2.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_ = function(value, objectStack,
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
* @private
*/
GML2.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
@@ -626,7 +626,7 @@ GML2.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
* @private
*/
GML2.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
@@ -639,7 +639,7 @@ GML2.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
* @private
*/
GML2.prototype.BOX_PARSERS_ = {
@@ -652,7 +652,7 @@ GML2.prototype.BOX_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
* @private
*/
GML2.prototype.GEOMETRY_PARSERS_ = {
@@ -676,7 +676,7 @@ GML2.prototype.GEOMETRY_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
* @private
*/
GML2.prototype.GEOMETRY_SERIALIZERS_ = {
@@ -709,7 +709,7 @@ GML2.prototype.GEOMETRY_SERIALIZERS_ = {
/**
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
* @private
*/
GML2.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
@@ -723,7 +723,7 @@ GML2.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
/**
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
* @private
*/
GML2.prototype.RING_SERIALIZERS_ = {
@@ -735,7 +735,7 @@ GML2.prototype.RING_SERIALIZERS_ = {
/**
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
* @private
*/
GML2.prototype.POINTMEMBER_SERIALIZERS_ = {
@@ -748,7 +748,7 @@ GML2.prototype.POINTMEMBER_SERIALIZERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
* @private
*/
GML2.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
@@ -762,7 +762,7 @@ GML2.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
/**
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
* @private
*/
GML2.prototype.ENVELOPE_SERIALIZERS_ = {

View File

@@ -288,7 +288,7 @@ GML3.prototype.readCurve_ = function(node, objectStack) {
* @param {Node} node Node.
* @param {Array.<*>} objectStack Object stack.
* @private
* @return {ol.Extent|undefined} Envelope.
* @return {module:ol/extent~Extent|undefined} Envelope.
*/
GML3.prototype.readEnvelope_ = function(node, objectStack) {
/** @type {Array.<number>} */
@@ -395,7 +395,7 @@ GML3.prototype.readFlatPosList_ = function(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
* @private
*/
GML3.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
@@ -408,7 +408,7 @@ GML3.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
* @private
*/
GML3.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
@@ -421,7 +421,7 @@ GML3.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
* @private
*/
GML3.prototype.GEOMETRY_PARSERS_ = {
@@ -451,7 +451,7 @@ GML3.prototype.GEOMETRY_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
* @private
*/
GML3.prototype.MULTICURVE_PARSERS_ = {
@@ -466,7 +466,7 @@ GML3.prototype.MULTICURVE_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
* @private
*/
GML3.prototype.MULTISURFACE_PARSERS_ = {
@@ -481,7 +481,7 @@ GML3.prototype.MULTISURFACE_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
* @private
*/
GML3.prototype.CURVEMEMBER_PARSERS_ = {
@@ -495,7 +495,7 @@ GML3.prototype.CURVEMEMBER_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
* @private
*/
GML3.prototype.SURFACEMEMBER_PARSERS_ = {
@@ -508,7 +508,7 @@ GML3.prototype.SURFACEMEMBER_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
* @private
*/
GML3.prototype.SURFACE_PARSERS_ = {
@@ -520,7 +520,7 @@ GML3.prototype.SURFACE_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
* @private
*/
GML3.prototype.CURVE_PARSERS_ = {
@@ -532,7 +532,7 @@ GML3.prototype.CURVE_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
* @private
*/
GML3.prototype.ENVELOPE_PARSERS_ = {
@@ -547,7 +547,7 @@ GML3.prototype.ENVELOPE_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
* @private
*/
GML3.prototype.PATCHES_PARSERS_ = {
@@ -560,7 +560,7 @@ GML3.prototype.PATCHES_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
* @private
*/
GML3.prototype.SEGMENTS_PARSERS_ = {
@@ -674,7 +674,7 @@ GML3.prototype.writePoint_ = function(node, geometry, objectStack) {
/**
* @param {Node} node Node.
* @param {ol.Extent} extent Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @param {Array.<*>} objectStack Node stack.
*/
GML3.prototype.writeEnvelope = function(node, extent, objectStack) {
@@ -685,7 +685,7 @@ GML3.prototype.writeEnvelope = function(node, extent, objectStack) {
}
const keys = ['lowerCorner', 'upperCorner'];
const values = [extent[0] + ' ' + extent[1], extent[2] + ' ' + extent[3]];
pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
({node: node}), this.ENVELOPE_SERIALIZERS_,
OBJECT_PROPERTY_NODE_FACTORY,
values,
@@ -936,7 +936,7 @@ GML3.prototype.writeCurveSegments_ = function(node, line, objectStack) {
/**
* @param {Node} node Node.
* @param {ol.geom.Geometry|ol.Extent} geometry Geometry.
* @param {ol.geom.Geometry|module:ol/extent~Extent} geometry Geometry.
* @param {Array.<*>} objectStack Node stack.
*/
GML3.prototype.writeGeometryElement = function(node, geometry, objectStack) {
@@ -954,7 +954,7 @@ GML3.prototype.writeGeometryElement = function(node, geometry, objectStack) {
} else {
value = transformWithOptions(/** @type {ol.geom.Geometry} */ (geometry), true, context);
}
pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
(item), this.GEOMETRY_SERIALIZERS_,
this.GEOMETRY_NODE_FACTORY_, [value],
objectStack, undefined, this);
@@ -1000,7 +1000,7 @@ GML3.prototype.writeFeatureElement = function(node, feature, objectStack) {
}
const item = assign({}, context);
item.node = node;
pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
(item), context.serializers,
makeSimpleNodeFactory(undefined, featureNS),
values,
@@ -1024,7 +1024,7 @@ GML3.prototype.writeFeatureMembers_ = function(node, features, objectStack) {
this.writeFeatureElement, this);
const item = assign({}, context);
item.node = node;
pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
(item),
serializers,
makeSimpleNodeFactory(featureType, featureNS), features,
@@ -1162,7 +1162,7 @@ GML3.prototype.writeFeaturesNode = function(features, opt_options) {
/**
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
* @private
*/
GML3.prototype.RING_SERIALIZERS_ = {
@@ -1174,7 +1174,7 @@ GML3.prototype.RING_SERIALIZERS_ = {
/**
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
* @private
*/
GML3.prototype.ENVELOPE_SERIALIZERS_ = {
@@ -1186,7 +1186,7 @@ GML3.prototype.ENVELOPE_SERIALIZERS_ = {
/**
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
* @private
*/
GML3.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
@@ -1200,7 +1200,7 @@ GML3.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
/**
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
* @private
*/
GML3.prototype.POINTMEMBER_SERIALIZERS_ = {
@@ -1212,7 +1212,7 @@ GML3.prototype.POINTMEMBER_SERIALIZERS_ = {
/**
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
* @private
*/
GML3.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
@@ -1226,7 +1226,7 @@ GML3.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
/**
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
* @private
*/
GML3.prototype.GEOMETRY_SERIALIZERS_ = {

View File

@@ -440,7 +440,7 @@ GMLBase.prototype.readFlatCoordinatesFromNode_ = function(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
* @private
*/
GMLBase.prototype.MULTIPOINT_PARSERS_ = {
@@ -453,7 +453,7 @@ GMLBase.prototype.MULTIPOINT_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
* @private
*/
GMLBase.prototype.MULTILINESTRING_PARSERS_ = {
@@ -466,7 +466,7 @@ GMLBase.prototype.MULTILINESTRING_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
* @private
*/
GMLBase.prototype.MULTIPOLYGON_PARSERS_ = {
@@ -479,7 +479,7 @@ GMLBase.prototype.MULTIPOLYGON_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
* @private
*/
GMLBase.prototype.POINTMEMBER_PARSERS_ = {
@@ -491,7 +491,7 @@ GMLBase.prototype.POINTMEMBER_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
* @private
*/
GMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = {
@@ -503,7 +503,7 @@ GMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
* @private
*/
GMLBase.prototype.POLYGONMEMBER_PARSERS_ = {
@@ -515,7 +515,7 @@ GMLBase.prototype.POLYGONMEMBER_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
* @protected
*/
GMLBase.prototype.RING_PARSERS = {

View File

@@ -79,7 +79,7 @@ const FEATURE_READER = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const GPX_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -91,7 +91,7 @@ const GPX_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const LINK_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -102,7 +102,7 @@ const LINK_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const RTE_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -120,7 +120,7 @@ const RTE_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const RTEPT_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -131,7 +131,7 @@ const RTEPT_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const TRK_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -149,7 +149,7 @@ const TRK_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const TRKSEG_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -159,7 +159,7 @@ const TRKSEG_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const TRKPT_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -170,7 +170,7 @@ const TRKPT_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const WPT_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -205,7 +205,7 @@ const LINK_SEQUENCE = ['text', 'type'];
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
*/
const LINK_SERIALIZERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -226,7 +226,7 @@ const RTE_SEQUENCE = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
*/
const RTE_SERIALIZERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -263,7 +263,7 @@ const TRK_SEQUENCE = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
*/
const TRK_SERIALIZERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -287,7 +287,7 @@ const TRKSEG_NODE_FACTORY = makeSimpleNodeFactory('trkpt');
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
*/
const TRKSEG_SERIALIZERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -309,7 +309,7 @@ const WPT_TYPE_SEQUENCE = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
*/
const WPT_TYPE_SERIALIZERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -365,7 +365,7 @@ function GPX_NODE_FACTORY(value, objectStack, opt_nodeName) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
*/
const GPX_SERIALIZERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -712,7 +712,7 @@ function writeLink(node, value, objectStack) {
properties['linkText'],
properties['linkType']
];
pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */ ({node: node}),
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */ ({node: node}),
LINK_SERIALIZERS, OBJECT_PROPERTY_NODE_FACTORY,
link, objectStack, LINK_SEQUENCE);
}
@@ -720,7 +720,7 @@ function writeLink(node, value, objectStack) {
/**
* @param {Node} node Node.
* @param {ol.Coordinate} coordinate Coordinate.
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
* @param {Array.<*>} objectStack Object stack.
*/
function writeWptType(node, coordinate, objectStack) {
@@ -755,7 +755,7 @@ function writeWptType(node, coordinate, objectStack) {
RTEPT_TYPE_SEQUENCE[namespaceURI] :
WPT_TYPE_SEQUENCE[namespaceURI];
const values = makeSequence(properties, orderedKeys);
pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
({node: node, 'properties': properties}),
WPT_TYPE_SERIALIZERS, OBJECT_PROPERTY_NODE_FACTORY,
values, objectStack, orderedKeys);
@@ -794,7 +794,7 @@ function writeRte(node, feature, objectStack) {
function writeTrk(node, feature, objectStack) {
const options = /** @type {olx.format.WriteOptions} */ (objectStack[0]);
const properties = feature.getProperties();
/** @type {ol.XmlNodeStackItem} */
/** @type {module:ol/xml~NodeStackItem} */
const context = {node: node, 'properties': properties};
let geometry = feature.getGeometry();
if (geometry) {
@@ -817,7 +817,7 @@ function writeTrk(node, feature, objectStack) {
* @param {Array.<*>} objectStack Object stack.
*/
function writeTrkSeg(node, lineString, objectStack) {
/** @type {ol.XmlNodeStackItem} */
/** @type {module:ol/xml~NodeStackItem} */
const context = {node: node, 'geometryLayout': lineString.getLayout(),
'properties': {}};
pushSerializeAndPop(context,
@@ -881,7 +881,7 @@ GPX.prototype.writeFeaturesNode = function(features, opt_options) {
gpx.setAttribute('version', '1.1');
gpx.setAttribute('creator', 'OpenLayers');
pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
({node: gpx}), GPX_SERIALIZERS, GPX_NODE_FACTORY, features, [opt_options]);
return gpx;
};

View File

@@ -53,7 +53,7 @@ export function getDefaultFillStyle() {
}
/**
* @type {ol.Size}
* @type {module:ol/size~Size}
*/
let DEFAULT_IMAGE_STYLE_ANCHOR;
@@ -68,7 +68,7 @@ let DEFAULT_IMAGE_STYLE_ANCHOR_X_UNITS;
let DEFAULT_IMAGE_STYLE_ANCHOR_Y_UNITS;
/**
* @type {ol.Size}
* @type {module:ol/size~Size}
*/
let DEFAULT_IMAGE_STYLE_SIZE;
@@ -386,7 +386,7 @@ function createNameStyleFunction(foundStyle, name) {
* @param {Array.<ol.style.Style>} defaultStyle Default style.
* @param {!Object.<string, (Array.<ol.style.Style>|string)>} sharedStyles Shared styles.
* @param {boolean|undefined} showPointNames true to show names for point placemarks.
* @return {ol.StyleFunction} Feature style function.
* @return {module:ol/style~StyleFunction} Feature style function.
*/
function createFeatureStyleFunction(style, styleUrl, defaultStyle, sharedStyles, showPointNames) {
@@ -573,7 +573,7 @@ function readScale(node) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const STYLE_MAP_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -594,7 +594,7 @@ function readStyleMapValue(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const ICON_STYLE_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -710,7 +710,7 @@ function iconStyleParser(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const LABEL_STYLE_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -745,7 +745,7 @@ function labelStyleParser(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const LINE_STYLE_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -781,7 +781,7 @@ function lineStyleParser(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const POLY_STYLE_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -822,7 +822,7 @@ function polyStyleParser(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const FLAT_LINEAR_RING_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -866,7 +866,7 @@ function gxCoordParser(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const GX_MULTITRACK_GEOMETRY_PARSERS = makeStructureNS(
GX_NAMESPACE_URIS, {
@@ -893,7 +893,7 @@ function readGxMultiTrack(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const GX_TRACK_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -931,7 +931,7 @@ function readGxTrack(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const ICON_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -963,7 +963,7 @@ function readIcon(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const GEOMETRY_FLAT_COORDINATES_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -984,7 +984,7 @@ function readFlatCoordinatesFromNode(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const EXTRUDE_AND_ALTITUDE_MODE_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -1041,7 +1041,7 @@ function readLinearRing(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const MULTI_GEOMETRY_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -1137,7 +1137,7 @@ function readPoint(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const FLAT_LINEAR_RINGS_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -1176,7 +1176,7 @@ function readPolygon(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const STYLE_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -1269,7 +1269,7 @@ function setCommonGeometryProperties(multiGeometry, geometries) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const DATA_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -1297,7 +1297,7 @@ function dataParser(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const EXTENDED_DATA_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -1316,7 +1316,7 @@ function extendedDataParser(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const REGION_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -1335,7 +1335,7 @@ function regionParser(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const PAIR_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -1394,7 +1394,7 @@ function placemarkStyleMapParser(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const SCHEMA_DATA_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -1428,7 +1428,7 @@ function simpleDataParser(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const LAT_LON_ALT_BOX_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -1467,7 +1467,7 @@ function latLonAltBoxParser(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const LOD_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -1497,7 +1497,7 @@ function lodParser(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const INNER_BOUNDARY_IS_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -1523,7 +1523,7 @@ function innerBoundaryIsParser(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const OUTER_BOUNDARY_IS_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -1549,7 +1549,7 @@ function outerBoundaryIsParser(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const NETWORK_LINK_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -1567,7 +1567,7 @@ const NETWORK_LINK_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const LINK_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -1600,7 +1600,7 @@ function whenParser(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const PLACEMARK_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -2112,7 +2112,7 @@ function writeCoordinatesTextNode(node, coordinates, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
*/
const EXTENDEDDATA_NODE_SERIALIZERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -2129,7 +2129,7 @@ const EXTENDEDDATA_NODE_SERIALIZERS = makeStructureNS(
*/
function writeDataNode(node, pair, objectStack) {
node.setAttribute('name', pair.name);
const /** @type {ol.XmlNodeStackItem} */ context = {node: node};
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
const value = pair.value;
if (typeof value == 'object') {
@@ -2169,7 +2169,7 @@ function writeDataNodeValue(node, value) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
*/
const DOCUMENT_SERIALIZERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -2197,7 +2197,7 @@ const DOCUMENT_NODE_FACTORY = function(value, objectStack, opt_nodeName) {
* @this {ol.format.KML}
*/
function writeDocument(node, features, objectStack) {
const /** @type {ol.XmlNodeStackItem} */ context = {node: node};
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
pushSerializeAndPop(context, DOCUMENT_SERIALIZERS,
DOCUMENT_NODE_FACTORY, features, objectStack, undefined,
this);
@@ -2218,7 +2218,7 @@ const DATA_NODE_FACTORY = makeSimpleNodeFactory('Data');
* @param {Array.<*>} objectStack Object stack.
*/
function writeExtendedData(node, namesAndValues, objectStack) {
const /** @type {ol.XmlNodeStackItem} */ context = {node: node};
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
const names = namesAndValues.names;
const values = namesAndValues.values;
const length = names.length;
@@ -2245,7 +2245,7 @@ const ICON_SEQUENCE = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
*/
const ICON_SERIALIZERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -2278,7 +2278,7 @@ const GX_NODE_FACTORY = function(value, objectStack, opt_nodeName) {
* @param {Array.<*>} objectStack Object stack.
*/
function writeIcon(node, icon, objectStack) {
const /** @type {ol.XmlNodeStackItem} */ context = {node: node};
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
const parentNode = objectStack[objectStack.length - 1].node;
let orderedKeys = ICON_SEQUENCE[parentNode.namespaceURI];
let values = makeSequence(icon, orderedKeys);
@@ -2305,7 +2305,7 @@ const ICON_STYLE_SEQUENCE = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
*/
const ICON_STYLE_SERIALIZERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -2322,7 +2322,7 @@ const ICON_STYLE_SERIALIZERS = makeStructureNS(
* @param {Array.<*>} objectStack Object stack.
*/
function writeIconStyle(node, style, objectStack) {
const /** @type {ol.XmlNodeStackItem} */ context = {node: node};
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
const properties = {};
const src = style.getSrc();
const size = style.getSize();
@@ -2385,7 +2385,7 @@ const LABEL_STYLE_SEQUENCE = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
*/
const LABEL_STYLE_SERIALIZERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -2400,7 +2400,7 @@ const LABEL_STYLE_SERIALIZERS = makeStructureNS(
* @param {Array.<*>} objectStack Object stack.
*/
function writeLabelStyle(node, style, objectStack) {
const /** @type {ol.XmlNodeStackItem} */ context = {node: node};
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
const properties = {};
const fill = style.getFill();
if (fill) {
@@ -2431,7 +2431,7 @@ const LINE_STYLE_SEQUENCE = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
*/
const LINE_STYLE_SERIALIZERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -2446,7 +2446,7 @@ const LINE_STYLE_SERIALIZERS = makeStructureNS(
* @param {Array.<*>} objectStack Object stack.
*/
function writeLineStyle(node, style, objectStack) {
const /** @type {ol.XmlNodeStackItem} */ context = {node: node};
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
const properties = {
'color': style.getColor(),
'width': style.getWidth()
@@ -2525,7 +2525,7 @@ const POLYGON_NODE_FACTORY = makeSimpleNodeFactory('Polygon');
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
*/
const MULTI_GEOMETRY_SERIALIZERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -2545,7 +2545,7 @@ const MULTI_GEOMETRY_SERIALIZERS = makeStructureNS(
* @param {Array.<*>} objectStack Object stack.
*/
function writeMultiGeometry(node, geometry, objectStack) {
/** @type {ol.XmlNodeStackItem} */
/** @type {module:ol/xml~NodeStackItem} */
const context = {node: node};
const type = geometry.getType();
/** @type {Array.<ol.geom.Geometry>} */
@@ -2577,7 +2577,7 @@ function writeMultiGeometry(node, geometry, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
*/
const BOUNDARY_IS_SERIALIZERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -2592,7 +2592,7 @@ const BOUNDARY_IS_SERIALIZERS = makeStructureNS(
* @param {Array.<*>} objectStack Object stack.
*/
function writeBoundaryIs(node, linearRing, objectStack) {
const /** @type {ol.XmlNodeStackItem} */ context = {node: node};
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
pushSerializeAndPop(context,
BOUNDARY_IS_SERIALIZERS,
LINEAR_RING_NODE_FACTORY, [linearRing], objectStack);
@@ -2601,7 +2601,7 @@ function writeBoundaryIs(node, linearRing, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
*/
const PLACEMARK_SERIALIZERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -2650,7 +2650,7 @@ const EXTENDEDDATA_NODE_FACTORY = makeSimpleNodeFactory('ExtendedData');
* @this {ol.format.KML}
*/
function writePlacemark(node, feature, objectStack) {
const /** @type {ol.XmlNodeStackItem} */ context = {node: node};
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
// set id
if (feature.getId()) {
@@ -2720,7 +2720,7 @@ const PRIMITIVE_GEOMETRY_SEQUENCE = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
*/
const PRIMITIVE_GEOMETRY_SERIALIZERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -2738,7 +2738,7 @@ const PRIMITIVE_GEOMETRY_SERIALIZERS = makeStructureNS(
*/
function writePrimitiveGeometry(node, geometry, objectStack) {
const flatCoordinates = geometry.getFlatCoordinates();
const /** @type {ol.XmlNodeStackItem} */ context = {node: node};
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
context['layout'] = geometry.getLayout();
context['stride'] = geometry.getStride();
@@ -2756,7 +2756,7 @@ function writePrimitiveGeometry(node, geometry, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
*/
const POLYGON_SERIALIZERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -2791,7 +2791,7 @@ const OUTER_BOUNDARY_NODE_FACTORY = makeSimpleNodeFactory('outerBoundaryIs');
function writePolygon(node, polygon, objectStack) {
const linearRings = polygon.getLinearRings();
const outerRing = linearRings.shift();
const /** @type {ol.XmlNodeStackItem} */ context = {node: node};
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
// inner rings
pushSerializeAndPop(context,
POLYGON_SERIALIZERS,
@@ -2807,7 +2807,7 @@ function writePolygon(node, polygon, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
*/
const POLY_STYLE_SERIALIZERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -2829,7 +2829,7 @@ const COLOR_NODE_FACTORY = makeSimpleNodeFactory('color');
* @param {Array.<*>} objectStack Object stack.
*/
function writePolyStyle(node, style, objectStack) {
const /** @type {ol.XmlNodeStackItem} */ context = {node: node};
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
pushSerializeAndPop(context, POLY_STYLE_SERIALIZERS,
COLOR_NODE_FACTORY, [style.getColor()], objectStack);
}
@@ -2858,7 +2858,7 @@ const STYLE_SEQUENCE = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
*/
const STYLE_SERIALIZERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -2875,7 +2875,7 @@ const STYLE_SERIALIZERS = makeStructureNS(
* @param {Array.<*>} objectStack Object stack.
*/
function writeStyle(node, style, objectStack) {
const /** @type {ol.XmlNodeStackItem} */ context = {node: node};
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
const properties = {};
const fillStyle = style.getFill();
const strokeStyle = style.getStroke();
@@ -2925,7 +2925,7 @@ const KML_SEQUENCE = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
*/
const KML_SERIALIZERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -2968,7 +2968,7 @@ KML.prototype.writeFeaturesNode = function(features, opt_options) {
setAttributeNS(kml, xmlSchemaInstanceUri, 'xsi:schemaLocation',
SCHEMA_LOCATION);
const /** @type {ol.XmlNodeStackItem} */ context = {node: kml};
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: kml};
const properties = {};
if (features.length > 1) {
properties['Document'] = features;

View File

@@ -73,7 +73,7 @@ const MVT = function(opt_options) {
/**
* @private
* @type {ol.Extent}
* @type {module:ol/extent~Extent}
*/
this.extent_ = null;

View File

@@ -45,7 +45,7 @@ const NAMESPACE_URIS = [null];
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const WAY_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -56,7 +56,7 @@ const WAY_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -67,7 +67,7 @@ const PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const NODE_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -83,7 +83,7 @@ function readNode(node, objectStack) {
const options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
const state = /** @type {Object} */ (objectStack[objectStack.length - 1]);
const id = node.getAttribute('id');
/** @type {ol.Coordinate} */
/** @type {module:ol/coordinate~Coordinate} */
const coordinates = [
parseFloat(node.getAttribute('lon')),
parseFloat(node.getAttribute('lat'))

View File

@@ -27,7 +27,7 @@ const NAMESPACE_URIS = [null, 'http://www.opengis.net/ows/1.1'];
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -39,7 +39,7 @@ const PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const ADDRESS_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -54,7 +54,7 @@ const ADDRESS_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const ALLOWED_VALUES_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -64,7 +64,7 @@ const ALLOWED_VALUES_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const CONSTRAINT_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -74,7 +74,7 @@ const CONSTRAINT_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const CONTACT_INFO_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -85,7 +85,7 @@ const CONTACT_INFO_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const DCP_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -95,7 +95,7 @@ const DCP_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const HTTP_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -106,7 +106,7 @@ const HTTP_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const OPERATION_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -116,7 +116,7 @@ const OPERATION_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const OPERATIONS_METADATA_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -126,7 +126,7 @@ const OPERATIONS_METADATA_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const PHONE_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -137,7 +137,7 @@ const PHONE_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const REQUEST_METHOD_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -147,7 +147,7 @@ const REQUEST_METHOD_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const SERVICE_CONTACT_PARSERS =
makeStructureNS(
@@ -160,7 +160,7 @@ const SERVICE_CONTACT_PARSERS =
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const SERVICE_IDENTIFICATION_PARSERS =
makeStructureNS(
@@ -176,7 +176,7 @@ const SERVICE_IDENTIFICATION_PARSERS =
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const SERVICE_PROVIDER_PARSERS =
makeStructureNS(

View File

@@ -70,12 +70,12 @@ const GEOMETRY_READERS = {
* Concatenate arcs into a coordinate array.
* @param {Array.<number>} indices Indices of arcs to concatenate. Negative
* values indicate arcs need to be reversed.
* @param {Array.<Array.<ol.Coordinate>>} arcs Array of arcs (already
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs (already
* transformed).
* @return {Array.<ol.Coordinate>} Coordinates array.
* @return {Array.<module:ol/coordinate~Coordinate>} Coordinates array.
*/
function concatenateArcs(indices, arcs) {
/** @type {Array.<ol.Coordinate>} */
/** @type {Array.<module:ol/coordinate~Coordinate>} */
const coordinates = [];
let index, arc;
for (let i = 0, ii = indices.length; i < ii; ++i) {
@@ -141,7 +141,7 @@ function readMultiPointGeometry(object, scale, translate) {
* Create a linestring from a TopoJSON geometry object.
*
* @param {TopoJSONGeometry} object TopoJSON object.
* @param {Array.<Array.<ol.Coordinate>>} arcs Array of arcs.
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
* @return {ol.geom.LineString} Geometry.
*/
function readLineStringGeometry(object, arcs) {
@@ -154,7 +154,7 @@ function readLineStringGeometry(object, arcs) {
* Create a multi-linestring from a TopoJSON geometry object.
*
* @param {TopoJSONGeometry} object TopoJSON object.
* @param {Array.<Array.<ol.Coordinate>>} arcs Array of arcs.
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
* @return {ol.geom.MultiLineString} Geometry.
*/
function readMultiLineStringGeometry(object, arcs) {
@@ -170,7 +170,7 @@ function readMultiLineStringGeometry(object, arcs) {
* Create a polygon from a TopoJSON geometry object.
*
* @param {TopoJSONGeometry} object TopoJSON object.
* @param {Array.<Array.<ol.Coordinate>>} arcs Array of arcs.
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
* @return {ol.geom.Polygon} Geometry.
*/
function readPolygonGeometry(object, arcs) {
@@ -186,7 +186,7 @@ function readPolygonGeometry(object, arcs) {
* Create a multi-polygon from a TopoJSON geometry object.
*
* @param {TopoJSONGeometry} object TopoJSON object.
* @param {Array.<Array.<ol.Coordinate>>} arcs Array of arcs.
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
* @return {ol.geom.MultiPolygon} Geometry.
*/
function readMultiPolygonGeometry(object, arcs) {
@@ -210,7 +210,7 @@ function readMultiPolygonGeometry(object, arcs) {
*
* @param {TopoJSONGeometryCollection} collection TopoJSON Geometry
* object.
* @param {Array.<Array.<ol.Coordinate>>} arcs Array of arcs.
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
* @param {Array.<number>} scale Scale for each dimension.
* @param {Array.<number>} translate Translation for each dimension.
* @param {string|undefined} property Property to set the `GeometryCollection`'s parent
@@ -234,7 +234,7 @@ function readFeaturesFromGeometryCollection(collection, arcs, scale, translate,
* Create a feature from a TopoJSON geometry object.
*
* @param {TopoJSONGeometry} object TopoJSON geometry object.
* @param {Array.<Array.<ol.Coordinate>>} arcs Array of arcs.
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
* @param {Array.<number>} scale Scale for each dimension.
* @param {Array.<number>} translate Translation for each dimension.
* @param {string|undefined} property Property to set the `GeometryCollection`'s parent
@@ -329,7 +329,7 @@ TopoJSON.prototype.readFeaturesFromObject = function(object, opt_options) {
* Apply a linear transform to array of arcs. The provided array of arcs is
* modified in place.
*
* @param {Array.<Array.<ol.Coordinate>>} arcs Array of arcs.
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
* @param {Array.<number>} scale Scale for each dimension.
* @param {Array.<number>} translate Translation for each dimension.
*/
@@ -343,7 +343,7 @@ function transformArcs(arcs, scale, translate) {
/**
* Apply a linear transform to an arc. The provided arc is modified in place.
*
* @param {Array.<ol.Coordinate>} arc Arc.
* @param {Array.<module:ol/coordinate~Coordinate>} arc Arc.
* @param {Array.<number>} scale Scale for each dimension.
* @param {Array.<number>} translate Translation for each dimension.
*/
@@ -365,7 +365,7 @@ function transformArc(arc, scale, translate) {
* Apply a linear transform to a vertex. The provided vertex is modified in
* place.
*
* @param {ol.Coordinate} vertex Vertex.
* @param {module:ol/coordinate~Coordinate} vertex Vertex.
* @param {Array.<number>} scale Scale for each dimension.
* @param {Array.<number>} translate Translation for each dimension.
*/

View File

@@ -143,7 +143,7 @@ WFS.prototype.readFeatures;
* @inheritDoc
*/
WFS.prototype.readFeaturesFromNode = function(node, opt_options) {
const context = /** @type {ol.XmlNodeStackItem} */ ({
const context = /** @type {module:ol/xml~NodeStackItem} */ ({
'featureType': this.featureType_,
'featureNS': this.featureNS_
});
@@ -225,7 +225,7 @@ WFS.prototype.readFeatureCollectionMetadataFromDocument = function(doc) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const FEATURE_COLLECTION_PARSERS = {
'http://www.opengis.net/gml': {
@@ -253,7 +253,7 @@ WFS.prototype.readFeatureCollectionMetadataFromNode = function(node) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const TRANSACTION_SUMMARY_PARSERS = {
'http://www.opengis.net/wfs': {
@@ -277,7 +277,7 @@ function readTransactionSummary(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const OGC_FID_PARSERS = {
'http://www.opengis.net/ogc': {
@@ -299,7 +299,7 @@ function fidParser(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const INSERT_RESULTS_PARSERS = {
'http://www.opengis.net/wfs': {
@@ -321,7 +321,7 @@ function readInsertResults(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const TRANSACTION_RESPONSE_PARSERS = {
'http://www.opengis.net/wfs': {
@@ -359,7 +359,7 @@ WFS.prototype.readTransactionResponseFromNode = function(node) {
/**
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
*/
const QUERY_SERIALIZERS = {
'http://www.opengis.net/wfs': {
@@ -441,7 +441,7 @@ function writeDelete(node, feature, objectStack) {
/**
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
*/
const TRANSACTION_SERIALIZERS = {
'http://www.opengis.net/wfs': {
@@ -483,7 +483,7 @@ function writeUpdate(node, feature, objectStack) {
values.push({name: name, value: value});
}
}
pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */ (
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */ (
{'gmlVersion': context['gmlVersion'], node: node,
'hasZ': context['hasZ'], 'srsName': context['srsName']}),
TRANSACTION_SERIALIZERS,
@@ -543,7 +543,7 @@ function writeNative(node, nativeElement, objectStack) {
/**
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
*/
const GETFEATURE_SERIALIZERS = {
'http://www.opengis.net/wfs': {
@@ -596,7 +596,7 @@ function writeQuery(node, featureType, objectStack) {
if (featureNS) {
setAttributeNS(node, XMLNS, 'xmlns:' + featurePrefix, featureNS);
}
const item = /** @type {ol.XmlNodeStackItem} */ (assign({}, context));
const item = /** @type {module:ol/xml~NodeStackItem} */ (assign({}, context));
item.node = node;
pushSerializeAndPop(item,
QUERY_SERIALIZERS,
@@ -617,7 +617,7 @@ function writeQuery(node, featureType, objectStack) {
* @param {Array.<*>} objectStack Node stack.
*/
function writeFilterCondition(node, filter, objectStack) {
/** @type {ol.XmlNodeStackItem} */
/** @type {module:ol/xml~NodeStackItem} */
const item = {node: node};
pushSerializeAndPop(item,
GETFEATURE_SERIALIZERS,
@@ -713,7 +713,7 @@ function writeDuringFilter(node, filter, objectStack) {
* @param {Array.<*>} objectStack Node stack.
*/
function writeLogicalFilter(node, filter, objectStack) {
/** @type {ol.XmlNodeStackItem} */
/** @type {module:ol/xml~NodeStackItem} */
const item = {node: node};
const conditions = filter.conditions;
for (let i = 0, ii = conditions.length; i < ii; ++i) {
@@ -732,7 +732,7 @@ function writeLogicalFilter(node, filter, objectStack) {
* @param {Array.<*>} objectStack Node stack.
*/
function writeNotFilter(node, filter, objectStack) {
/** @type {ol.XmlNodeStackItem} */
/** @type {module:ol/xml~NodeStackItem} */
const item = {node: node};
const condition = filter.condition;
pushSerializeAndPop(item,
@@ -866,7 +866,7 @@ export function writeFilter(filter) {
*/
function writeGetFeature(node, featureTypes, objectStack) {
const context = /** @type {Object} */ (objectStack[objectStack.length - 1]);
const item = /** @type {ol.XmlNodeStackItem} */ (assign({}, context));
const item = /** @type {module:ol/xml~NodeStackItem} */ (assign({}, context));
item.node = node;
pushSerializeAndPop(item,
GETFEATURE_SERIALIZERS,
@@ -922,7 +922,7 @@ WFS.prototype.writeGetFeature = function(options) {
}
setAttributeNS(node, 'http://www.w3.org/2001/XMLSchema-instance',
'xsi:schemaLocation', this.schemaLocation_);
/** @type {ol.XmlNodeStackItem} */
/** @type {module:ol/xml~NodeStackItem} */
const context = {
node: node,
'srsName': options.srsName,
@@ -957,7 +957,7 @@ WFS.prototype.writeTransaction = function(inserts, updates, deletes, options) {
node.setAttribute('service', 'WFS');
node.setAttribute('version', version);
let baseObj;
/** @type {ol.XmlNodeStackItem} */
/** @type {module:ol/xml~NodeStackItem} */
let obj;
if (options) {
baseObj = options.gmlOptions ? options.gmlOptions : {};

View File

@@ -42,7 +42,7 @@ const NAMESPACE_URIS = [
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -53,7 +53,7 @@ const PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const CAPABILITY_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -65,7 +65,7 @@ const CAPABILITY_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const SERVICE_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -85,7 +85,7 @@ const SERVICE_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const CONTACT_INFORMATION_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -100,7 +100,7 @@ const CONTACT_INFORMATION_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const CONTACT_PERSON_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -111,7 +111,7 @@ const CONTACT_PERSON_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const CONTACT_ADDRESS_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -126,7 +126,7 @@ const CONTACT_ADDRESS_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const EXCEPTION_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -136,7 +136,7 @@ const EXCEPTION_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const LAYER_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -163,7 +163,7 @@ const LAYER_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const ATTRIBUTION_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -175,7 +175,7 @@ const ATTRIBUTION_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS =
makeStructureNS(NAMESPACE_URIS, {
@@ -188,7 +188,7 @@ const EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS =
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const REQUEST_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -200,7 +200,7 @@ const REQUEST_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const OPERATIONTYPE_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -211,7 +211,7 @@ const OPERATIONTYPE_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const DCPTYPE_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -221,7 +221,7 @@ const DCPTYPE_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const HTTP_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -232,7 +232,7 @@ const HTTP_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const STYLE_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -247,7 +247,7 @@ const STYLE_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const FORMAT_ONLINERESOURCE_PARSERS =
makeStructureNS(NAMESPACE_URIS, {
@@ -258,7 +258,7 @@ const FORMAT_ONLINERESOURCE_PARSERS =
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const KEYWORDLIST_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -341,7 +341,7 @@ function readBoundingBox(node, objectStack) {
/**
* @param {Node} node Node.
* @param {Array.<*>} objectStack Object stack.
* @return {ol.Extent|undefined} Bounding box object.
* @return {module:ol/extent~Extent|undefined} Bounding box object.
*/
function readEXGeographicBoundingBox(node, objectStack) {
const geographicBoundingBox = pushParseAndPop(

View File

@@ -53,7 +53,7 @@ const OWS_NAMESPACE_URIS = [
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -63,7 +63,7 @@ const PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const CONTENTS_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -74,7 +74,7 @@ const CONTENTS_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const LAYER_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -93,7 +93,7 @@ const LAYER_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const STYLE_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -106,7 +106,7 @@ const STYLE_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const TMS_LINKS_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -116,7 +116,7 @@ const TMS_LINKS_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const TMS_LIMITS_LIST_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -126,7 +126,7 @@ const TMS_LIMITS_LIST_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const TMS_LIMITS_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -140,7 +140,7 @@ const TMS_LIMITS_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const DIMENSION_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -153,7 +153,7 @@ const DIMENSION_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const WGS84_BBOX_READERS = makeStructureNS(
OWS_NAMESPACE_URIS, {
@@ -164,7 +164,7 @@ const WGS84_BBOX_READERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const TMS_PARSERS = makeStructureNS(
NAMESPACE_URIS, {
@@ -178,7 +178,7 @@ const TMS_PARSERS = makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
*/
const TM_PARSERS = makeStructureNS(
NAMESPACE_URIS, {

View File

@@ -63,7 +63,7 @@ export function not(condition) {
* intersects a fixed bounding box
*
* @param {!string} geometryName Geometry name to use.
* @param {!ol.Extent} extent Extent.
* @param {!module:ol/extent~Extent} extent Extent.
* @param {string=} opt_srsName SRS name. No srsName attribute will be
* set on geometries when this is not provided.
* @returns {!ol.format.filter.Bbox} `<BBOX>` operator.

View File

@@ -11,7 +11,7 @@ import Filter from '../filter/Filter.js';
*
* @constructor
* @param {!string} geometryName Geometry name to use.
* @param {!ol.Extent} extent Extent.
* @param {!module:ol/extent~Extent} extent Extent.
* @param {string=} opt_srsName SRS name. No srsName attribute will be
* set on geometries when this is not provided.
* @extends {ol.format.filter.Filter}
@@ -29,7 +29,7 @@ const Bbox = function(geometryName, extent, opt_srsName) {
/**
* @public
* @type {ol.Extent}
* @type {module:ol/extent~Extent}
*/
this.extent = extent;

View File

@@ -14,7 +14,7 @@ import {deflateCoordinate} from '../geom/flat/deflate.js';
*
* @constructor
* @extends {ol.geom.SimpleGeometry}
* @param {ol.Coordinate} center Center.
* @param {module:ol/coordinate~Coordinate} center Center.
* @param {number=} opt_radius Radius.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api
@@ -82,8 +82,8 @@ Circle.prototype.containsXY = function(x, y) {
/**
* Return the center of the circle as {@link ol.Coordinate coordinate}.
* @return {ol.Coordinate} Center.
* Return the center of the circle as {@link module:ol/coordinate~Coordinate coordinate}.
* @return {module:ol/coordinate~Coordinate} Center.
* @api
*/
Circle.prototype.getCenter = function() {
@@ -158,8 +158,8 @@ Circle.prototype.intersectsExtent = function(extent) {
/**
* Set the center of the circle as {@link ol.Coordinate coordinate}.
* @param {ol.Coordinate} center Center.
* Set the center of the circle as {@link module:ol/coordinate~Coordinate coordinate}.
* @param {module:ol/coordinate~Coordinate} center Center.
* @api
*/
Circle.prototype.setCenter = function(center) {
@@ -175,9 +175,9 @@ Circle.prototype.setCenter = function(center) {
/**
* Set the center (as {@link ol.Coordinate coordinate}) and the radius (as
* Set the center (as {@link module:ol/coordinate~Coordinate coordinate}) and the radius (as
* number) of the circle.
* @param {ol.Coordinate} center Center.
* @param {module:ol/coordinate~Coordinate} center Center.
* @param {number} radius Radius.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api
@@ -250,9 +250,9 @@ Circle.prototype.setRadius = function(radius) {
* correspond to the shape that would be obtained by transforming every point
* of the original circle.
*
* @param {ol.ProjectionLike} source The current projection. Can be a
* @param {module:ol/proj~ProjectionLike} source The current projection. Can be a
* string identifier or a {@link ol.proj.Projection} object.
* @param {ol.ProjectionLike} destination The desired projection. Can be a
* @param {module:ol/proj~ProjectionLike} destination The desired projection. Can be a
* string identifier or a {@link ol.proj.Projection} object.
* @return {ol.geom.Circle} This geometry. Note that original geometry is
* modified in place.

View File

@@ -30,7 +30,7 @@ const Geometry = function() {
/**
* @private
* @type {ol.Extent}
* @type {module:ol/extent~Extent}
*/
this.extent_ = createEmpty();
@@ -60,7 +60,7 @@ const Geometry = function() {
/**
* @private
* @type {ol.Transform}
* @type {module:ol/transform~Transform}
*/
this.tmpTransform_ = createTransform();
@@ -81,7 +81,7 @@ Geometry.prototype.clone = function() {};
* @abstract
* @param {number} x X.
* @param {number} y Y.
* @param {ol.Coordinate} closestPoint Closest point.
* @param {module:ol/coordinate~Coordinate} closestPoint Closest point.
* @param {number} minSquaredDistance Minimum squared distance.
* @return {number} Minimum squared distance.
*/
@@ -90,10 +90,10 @@ Geometry.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDista
/**
* Return the closest point of the geometry to the passed point as
* {@link ol.Coordinate coordinate}.
* @param {ol.Coordinate} point Point.
* @param {ol.Coordinate=} opt_closestPoint Closest point.
* @return {ol.Coordinate} Closest point.
* {@link module:ol/coordinate~Coordinate coordinate}.
* @param {module:ol/coordinate~Coordinate} point Point.
* @param {module:ol/coordinate~Coordinate=} opt_closestPoint Closest point.
* @return {module:ol/coordinate~Coordinate} Closest point.
* @api
*/
Geometry.prototype.getClosestPoint = function(point, opt_closestPoint) {
@@ -106,7 +106,7 @@ Geometry.prototype.getClosestPoint = function(point, opt_closestPoint) {
/**
* Returns true if this geometry includes the specified coordinate. If the
* coordinate is on the boundary of the geometry, returns false.
* @param {ol.Coordinate} coordinate Coordinate.
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
* @return {boolean} Contains coordinate.
* @api
*/
@@ -117,9 +117,9 @@ Geometry.prototype.intersectsCoordinate = function(coordinate) {
/**
* @abstract
* @param {ol.Extent} extent Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @protected
* @return {ol.Extent} extent Extent.
* @return {module:ol/extent~Extent} extent Extent.
*/
Geometry.prototype.computeExtent = function(extent) {};
@@ -134,8 +134,8 @@ Geometry.prototype.containsXY = FALSE;
/**
* Get the extent of the geometry.
* @param {ol.Extent=} opt_extent Extent.
* @return {ol.Extent} extent Extent.
* @param {module:ol/extent~Extent=} opt_extent Extent.
* @return {module:ol/extent~Extent} extent Extent.
* @api
*/
Geometry.prototype.getExtent = function(opt_extent) {
@@ -152,7 +152,7 @@ Geometry.prototype.getExtent = function(opt_extent) {
* coordinates in place.
* @abstract
* @param {number} angle Rotation angle in radians.
* @param {ol.Coordinate} anchor The rotation center.
* @param {module:ol/coordinate~Coordinate} anchor The rotation center.
* @api
*/
Geometry.prototype.rotate = function(angle, anchor) {};
@@ -165,7 +165,7 @@ Geometry.prototype.rotate = function(angle, anchor) {};
* @param {number} sx The scaling factor in the x-direction.
* @param {number=} opt_sy The scaling factor in the y-direction (defaults to
* sx).
* @param {ol.Coordinate=} opt_anchor The scale origin (defaults to the center
* @param {module:ol/coordinate~Coordinate=} opt_anchor The scale origin (defaults to the center
* of the geometry extent).
* @api
*/
@@ -214,7 +214,7 @@ Geometry.prototype.getType = function() {};
* If you do not want the geometry modified in place, first `clone()` it and
* then use this function on the clone.
* @abstract
* @param {ol.TransformFunction} transformFn Transform.
* @param {module:ol/proj~TransformFunction} transformFn Transform.
*/
Geometry.prototype.applyTransform = function(transformFn) {};
@@ -222,7 +222,7 @@ Geometry.prototype.applyTransform = function(transformFn) {};
/**
* Test if the geometry and the passed extent intersect.
* @abstract
* @param {ol.Extent} extent Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @return {boolean} `true` if the geometry and the extent intersect.
*/
Geometry.prototype.intersectsExtent = function(extent) {};
@@ -245,9 +245,9 @@ Geometry.prototype.translate = function(deltaX, deltaY) {};
* If you do not want the geometry modified in place, first `clone()` it and
* then use this function on the clone.
*
* @param {ol.ProjectionLike} source The current projection. Can be a
* @param {module:ol/proj~ProjectionLike} source The current projection. Can be a
* string identifier or a {@link ol.proj.Projection} object.
* @param {ol.ProjectionLike} destination The desired projection. Can be a
* @param {module:ol/proj~ProjectionLike} destination The desired projection. Can be a
* string identifier or a {@link ol.proj.Projection} object.
* @return {ol.geom.Geometry} This geometry. Note that original geometry is
* modified in place.

View File

@@ -22,7 +22,7 @@ import {douglasPeucker} from '../geom/flat/simplify.js';
*
* @constructor
* @extends {ol.geom.SimpleGeometry}
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api
*/
@@ -32,7 +32,7 @@ const LineString = function(coordinates, opt_layout) {
/**
* @private
* @type {ol.Coordinate}
* @type {module:ol/coordinate~Coordinate}
*/
this.flatMidpoint_ = null;
@@ -63,7 +63,7 @@ inherits(LineString, SimpleGeometry);
/**
* Append the passed coordinate to the coordinates of the linestring.
* @param {ol.Coordinate} coordinate Coordinate.
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
* @api
*/
LineString.prototype.appendCoordinate = function(coordinate) {
@@ -112,7 +112,7 @@ LineString.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDis
* If the callback returns a truthy value the function returns that
* value immediately. Otherwise the function returns `false`.
*
* @param {function(this: S, ol.Coordinate, ol.Coordinate): T} callback Function
* @param {function(this: S, module:ol/coordinate~Coordinate, module:ol/coordinate~Coordinate): T} callback Function
* called for each segment.
* @return {T|boolean} Value.
* @template T,S
@@ -134,7 +134,7 @@ LineString.prototype.forEachSegment = function(callback) {
*
* @param {number} m M.
* @param {boolean=} opt_extrapolate Extrapolate. Default is `false`.
* @return {ol.Coordinate} Coordinate.
* @return {module:ol/coordinate~Coordinate} Coordinate.
* @api
*/
LineString.prototype.getCoordinateAtM = function(m, opt_extrapolate) {
@@ -150,7 +150,7 @@ LineString.prototype.getCoordinateAtM = function(m, opt_extrapolate) {
/**
* Return the coordinates of the linestring.
* @return {Array.<ol.Coordinate>} Coordinates.
* @return {Array.<module:ol/coordinate~Coordinate>} Coordinates.
* @override
* @api
*/
@@ -165,9 +165,9 @@ LineString.prototype.getCoordinates = function() {
* The `fraction` is a number between 0 and 1, where 0 is the start of the
* linestring and 1 is the end.
* @param {number} fraction Fraction.
* @param {ol.Coordinate=} opt_dest Optional coordinate whose values will
* @param {module:ol/coordinate~Coordinate=} opt_dest Optional coordinate whose values will
* be modified. If not provided, a new coordinate will be returned.
* @return {ol.Coordinate} Coordinate of the interpolated point.
* @return {module:ol/coordinate~Coordinate} Coordinate of the interpolated point.
* @api
*/
LineString.prototype.getCoordinateAt = function(fraction, opt_dest) {
@@ -237,7 +237,7 @@ LineString.prototype.intersectsExtent = function(extent) {
/**
* Set the coordinates of the linestring.
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @override
* @api

View File

@@ -19,7 +19,7 @@ import {douglasPeucker} from '../geom/flat/simplify.js';
*
* @constructor
* @extends {ol.geom.SimpleGeometry}
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api
*/
@@ -89,7 +89,7 @@ LinearRing.prototype.getArea = function() {
/**
* Return the coordinates of the linear ring.
* @return {Array.<ol.Coordinate>} Coordinates.
* @return {Array.<module:ol/coordinate~Coordinate>} Coordinates.
* @override
* @api
*/
@@ -131,7 +131,7 @@ LinearRing.prototype.intersectsExtent = function(extent) {};
/**
* Set the coordinates of the linear ring.
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @override
* @api

View File

@@ -21,7 +21,7 @@ import {douglasPeuckerArray} from '../geom/flat/simplify.js';
*
* @constructor
* @extends {ol.geom.SimpleGeometry}
* @param {Array.<Array.<ol.Coordinate>>} coordinates Coordinates.
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api
*/
@@ -121,7 +121,7 @@ MultiLineString.prototype.closestPointXY = function(x, y, closestPoint, minSquar
* @param {number} m M.
* @param {boolean=} opt_extrapolate Extrapolate. Default is `false`.
* @param {boolean=} opt_interpolate Interpolate. Default is `false`.
* @return {ol.Coordinate} Coordinate.
* @return {module:ol/coordinate~Coordinate} Coordinate.
* @api
*/
MultiLineString.prototype.getCoordinateAtM = function(m, opt_extrapolate, opt_interpolate) {
@@ -139,7 +139,7 @@ MultiLineString.prototype.getCoordinateAtM = function(m, opt_extrapolate, opt_in
/**
* Return the coordinates of the multilinestring.
* @return {Array.<Array.<ol.Coordinate>>} Coordinates.
* @return {Array.<Array.<module:ol/coordinate~Coordinate>>} Coordinates.
* @override
* @api
*/
@@ -254,7 +254,7 @@ MultiLineString.prototype.intersectsExtent = function(extent) {
/**
* Set the coordinates of the multilinestring.
* @param {Array.<Array.<ol.Coordinate>>} coordinates Coordinates.
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @override
* @api

View File

@@ -18,7 +18,7 @@ import {squaredDistance as squaredDx} from '../math.js';
*
* @constructor
* @extends {ol.geom.SimpleGeometry}
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api
*/
@@ -84,7 +84,7 @@ MultiPoint.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDis
/**
* Return the coordinates of the multipoint.
* @return {Array.<ol.Coordinate>} Coordinates.
* @return {Array.<module:ol/coordinate~Coordinate>} Coordinates.
* @override
* @api
*/
@@ -161,7 +161,7 @@ MultiPoint.prototype.intersectsExtent = function(extent) {
/**
* Set the coordinates of the multipoint.
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @override
* @api

View File

@@ -26,7 +26,7 @@ import {quantizeMultiArray} from '../geom/flat/simplify.js';
*
* @constructor
* @extends {ol.geom.SimpleGeometry}
* @param {Array.<Array.<Array.<ol.Coordinate>>>} coordinates Coordinates.
* @param {Array.<Array.<Array.<module:ol/coordinate~Coordinate>>>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api
*/
@@ -175,7 +175,7 @@ MultiPolygon.prototype.getArea = function() {
* (clockwise for exterior and counter-clockwise for interior rings).
* By default, coordinate orientation will depend on how the geometry was
* constructed.
* @return {Array.<Array.<Array.<ol.Coordinate>>>} Coordinates.
* @return {Array.<Array.<Array.<module:ol/coordinate~Coordinate>>>} Coordinates.
* @override
* @api
*/
@@ -351,7 +351,7 @@ MultiPolygon.prototype.intersectsExtent = function(extent) {
/**
* Set the coordinates of the multipolygon.
* @param {Array.<Array.<Array.<ol.Coordinate>>>} coordinates Coordinates.
* @param {Array.<Array.<Array.<module:ol/coordinate~Coordinate>>>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @override
* @api

View File

@@ -15,7 +15,7 @@ import {squaredDistance as squaredDx} from '../math.js';
*
* @constructor
* @extends {ol.geom.SimpleGeometry}
* @param {ol.Coordinate} coordinates Coordinates.
* @param {module:ol/coordinate~Coordinate} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api
*/
@@ -61,7 +61,7 @@ Point.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance
/**
* Return the coordinate of the point.
* @return {ol.Coordinate} Coordinates.
* @return {module:ol/coordinate~Coordinate} Coordinates.
* @override
* @api
*/

View File

@@ -27,7 +27,7 @@ import {modulo} from '../math.js';
*
* @constructor
* @extends {ol.geom.SimpleGeometry}
* @param {Array.<Array.<ol.Coordinate>>} coordinates Array of linear
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} coordinates Array of linear
* rings that define the polygon. The first linear ring of the array
* defines the outer-boundary or surface of the polygon. Each subsequent
* linear ring defines a hole in the surface of the polygon. A linear ring
@@ -54,7 +54,7 @@ const Polygon = function(coordinates, opt_layout) {
/**
* @private
* @type {ol.Coordinate}
* @type {module:ol/coordinate~Coordinate}
*/
this.flatInteriorPoint_ = null;
@@ -165,7 +165,7 @@ Polygon.prototype.getArea = function() {
* (clockwise for exterior and counter-clockwise for interior rings).
* By default, coordinate orientation will depend on how the geometry was
* constructed.
* @return {Array.<Array.<ol.Coordinate>>} Coordinates.
* @return {Array.<Array.<module:ol/coordinate~Coordinate>>} Coordinates.
* @override
* @api
*/
@@ -332,7 +332,7 @@ Polygon.prototype.intersectsExtent = function(extent) {
/**
* Set the coordinates of the polygon.
* @param {Array.<Array.<ol.Coordinate>>} coordinates Coordinates.
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @override
* @api
@@ -369,7 +369,7 @@ export default Polygon;
/**
* Create an approximation of a circle on the surface of a sphere.
* @param {ol.Coordinate} center Center (`[lon, lat]` in degrees).
* @param {module:ol/coordinate~Coordinate} center Center (`[lon, lat]` in degrees).
* @param {number} radius The great-circle distance from the center to
* the polygon vertices.
* @param {number=} opt_n Optional number of vertices for the resulting
@@ -395,7 +395,7 @@ export function circular(center, radius, opt_n, opt_sphereRadius) {
/**
* Create a polygon from an extent. The layout used is `XY`.
* @param {ol.Extent} extent The extent.
* @param {module:ol/extent~Extent} extent The extent.
* @return {ol.geom.Polygon} The polygon.
* @api
*/
@@ -442,7 +442,7 @@ export function fromCircle(circle, opt_sides, opt_angle) {
/**
* Modify the coordinates of a polygon to make it a regular polygon.
* @param {ol.geom.Polygon} polygon Polygon geometry.
* @param {ol.Coordinate} center Center of the regular polygon.
* @param {module:ol/coordinate~Coordinate} center Center of the regular polygon.
* @param {number} radius Radius of the regular polygon.
* @param {number=} opt_angle Start angle for the first vertex of the polygon in
* radians. Default is 0.

View File

@@ -104,7 +104,7 @@ SimpleGeometry.prototype.getCoordinates = function() {};
/**
* Return the first coordinate of the geometry.
* @return {ol.Coordinate} First coordinate.
* @return {module:ol/coordinate~Coordinate} First coordinate.
* @api
*/
SimpleGeometry.prototype.getFirstCoordinate = function() {
@@ -122,7 +122,7 @@ SimpleGeometry.prototype.getFlatCoordinates = function() {
/**
* Return the last coordinate of the geometry.
* @return {ol.Coordinate} Last point.
* @return {module:ol/coordinate~Coordinate} Last point.
* @api
*/
SimpleGeometry.prototype.getLastCoordinate = function() {
@@ -317,7 +317,7 @@ SimpleGeometry.prototype.translate = function(deltaX, deltaY) {
/**
* @param {ol.geom.SimpleGeometry} simpleGeometry Simple geometry.
* @param {ol.Transform} transform Transform.
* @param {module:ol/transform~Transform} transform Transform.
* @param {Array.<number>=} opt_dest Destination.
* @return {Array.<number>} Transformed flat coordinates.
*/

View File

@@ -9,13 +9,13 @@ import {forEachCorner} from '../../extent.js';
* @param {number} offset Offset.
* @param {number} end End.
* @param {number} stride Stride.
* @param {ol.Extent} extent Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @return {boolean} Contains extent.
*/
export function linearRingContainsExtent(flatCoordinates, offset, end, stride, extent) {
const outside = forEachCorner(extent,
/**
* @param {ol.Coordinate} coordinate Coordinate.
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
* @return {boolean} Contains (x, y).
*/
function(coordinate) {

View File

@@ -6,7 +6,7 @@
/**
* @param {Array.<number>} flatCoordinates Flat coordinates.
* @param {number} offset Offset.
* @param {ol.Coordinate} coordinate Coordinate.
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
* @param {number} stride Stride.
* @return {number} offset Offset.
*/
@@ -21,7 +21,7 @@ export function deflateCoordinate(flatCoordinates, offset, coordinate, stride) {
/**
* @param {Array.<number>} flatCoordinates Flat coordinates.
* @param {number} offset Offset.
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
* @param {number} stride Stride.
* @return {number} offset Offset.
*/
@@ -39,7 +39,7 @@ export function deflateCoordinates(flatCoordinates, offset, coordinates, stride)
/**
* @param {Array.<number>} flatCoordinates Flat coordinates.
* @param {number} offset Offset.
* @param {Array.<Array.<ol.Coordinate>>} coordinatess Coordinatess.
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} coordinatess Coordinatess.
* @param {number} stride Stride.
* @param {Array.<number>=} opt_ends Ends.
* @return {Array.<number>} Ends.
@@ -61,7 +61,7 @@ export function deflateCoordinatesArray(flatCoordinates, offset, coordinatess, s
/**
* @param {Array.<number>} flatCoordinates Flat coordinates.
* @param {number} offset Offset.
* @param {Array.<Array.<Array.<ol.Coordinate>>>} coordinatesss Coordinatesss.
* @param {Array.<Array.<Array.<module:ol/coordinate~Coordinate>>>} coordinatesss Coordinatesss.
* @param {number} stride Stride.
* @param {Array.<Array.<number>>=} opt_endss Endss.
* @return {Array.<Array.<number>>} Endss.

View File

@@ -6,8 +6,8 @@ import {get as getProjection, getTransform} from '../../proj.js';
/**
* @param {function(number): ol.Coordinate} interpolate Interpolate function.
* @param {ol.TransformFunction} transform Transform from longitude/latitude to
* @param {function(number): module:ol/coordinate~Coordinate} interpolate Interpolate function.
* @param {module:ol/proj~TransformFunction} transform Transform from longitude/latitude to
* projected coordinates.
* @param {number} squaredTolerance Squared tolerance.
* @return {Array.<number>} Flat coordinates.
@@ -25,9 +25,9 @@ function line(interpolate, transform, squaredTolerance) {
let a = transform(geoA);
let b = transform(geoB);
/** @type {Array.<ol.Coordinate>} */
/** @type {Array.<module:ol/coordinate~Coordinate>} */
const geoStack = [geoB, geoA];
/** @type {Array.<ol.Coordinate>} */
/** @type {Array.<module:ol/coordinate~Coordinate>} */
const stack = [b, a];
/** @type {Array.<number>} */
const fractionStack = [1, 0];
@@ -102,7 +102,7 @@ export function greatCircleArc(lon1, lat1, lon2, lat2, projection, squaredTolera
return line(
/**
* @param {number} frac Fraction.
* @return {ol.Coordinate} Coordinate.
* @return {module:ol/coordinate~Coordinate} Coordinate.
*/
function(frac) {
if (1 <= d) {
@@ -137,7 +137,7 @@ export function meridian(lon, lat1, lat2, projection, squaredTolerance) {
return line(
/**
* @param {number} frac Fraction.
* @return {ol.Coordinate} Coordinate.
* @return {module:ol/coordinate~Coordinate} Coordinate.
*/
function(frac) {
return [lon, lat1 + ((lat2 - lat1) * frac)];
@@ -160,7 +160,7 @@ export function parallel(lat, lon1, lon2, projection, squaredTolerance) {
return line(
/**
* @param {number} frac Fraction.
* @return {ol.Coordinate} Coordinate.
* @return {module:ol/coordinate~Coordinate} Coordinate.
*/
function(frac) {
return [lon1 + ((lon2 - lon1) * frac), lat];

View File

@@ -8,8 +8,8 @@
* @param {number} offset Offset.
* @param {number} end End.
* @param {number} stride Stride.
* @param {Array.<ol.Coordinate>=} opt_coordinates Coordinates.
* @return {Array.<ol.Coordinate>} Coordinates.
* @param {Array.<module:ol/coordinate~Coordinate>=} opt_coordinates Coordinates.
* @return {Array.<module:ol/coordinate~Coordinate>} Coordinates.
*/
export function inflateCoordinates(flatCoordinates, offset, end, stride, opt_coordinates) {
const coordinates = opt_coordinates !== undefined ? opt_coordinates : [];
@@ -27,8 +27,8 @@ export function inflateCoordinates(flatCoordinates, offset, end, stride, opt_coo
* @param {number} offset Offset.
* @param {Array.<number>} ends Ends.
* @param {number} stride Stride.
* @param {Array.<Array.<ol.Coordinate>>=} opt_coordinatess Coordinatess.
* @return {Array.<Array.<ol.Coordinate>>} Coordinatess.
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>=} opt_coordinatess Coordinatess.
* @return {Array.<Array.<module:ol/coordinate~Coordinate>>} Coordinatess.
*/
export function inflateCoordinatesArray(flatCoordinates, offset, ends, stride, opt_coordinatess) {
const coordinatess = opt_coordinatess !== undefined ? opt_coordinatess : [];
@@ -49,9 +49,9 @@ export function inflateCoordinatesArray(flatCoordinates, offset, ends, stride, o
* @param {number} offset Offset.
* @param {Array.<Array.<number>>} endss Endss.
* @param {number} stride Stride.
* @param {Array.<Array.<Array.<ol.Coordinate>>>=} opt_coordinatesss
* @param {Array.<Array.<Array.<module:ol/coordinate~Coordinate>>>=} opt_coordinatesss
* Coordinatesss.
* @return {Array.<Array.<Array.<ol.Coordinate>>>} Coordinatesss.
* @return {Array.<Array.<Array.<module:ol/coordinate~Coordinate>>>} Coordinatesss.
*/
export function inflateMultiCoordinatesArray(flatCoordinates, offset, endss, stride, opt_coordinatesss) {
const coordinatesss = opt_coordinatesss !== undefined ? opt_coordinatesss : [];

View File

@@ -71,7 +71,7 @@ export function interpolatePoint(flatCoordinates, offset, end, stride, fraction,
* @param {number} stride Stride.
* @param {number} m M.
* @param {boolean} extrapolate Extrapolate.
* @return {ol.Coordinate} Coordinate.
* @return {module:ol/coordinate~Coordinate} Coordinate.
*/
export function lineStringCoordinateAtM(flatCoordinates, offset, end, stride, m, extrapolate) {
if (end == offset) {
@@ -133,7 +133,7 @@ export function lineStringCoordinateAtM(flatCoordinates, offset, end, stride, m,
* @param {number} m M.
* @param {boolean} extrapolate Extrapolate.
* @param {boolean} interpolate Interpolate.
* @return {ol.Coordinate} Coordinate.
* @return {module:ol/coordinate~Coordinate} Coordinate.
*/
export function lineStringsCoordinateAtM(
flatCoordinates, offset, ends, stride, m, extrapolate, interpolate) {

View File

@@ -11,7 +11,7 @@ import {forEach as forEachSegment} from '../flat/segments.js';
* @param {number} offset Offset.
* @param {number} end End.
* @param {number} stride Stride.
* @param {ol.Extent} extent Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @return {boolean} True if the geometry and the extent intersect.
*/
export function intersectsLineString(flatCoordinates, offset, end, stride, extent) {
@@ -33,8 +33,8 @@ export function intersectsLineString(flatCoordinates, offset, end, stride, exten
}
return forEachSegment(flatCoordinates, offset, end, stride,
/**
* @param {ol.Coordinate} point1 Start point.
* @param {ol.Coordinate} point2 End point.
* @param {module:ol/coordinate~Coordinate} point1 Start point.
* @param {module:ol/coordinate~Coordinate} point2 End point.
* @return {boolean} `true` if the segment and the extent intersect,
* `false` otherwise.
*/
@@ -49,7 +49,7 @@ export function intersectsLineString(flatCoordinates, offset, end, stride, exten
* @param {number} offset Offset.
* @param {Array.<number>} ends Ends.
* @param {number} stride Stride.
* @param {ol.Extent} extent Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @return {boolean} True if the geometry and the extent intersect.
*/
export function intersectsLineStringArray(flatCoordinates, offset, ends, stride, extent) {
@@ -69,7 +69,7 @@ export function intersectsLineStringArray(flatCoordinates, offset, ends, stride,
* @param {number} offset Offset.
* @param {number} end End.
* @param {number} stride Stride.
* @param {ol.Extent} extent Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @return {boolean} True if the geometry and the extent intersect.
*/
export function intersectsLinearRing(flatCoordinates, offset, end, stride, extent) {
@@ -98,7 +98,7 @@ export function intersectsLinearRing(flatCoordinates, offset, end, stride, exten
* @param {number} offset Offset.
* @param {Array.<number>} ends Ends.
* @param {number} stride Stride.
* @param {ol.Extent} extent Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @return {boolean} True if the geometry and the extent intersect.
*/
export function intersectsLinearRingArray(flatCoordinates, offset, ends, stride, extent) {
@@ -123,7 +123,7 @@ export function intersectsLinearRingArray(flatCoordinates, offset, ends, stride,
* @param {number} offset Offset.
* @param {Array.<Array.<number>>} endss Endss.
* @param {number} stride Stride.
* @param {ol.Extent} extent Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @return {boolean} True if the geometry and the extent intersect.
*/
export function intersectsLinearRingMultiArray(flatCoordinates, offset, endss, stride, extent) {

View File

@@ -11,7 +11,7 @@
* @param {number} offset Offset.
* @param {number} end End.
* @param {number} stride Stride.
* @param {function(this: S, ol.Coordinate, ol.Coordinate): T} callback Function
* @param {function(this: S, module:ol/coordinate~Coordinate, module:ol/coordinate~Coordinate): T} callback Function
* called for each segment.
* @param {S=} opt_this The object to be used as the value of 'this'
* within callback.

View File

@@ -8,7 +8,7 @@
* @param {number} offset Offset.
* @param {number} end End.
* @param {number} stride Stride.
* @param {ol.Transform} transform Transform.
* @param {module:ol/transform~Transform} transform Transform.
* @param {Array.<number>=} opt_dest Destination.
* @return {Array.<number>} Transformed coordinates.
*/

View File

@@ -1,3 +0,0 @@
/**
* @namespace ol.has
*/

View File

@@ -5,6 +5,14 @@
import {getContext} from './webgl.js';
/**
* An array with two elements, representing a pixel. The first element is the
* x-coordinate, the second the y-coordinate of the pixel.
* @typedef {Array.<number>} Pixel
* @api
*/
/**
* Include debuggable shader sources. Default is `true`. This should be set to
* `false` for production builds.

View File

@@ -14,27 +14,51 @@ import PinchRotate from './interaction/PinchRotate.js';
import PinchZoom from './interaction/PinchZoom.js';
/**
* @typedef {Object} DefaultsOptions
* @property {boolean} [altShiftDragRotate=true] Whether Alt-Shift-drag rotate is
* desired.
* @property {boolean} [constrainResolution=false] Zoom to the closest integer
* zoom level after the wheel/trackpad or pinch gesture ends.
* @property {boolean} [doubleClickZoom=true] Whether double click zoom is
* desired.
* @property {boolean} [keyboard=true] Whether keyboard interaction is desired.
* @property {boolean} [mouseWheelZoom=true] Whether mousewheel zoom is desired.
* @property {boolean} [shiftDragZoom=true] Whether Shift-drag zoom is desired.
* @property {boolean} [dragPan=true] Whether drag pan is desired.
* @property {boolean} [pinchRotate=true] Whether pinch rotate is desired.
* @property {boolean} [pinchZoom=true] Whether pinch zoom is desired.
* @property {number} [zoomDelta] Zoom level delta when using keyboard or
* mousewheel zoom.
* @property {number} [zoomDuration] Duration of the zoom animation in
* milliseconds.
*/
/**
* Set of interactions included in maps by default. Specific interactions can be
* excluded by setting the appropriate option to false in the constructor
* options, but the order of the interactions is fixed. If you want to specify
* a different order for interactions, you will need to create your own
* {@link ol.interaction.Interaction} instances and insert them into a
* {@link ol.Collection} in the order you want before creating your
* {@link ol.Map} instance. The default set of interactions, in sequence, is:
* * {@link ol.interaction.DragRotate}
* * {@link ol.interaction.DoubleClickZoom}
* * {@link ol.interaction.DragPan}
* * {@link ol.interaction.PinchRotate}
* * {@link ol.interaction.PinchZoom}
* * {@link ol.interaction.KeyboardPan}
* * {@link ol.interaction.KeyboardZoom}
* * {@link ol.interaction.MouseWheelZoom}
* * {@link ol.interaction.DragZoom}
* {@link module:ol/interaction/Interaction~Interaction} instances and insert
* them into a {@link module:ol/Collection~Collection} in the order you want
* before creating your {@link module:ol/Map~Map} instance. The default set of
* interactions, in sequence, is:
* * {@link module:ol/interaction/DragRotate~DragRotate}
* * {@link module:ol/interaction/DoubleClickZoom~DoubleClickZoom}
* * {@link module:ol/interaction/DragPan~DragPan}
* * {@link module:ol/interaction/PinchRotate~PinchRotate}
* * {@link module:ol/interaction/PinchZoom~PinchZoom}
* * {@link module:ol/interaction/KeyboardPan~KeyboardPan}
* * {@link module:ol/interaction/KeyboardZoom~KeyboardZoom}
* * {@link module:ol/interaction/MouseWheelZoom~MouseWheelZoom}
* * {@link module:ol/interaction/DragZoom~DragZoom}
*
* @param {olx.interaction.DefaultsOptions=} opt_options Defaults options.
* @return {ol.Collection.<ol.interaction.Interaction>} A collection of
* interactions to be used with the ol.Map constructor's interactions option.
* @param {module:ol/interaction/Interaction~DefaultsOptions=} opt_options
* Defaults options.
* @return {module:ol/Collection~Collection.<module:ol/interaction/Interaction~Interaction>}
* A collection of interactions to be used with the {@link module:ol/Map~Map}
* constructor's `interactions` option.
* @api
*/
export function defaults(opt_options) {

View File

@@ -101,7 +101,7 @@ const DragAndDrop = function(opt_options) {
/**
* @private
* @type {Array.<ol.EventsKey>}
* @type {Array.<module:ol/events~EventsKey>}
*/
this.dropListenKeys_ = null;

View File

@@ -43,7 +43,7 @@ const DragBoxEventType = {
* this type.
*
* @param {string} type The event type.
* @param {ol.Coordinate} coordinate The event coordinate.
* @param {module:ol/coordinate~Coordinate} coordinate The event coordinate.
* @param {ol.MapBrowserEvent} mapBrowserEvent Originating event.
* @extends {ol.events.Event}
* @constructor
@@ -55,7 +55,7 @@ const DragBoxEvent = function(type, coordinate, mapBrowserEvent) {
/**
* The coordinate of the drag event.
* @const
* @type {ol.Coordinate}
* @type {module:ol/coordinate~Coordinate}
* @api
*/
this.coordinate = coordinate;
@@ -112,7 +112,7 @@ const DragBox = function(opt_options) {
this.minArea_ = options.minArea !== undefined ? options.minArea : 64;
/**
* @type {ol.Pixel}
* @type {module:ol~Pixel}
* @private
*/
this.startPixel_ = null;
@@ -139,8 +139,8 @@ inherits(DragBox, PointerInteraction);
* should fire.
* @param {ol.MapBrowserEvent} mapBrowserEvent The originating MapBrowserEvent
* leading to the box end.
* @param {ol.Pixel} startPixel The starting pixel of the box.
* @param {ol.Pixel} endPixel The end pixel of the box.
* @param {module:ol~Pixel} startPixel The starting pixel of the box.
* @param {module:ol~Pixel} endPixel The end pixel of the box.
* @return {boolean} Whether or not the boxend condition should be fired.
* @this {ol.interaction.DragBox}
*/

View File

@@ -35,7 +35,7 @@ const DragPan = function(opt_options) {
this.kinetic_ = options.kinetic;
/**
* @type {ol.Pixel}
* @type {module:ol~Pixel}
*/
this.lastCentroid = null;
@@ -106,7 +106,7 @@ function handleUpEvent(mapBrowserEvent) {
if (!this.noKinetic_ && this.kinetic_ && this.kinetic_.end()) {
const distance = this.kinetic_.getDistance();
const angle = this.kinetic_.getAngle();
const center = /** @type {!ol.Coordinate} */ (view.getCenter());
const center = /** @type {!module:ol/coordinate~Coordinate} */ (view.getCenter());
const centerpx = map.getPixelFromCoordinate(center);
const dest = map.getCoordinateFromPixel([
centerpx[0] - distance * Math.cos(angle),

View File

@@ -56,7 +56,7 @@ DragZoom.prototype.onBoxEnd = function() {
const view = /** @type {!ol.View} */ (map.getView());
const size = /** @type {!ol.Size} */ (map.getSize());
const size = /** @type {!module:ol/size~Size} */ (map.getSize());
let extent = this.getGeometry().getExtent();

View File

@@ -113,7 +113,7 @@ const Draw = function(options) {
this.shouldHandle_ = false;
/**
* @type {ol.Pixel}
* @type {module:ol~Pixel}
* @private
*/
this.downPx_ = null;
@@ -209,7 +209,7 @@ const Draw = function(options) {
if (!geometryFunction) {
if (this.type_ === GeometryType.CIRCLE) {
/**
* @param {!Array.<ol.Coordinate>} coordinates
* @param {!Array.<module:ol/coordinate~Coordinate>} coordinates
* The coordinates.
* @param {ol.geom.SimpleGeometry=} opt_geometry Optional geometry.
* @return {ol.geom.SimpleGeometry} A geometry.
@@ -233,7 +233,7 @@ const Draw = function(options) {
Constructor = Polygon;
}
/**
* @param {!Array.<ol.Coordinate>} coordinates
* @param {!Array.<module:ol/coordinate~Coordinate>} coordinates
* The coordinates.
* @param {ol.geom.SimpleGeometry=} opt_geometry Optional geometry.
* @return {ol.geom.SimpleGeometry} A geometry.
@@ -274,7 +274,7 @@ const Draw = function(options) {
/**
* Finish coordinate for the feature (first point for polygons, last point for
* linestrings).
* @type {ol.Coordinate}
* @type {module:ol/coordinate~Coordinate}
* @private
*/
this.finishCoordinate_ = null;
@@ -295,7 +295,7 @@ const Draw = function(options) {
/**
* Sketch coordinates. Used when drawing a line or polygon.
* @type {ol.Coordinate|Array.<ol.Coordinate>|Array.<Array.<ol.Coordinate>>}
* @type {module:ol/coordinate~Coordinate|Array.<module:ol/coordinate~Coordinate>|Array.<Array.<module:ol/coordinate~Coordinate>>}
* @private
*/
this.sketchCoords_ = null;
@@ -309,7 +309,7 @@ const Draw = function(options) {
/**
* Sketch line coordinates. Used when drawing a polygon or circle.
* @type {Array.<ol.Coordinate>}
* @type {Array.<module:ol/coordinate~Coordinate>}
* @private
*/
this.sketchLineCoords_ = null;
@@ -374,7 +374,7 @@ inherits(Draw, PointerInteraction);
/**
* @return {ol.StyleFunction} Styles.
* @return {module:ol/style~StyleFunction} Styles.
*/
function getDefaultStyleFunction() {
const styles = createEditingStyle();
@@ -662,7 +662,7 @@ Draw.prototype.modifyDrawing_ = function(event) {
}
last[0] = coordinate[0];
last[1] = coordinate[1];
this.geometryFunction_(/** @type {!Array.<ol.Coordinate>} */ (this.sketchCoords_), geometry);
this.geometryFunction_(/** @type {!Array.<module:ol/coordinate~Coordinate>} */ (this.sketchCoords_), geometry);
if (this.sketchPoint_) {
const sketchPointGeom = /** @type {ol.geom.Point} */ (this.sketchPoint_.getGeometry());
sketchPointGeom.setCoordinates(coordinate);

View File

@@ -25,7 +25,7 @@ import {createEditingStyle} from '../style/Style.js';
*
* @constructor
* @implements {oli.ExtentEvent}
* @param {ol.Extent} extent the new extent
* @param {module:ol/extent~Extent} extent the new extent
* @extends {ol.events.Event}
*/
const ExtentInteractionEvent = function(extent) {
@@ -33,7 +33,7 @@ const ExtentInteractionEvent = function(extent) {
/**
* The current extent.
* @type {ol.Extent}
* @type {module:ol/extent~Extent}
* @api
*/
this.extent = extent;
@@ -60,14 +60,14 @@ const ExtentInteraction = function(opt_options) {
/**
* Extent of the drawn box
* @type {ol.Extent}
* @type {module:ol/extent~Extent}
* @private
*/
this.extent_ = null;
/**
* Handler for pointer move events
* @type {function (ol.Coordinate): ol.Extent|null}
* @type {function (module:ol/coordinate~Coordinate): module:ol/extent~Extent|null}
* @private
*/
this.pointerHandler_ = null;
@@ -260,7 +260,7 @@ function handleUpEvent(mapBrowserEvent) {
/**
* Returns the default style for the drawn bbox
*
* @return {ol.StyleFunction} Default Extent style
* @return {module:ol/style~StyleFunction} Default Extent style
*/
function getDefaultExtentStyleFunction() {
const style = createEditingStyle();
@@ -272,7 +272,7 @@ function getDefaultExtentStyleFunction() {
/**
* Returns the default style for the pointer
*
* @return {ol.StyleFunction} Default pointer style
* @return {module:ol/style~StyleFunction} Default pointer style
*/
function getDefaultPointerStyleFunction() {
const style = createEditingStyle();
@@ -282,8 +282,8 @@ function getDefaultPointerStyleFunction() {
}
/**
* @param {ol.Coordinate} fixedPoint corner that will be unchanged in the new extent
* @returns {function (ol.Coordinate): ol.Extent} event handler
* @param {module:ol/coordinate~Coordinate} fixedPoint corner that will be unchanged in the new extent
* @returns {function (module:ol/coordinate~Coordinate): module:ol/extent~Extent} event handler
*/
function getPointHandler(fixedPoint) {
return function(point) {
@@ -292,9 +292,9 @@ function getPointHandler(fixedPoint) {
}
/**
* @param {ol.Coordinate} fixedP1 first corner that will be unchanged in the new extent
* @param {ol.Coordinate} fixedP2 second corner that will be unchanged in the new extent
* @returns {function (ol.Coordinate): ol.Extent|null} event handler
* @param {module:ol/coordinate~Coordinate} fixedP1 first corner that will be unchanged in the new extent
* @param {module:ol/coordinate~Coordinate} fixedP2 second corner that will be unchanged in the new extent
* @returns {function (module:ol/coordinate~Coordinate): module:ol/extent~Extent|null} event handler
*/
function getEdgeHandler(fixedP1, fixedP2) {
if (fixedP1[0] == fixedP2[0]) {
@@ -311,8 +311,8 @@ function getEdgeHandler(fixedP1, fixedP2) {
}
/**
* @param {ol.Extent} extent extent
* @returns {Array<Array<ol.Coordinate>>} extent line segments
* @param {module:ol/extent~Extent} extent extent
* @returns {Array<Array<module:ol/coordinate~Coordinate>>} extent line segments
*/
function getSegments(extent) {
return [
@@ -324,9 +324,9 @@ function getSegments(extent) {
}
/**
* @param {ol.Pixel} pixel cursor location
* @param {module:ol~Pixel} pixel cursor location
* @param {ol.PluggableMap} map map
* @returns {ol.Coordinate|null} snapped vertex on extent
* @returns {module:ol/coordinate~Coordinate|null} snapped vertex on extent
* @private
*/
ExtentInteraction.prototype.snapToVertex_ = function(pixel, map) {
@@ -381,7 +381,7 @@ ExtentInteraction.prototype.handlePointerMove_ = function(mapBrowserEvent) {
};
/**
* @param {ol.Extent} extent extent
* @param {module:ol/extent~Extent} extent extent
* @returns {ol.Feature} extent as featrue
* @private
*/
@@ -408,7 +408,7 @@ ExtentInteraction.prototype.createOrUpdateExtentFeature_ = function(extent) {
/**
* @param {ol.Coordinate} vertex location of feature
* @param {module:ol/coordinate~Coordinate} vertex location of feature
* @returns {ol.Feature} vertex as feature
* @private
*/
@@ -438,7 +438,7 @@ ExtentInteraction.prototype.setMap = function(map) {
/**
* Returns the current drawn extent in the view projection
*
* @return {ol.Extent} Drawn extent in the view projection.
* @return {module:ol/extent~Extent} Drawn extent in the view projection.
* @api
*/
ExtentInteraction.prototype.getExtent = function() {
@@ -448,7 +448,7 @@ ExtentInteraction.prototype.getExtent = function() {
/**
* Manually sets the drawn extent, using the view projection.
*
* @param {ol.Extent} extent Extent
* @param {module:ol/extent~Extent} extent Extent
* @api
*/
ExtentInteraction.prototype.setExtent = function(extent) {

View File

@@ -103,7 +103,7 @@ Interaction.prototype.setMap = function(map) {
/**
* @param {module:ol/View~View} view View.
* @param {module:ol/types~Coordinate} delta Delta.
* @param {module:ol/coordinate~Coordinate} delta Delta.
* @param {number=} opt_duration Duration.
*/
export function pan(view, delta, opt_duration) {
@@ -127,7 +127,7 @@ export function pan(view, delta, opt_duration) {
/**
* @param {module:ol/View~View} view View.
* @param {number|undefined} rotation Rotation.
* @param {module:ol/types~Coordinate=} opt_anchor Anchor coordinate.
* @param {module:ol/coordinate~Coordinate=} opt_anchor Anchor coordinate.
* @param {number=} opt_duration Duration.
*/
export function rotate(view, rotation, opt_anchor, opt_duration) {
@@ -139,7 +139,7 @@ export function rotate(view, rotation, opt_anchor, opt_duration) {
/**
* @param {module:ol/View~View} view View.
* @param {number|undefined} rotation Rotation.
* @param {module:ol/types~Coordinate=} opt_anchor Anchor coordinate.
* @param {module:ol/coordinate~Coordinate=} opt_anchor Anchor coordinate.
* @param {number=} opt_duration Duration.
*/
export function rotateWithoutConstraints(view, rotation, opt_anchor, opt_duration) {
@@ -163,7 +163,7 @@ export function rotateWithoutConstraints(view, rotation, opt_anchor, opt_duratio
/**
* @param {module:ol/View~View} view View.
* @param {number|undefined} resolution Resolution to go to.
* @param {module:ol/types~Coordinate=} opt_anchor Anchor coordinate.
* @param {module:ol/coordinate~Coordinate=} opt_anchor Anchor coordinate.
* @param {number=} opt_duration Duration.
* @param {number=} opt_direction Zooming direction; > 0 indicates
* zooming out, in which case the constraints system will select
@@ -183,7 +183,7 @@ export function zoom(view, resolution, opt_anchor, opt_duration, opt_direction)
/**
* @param {module:ol/View~View} view View.
* @param {number} delta Delta from previous zoom level.
* @param {module:ol/types~Coordinate=} opt_anchor Anchor coordinate.
* @param {module:ol/coordinate~Coordinate=} opt_anchor Anchor coordinate.
* @param {number=} opt_duration Duration.
*/
export function zoomByDelta(view, delta, opt_anchor, opt_duration) {
@@ -221,7 +221,7 @@ export function zoomByDelta(view, delta, opt_anchor, opt_duration) {
/**
* @param {module:ol/View~View} view View.
* @param {number|undefined} resolution Resolution to go to.
* @param {module:ol/types~Coordinate=} opt_anchor Anchor coordinate.
* @param {module:ol/coordinate~Coordinate=} opt_anchor Anchor coordinate.
* @param {number=} opt_duration Duration.
*/
export function zoomWithoutConstraints(view, resolution, opt_anchor, opt_duration) {

View File

@@ -151,7 +151,7 @@ const Modify = function(options) {
this.vertexSegments_ = null;
/**
* @type {ol.Pixel}
* @type {module:ol~Pixel}
* @private
*/
this.lastPixel_ = [0, 0];
@@ -620,7 +620,7 @@ Modify.prototype.writeGeometryCollectionGeometry_ = function(feature, geometry)
/**
* @param {ol.Coordinate} coordinates Coordinates.
* @param {module:ol/coordinate~Coordinate} coordinates Coordinates.
* @return {ol.Feature} Vertex feature.
* @private
*/
@@ -876,7 +876,7 @@ Modify.prototype.handlePointerMove_ = function(evt) {
/**
* @param {ol.Pixel} pixel Pixel
* @param {module:ol~Pixel} pixel Pixel
* @param {ol.PluggableMap} map Map.
* @private
*/
@@ -946,7 +946,7 @@ Modify.prototype.handlePointerAtPixel_ = function(pixel, map) {
/**
* Returns the distance from a point to a line segment.
*
* @param {ol.Coordinate} pointCoordinates The coordinates of the point from
* @param {module:ol/coordinate~Coordinate} pointCoordinates The coordinates of the point from
* which to calculate the distance.
* @param {ol.ModifySegmentDataType} segmentData The object describing the line
* segment we are calculating the distance to.
@@ -972,11 +972,11 @@ function pointDistanceToSegmentDataSquared(pointCoordinates, segmentData) {
/**
* Returns the point closest to a given line segment.
*
* @param {ol.Coordinate} pointCoordinates The point to which a closest point
* @param {module:ol/coordinate~Coordinate} pointCoordinates The point to which a closest point
* should be found.
* @param {ol.ModifySegmentDataType} segmentData The object describing the line
* segment which should contain the closest point.
* @return {ol.Coordinate} The point closest to the specified line segment.
* @return {module:ol/coordinate~Coordinate} The point closest to the specified line segment.
*/
function closestOnSegmentData(pointCoordinates, segmentData) {
const geometry = segmentData.geometry;
@@ -991,7 +991,7 @@ function closestOnSegmentData(pointCoordinates, segmentData) {
/**
* @param {ol.ModifySegmentDataType} segmentData Segment data.
* @param {ol.Coordinate} vertex Vertex.
* @param {module:ol/coordinate~Coordinate} vertex Vertex.
* @private
*/
Modify.prototype.insertVertex_ = function(segmentData, vertex) {
@@ -1223,7 +1223,7 @@ Modify.prototype.updateSegmentIndices_ = function(
/**
* @return {ol.StyleFunction} Styles.
* @return {module:ol/style~StyleFunction} Styles.
*/
function getDefaultStyleFunction() {
const style = createEditingStyle();

View File

@@ -82,7 +82,7 @@ const MouseWheelZoom = function(opt_options) {
/**
* @private
* @type {?ol.Coordinate}
* @type {?module:ol/coordinate~Coordinate}
*/
this.lastAnchor_ = null;

View File

@@ -30,7 +30,7 @@ const PinchRotate = function(opt_options) {
/**
* @private
* @type {ol.Coordinate}
* @type {module:ol/coordinate~Coordinate}
*/
this.anchor_ = null;

View File

@@ -35,7 +35,7 @@ const PinchZoom = function(opt_options) {
/**
* @private
* @type {ol.Coordinate}
* @type {module:ol/coordinate~Coordinate}
*/
this.anchor_ = null;

View File

@@ -115,7 +115,7 @@ inherits(PointerInteraction, Interaction);
/**
* @param {Array.<ol.pointer.PointerEvent>} pointerEvents List of events.
* @return {ol.Pixel} Centroid pixel.
* @return {module:ol~Pixel} Centroid pixel.
*/
export function centroid(pointerEvents) {
const length = pointerEvents.length;

Some files were not shown because too many files have changed in this diff Show More