Compare commits

..

1 Commits

Author SHA1 Message Date
ahocevar
59c3eedbab Updates for v5.0.2 2018-07-05 00:04:32 +02:00
33 changed files with 109 additions and 108 deletions

View File

@@ -1,9 +1,8 @@
<!--
Thank you for your interest in making OpenLayers better! Thank you for your interest in making OpenLayers better!
If you are reporting a bug, please link to an example that reproduces the problem. This will make it easier for people who may want to help you debug. To keep this project manageable for maintainers, we ask you to please check all boxes below before submitting an issue.
If you have a usage question, you might want to try Stack Overflow first: https://stackoverflow.com/questions/tagged/openlayers - [ ] I am submitting a bug or feature request, not a usage question. Go to https://stackoverflow.com/questions/tagged/openlayers for questions.
- [ ] I have searched GitHub to see if a similar bug or feature request has already been reported.
Thanks - [ ] I have verified that the issue is present in the latest version of OpenLayers (see 'LATEST' on https://openlayers.org/).
--> - [ ] If reporting a bug, I have created a [CodePen](https://codepen.io) or prepared a stack trace (using the latest version and unminified code, so e.g. `ol-debug.js`, not `ol.js`) that shows the issue.

View File

@@ -1,13 +1,8 @@
<!--
Thank you for your interest in making OpenLayers better! Thank you for your interest in making OpenLayers better!
Before submitting a pull request, it is best to open an issue describing the bug you are fixing or the feature you are proposing to add. In order to get your proposed changes merged into the master branch, we ask you to please make sure the following boxes are checked *before* submitting your pull request.
Here are some other tips that make pull requests easier to review: - [ ] This pull request addresses an issue that has been marked with the 'Pull request accepted' label & I have added the link to that issue.
- [ ] It contains one or more small, incremental, logically separate commits, with no merge commits.
* Commits in the branch are small and logically separated (with no unnecessary merge commits). - [ ] I have used clear commit messages.
* Commit messages are clear. - [ ] Existing tests pass for me locally & I have added or updated tests for new or changed functionality.
* Existing tests pass, new functionality is covered by new tests, and fixes have regression tests.
Thanks
-->

7
changelog/v5.0.2.md Normal file
View File

@@ -0,0 +1,7 @@
# 5.0.2
The v5.0.1 release updates the package readme with new example projects.
## Fixes
* [#8332](https://github.com/openlayers/openlayers/pull/8343) - Starter projects ([@tschaub](https://github.com/tschaub))

View File

@@ -1,6 +1,6 @@
{ {
"name": "openlayers", "name": "openlayers",
"version": "5.0.1", "version": "5.0.2",
"description": "OpenLayers mapping library", "description": "OpenLayers mapping library",
"keywords": [ "keywords": [
"map", "map",
@@ -75,8 +75,8 @@
"mustache": "^2.3.0", "mustache": "^2.3.0",
"pixelmatch": "^4.0.2", "pixelmatch": "^4.0.2",
"proj4": "2.4.4", "proj4": "2.4.4",
"recast": "0.15.1", "recast": "0.15.0",
"rollup": "0.62.0", "rollup": "0.61.2",
"rollup-plugin-buble": "0.19.2", "rollup-plugin-buble": "0.19.2",
"rollup-plugin-commonjs": "9.1.3", "rollup-plugin-commonjs": "9.1.3",
"rollup-plugin-node-resolve": "3.3.0", "rollup-plugin-node-resolve": "3.3.0",
@@ -86,7 +86,7 @@
"uglifyjs-webpack-plugin": "^1.2.5", "uglifyjs-webpack-plugin": "^1.2.5",
"url-polyfill": "^1.0.13", "url-polyfill": "^1.0.13",
"walk": "^2.3.9", "walk": "^2.3.9",
"webpack": "4.14.0", "webpack": "4.12.1",
"webpack-cli": "^3.0.3", "webpack-cli": "^3.0.3",
"webpack-dev-server": "^3.1.4" "webpack-dev-server": "^3.1.4"
}, },

View File

@@ -50,7 +50,7 @@ const ImageWrapper = function(extent, resolution, pixelRatio, src, crossOrigin,
/** /**
* @private * @private
* @type {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} * @type {HTMLCanvasElement|Image|HTMLVideoElement}
*/ */
this.image_ = new Image(); this.image_ = new Image();
if (crossOrigin !== null) { if (crossOrigin !== null) {
@@ -139,7 +139,7 @@ ImageWrapper.prototype.load = function() {
/** /**
* @param {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} image Image. * @param {HTMLCanvasElement|Image|HTMLVideoElement} image Image.
*/ */
ImageWrapper.prototype.setImage = function(image) { ImageWrapper.prototype.setImage = function(image) {
this.image_ = image; this.image_ = image;

View File

@@ -65,7 +65,7 @@ ImageBase.prototype.getExtent = function() {
/** /**
* @abstract * @abstract
* @return {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} Image. * @return {HTMLCanvasElement|Image|HTMLVideoElement} Image.
*/ */
ImageBase.prototype.getImage = function() {}; ImageBase.prototype.getImage = function() {};

View File

@@ -44,7 +44,7 @@ const ImageTile = function(tileCoord, state, src, crossOrigin, tileLoadFunction,
/** /**
* @private * @private
* @type {HTMLImageElement|HTMLCanvasElement} * @type {Image|HTMLCanvasElement}
*/ */
this.image_ = new Image(); this.image_ = new Image();
if (crossOrigin !== null) { if (crossOrigin !== null) {

View File

@@ -15,7 +15,7 @@ import {containsExtent} from './extent.js';
* @typedef {Object} Options * @typedef {Object} Options
* @property {number|string} [id] Set the overlay id. The overlay id can be used * @property {number|string} [id] Set the overlay id. The overlay id can be used
* with the {@link module:ol/Map~Map#getOverlayById} method. * with the {@link module:ol/Map~Map#getOverlayById} method.
* @property {HTMLElement} [element] The overlay element. * @property {Element} [element] The overlay element.
* @property {Array.<number>} [offset=[0, 0]] Offsets in pixels used when positioning * @property {Array.<number>} [offset=[0, 0]] Offsets in pixels used when positioning
* the overlay. The first element in the * the overlay. The first element in the
* array is the horizontal offset. A positive value shifts the overlay right. * array is the horizontal offset. A positive value shifts the overlay right.
@@ -129,7 +129,7 @@ const Overlay = function(options) {
/** /**
* @protected * @protected
* @type {HTMLElement} * @type {Element}
*/ */
this.element = document.createElement('DIV'); this.element = document.createElement('DIV');
this.element.className = options.className !== undefined ? this.element.className = options.className !== undefined ?
@@ -218,12 +218,12 @@ inherits(Overlay, BaseObject);
/** /**
* Get the DOM element of this overlay. * Get the DOM element of this overlay.
* @return {HTMLElement|undefined} The Element containing the overlay. * @return {Element|undefined} The Element containing the overlay.
* @observable * @observable
* @api * @api
*/ */
Overlay.prototype.getElement = function() { Overlay.prototype.getElement = function() {
return /** @type {HTMLElement|undefined} */ (this.get(Property.ELEMENT)); return /** @type {Element|undefined} */ (this.get(Property.ELEMENT));
}; };
@@ -364,7 +364,7 @@ Overlay.prototype.handlePositioningChanged = function() {
/** /**
* Set the DOM element to be associated with this overlay. * Set the DOM element to be associated with this overlay.
* @param {HTMLElement|undefined} element The Element containing the overlay. * @param {Element|undefined} element The Element containing the overlay.
* @observable * @observable
* @api * @api
*/ */
@@ -422,7 +422,7 @@ Overlay.prototype.panIntoView = function() {
} }
const mapRect = this.getRect(map.getTargetElement(), map.getSize()); const mapRect = this.getRect(map.getTargetElement(), map.getSize());
const element = this.getElement(); const element = /** @type {!Element} */ (this.getElement());
const overlayRect = this.getRect(element, [outerWidth(element), outerHeight(element)]); const overlayRect = this.getRect(element, [outerWidth(element), outerHeight(element)]);
const margin = this.autoPanMargin; const margin = this.autoPanMargin;
@@ -469,7 +469,7 @@ Overlay.prototype.panIntoView = function() {
/** /**
* Get the extent of an element relative to the document * Get the extent of an element relative to the document
* @param {HTMLElement|undefined} element The element. * @param {Element|undefined} element The element.
* @param {module:ol/size~Size|undefined} size The size of the element. * @param {module:ol/size~Size|undefined} size The size of the element.
* @return {module:ol/extent~Extent} The extent. * @return {module:ol/extent~Extent} The extent.
* @protected * @protected

View File

@@ -76,7 +76,7 @@ import {create as createTransform, apply as applyTransform} from './transform.js
* @typedef {Object} MapOptionsInternal * @typedef {Object} MapOptionsInternal
* @property {module:ol/Collection.<module:ol/control/Control>} [controls] * @property {module:ol/Collection.<module:ol/control/Control>} [controls]
* @property {module:ol/Collection.<module:ol/interaction/Interaction>} [interactions] * @property {module:ol/Collection.<module:ol/interaction/Interaction>} [interactions]
* @property {HTMLElement|Document} keyboardEventTarget * @property {Element|Document} keyboardEventTarget
* @property {module:ol/Collection.<module:ol/Overlay>} overlays * @property {module:ol/Collection.<module:ol/Overlay>} overlays
* @property {Object.<string, *>} values * @property {Object.<string, *>} values
*/ */
@@ -93,7 +93,7 @@ import {create as createTransform, apply as applyTransform} from './transform.js
* @property {module:ol/Collection.<module:ol/interaction/Interaction>|Array.<module:ol/interaction/Interaction>} [interactions] * @property {module:ol/Collection.<module:ol/interaction/Interaction>|Array.<module:ol/interaction/Interaction>} [interactions]
* Interactions that are initially added to the map. If not specified, * Interactions that are initially added to the map. If not specified,
* {@link module:ol/interaction~defaults} is used. * {@link module:ol/interaction~defaults} is used.
* @property {HTMLElement|Document|string} [keyboardEventTarget] The element to * @property {Element|Document|string} [keyboardEventTarget] The element to
* listen to keyboard events on. This determines when the `KeyboardPan` and * listen to keyboard events on. This determines when the `KeyboardPan` and
* `KeyboardZoom` interactions trigger. For example, if this option is set to * `KeyboardZoom` interactions trigger. For example, if this option is set to
* `document` the keyboard interactions will always trigger. If this option is * `document` the keyboard interactions will always trigger. If this option is
@@ -120,7 +120,7 @@ import {create as createTransform, apply as applyTransform} from './transform.js
* Increasing this value can make it easier to click on the map. * Increasing this value can make it easier to click on the map.
* @property {module:ol/Collection.<module:ol/Overlay>|Array.<module:ol/Overlay>} [overlays] * @property {module:ol/Collection.<module:ol/Overlay>|Array.<module:ol/Overlay>} [overlays]
* Overlays initially added to the map. By default, no overlays are added. * Overlays initially added to the map. By default, no overlays are added.
* @property {HTMLElement|string} [target] The container for the map, either the * @property {Element|string} [target] The container for the map, either the
* element itself or the `id` of the element. If not specified at construction * element itself or the `id` of the element. If not specified at construction
* time, {@link module:ol/Map~Map#setTarget} must be called for the map to be * time, {@link module:ol/Map~Map#setTarget} must be called for the map to be
* rendered. * rendered.
@@ -240,7 +240,7 @@ const PluggableMap = function(options) {
/** /**
* @private * @private
* @type {!HTMLElement} * @type {Element}
*/ */
this.viewport_ = document.createElement('DIV'); this.viewport_ = document.createElement('DIV');
this.viewport_.className = 'ol-viewport' + (TOUCH ? ' ol-touch' : ''); this.viewport_.className = 'ol-viewport' + (TOUCH ? ' ol-touch' : '');
@@ -254,7 +254,7 @@ const PluggableMap = function(options) {
/** /**
* @private * @private
* @type {!HTMLElement} * @type {!Element}
*/ */
this.overlayContainer_ = document.createElement('DIV'); this.overlayContainer_ = document.createElement('DIV');
this.overlayContainer_.className = 'ol-overlaycontainer'; this.overlayContainer_.className = 'ol-overlaycontainer';
@@ -262,7 +262,7 @@ const PluggableMap = function(options) {
/** /**
* @private * @private
* @type {!HTMLElement} * @type {!Element}
*/ */
this.overlayContainerStopEvent_ = document.createElement('DIV'); this.overlayContainerStopEvent_ = document.createElement('DIV');
this.overlayContainerStopEvent_.className = 'ol-overlaycontainer-stopevent'; this.overlayContainerStopEvent_.className = 'ol-overlaycontainer-stopevent';
@@ -293,7 +293,7 @@ const PluggableMap = function(options) {
/** /**
* @private * @private
* @type {HTMLElement|Document} * @type {Element|Document}
*/ */
this.keyboardEventTarget_ = optionsInternal.keyboardEventTarget; this.keyboardEventTarget_ = optionsInternal.keyboardEventTarget;
@@ -685,13 +685,13 @@ PluggableMap.prototype.getEventPixel = function(event) {
* Get the target in which this map is rendered. * Get the target in which this map is rendered.
* Note that this returns what is entered as an option or in setTarget: * Note that this returns what is entered as an option or in setTarget:
* if that was an element, it returns an element; if a string, it returns that. * if that was an element, it returns an element; if a string, it returns that.
* @return {HTMLElement|string|undefined} The Element or id of the Element that the * @return {Element|string|undefined} The Element or id of the Element that the
* map is rendered in. * map is rendered in.
* @observable * @observable
* @api * @api
*/ */
PluggableMap.prototype.getTarget = function() { PluggableMap.prototype.getTarget = function() {
return /** @type {HTMLElement|string|undefined} */ (this.get(MapProperty.TARGET)); return /** @type {Element|string|undefined} */ (this.get(MapProperty.TARGET));
}; };
@@ -699,7 +699,7 @@ PluggableMap.prototype.getTarget = function() {
* Get the DOM element into which this map is rendered. In contrast to * Get the DOM element into which this map is rendered. In contrast to
* `getTarget` this method always return an `Element`, or `null` if the * `getTarget` this method always return an `Element`, or `null` if the
* map has no target. * map has no target.
* @return {HTMLElement} The element that the map is rendered in. * @return {Element} The element that the map is rendered in.
* @api * @api
*/ */
PluggableMap.prototype.getTargetElement = function() { PluggableMap.prototype.getTargetElement = function() {
@@ -857,7 +857,7 @@ PluggableMap.prototype.getView = function() {
/** /**
* Get the element that serves as the map viewport. * Get the element that serves as the map viewport.
* @return {HTMLElement} Viewport. * @return {Element} Viewport.
* @api * @api
*/ */
PluggableMap.prototype.getViewport = function() { PluggableMap.prototype.getViewport = function() {
@@ -870,7 +870,7 @@ PluggableMap.prototype.getViewport = function() {
* this container will let mousedown and touchstart events through to the map, * this container will let mousedown and touchstart events through to the map,
* so clicks and gestures on an overlay will trigger {@link module:ol/MapBrowserEvent~MapBrowserEvent} * so clicks and gestures on an overlay will trigger {@link module:ol/MapBrowserEvent~MapBrowserEvent}
* events. * events.
* @return {!HTMLElement} The map's overlay container. * @return {!Element} The map's overlay container.
*/ */
PluggableMap.prototype.getOverlayContainer = function() { PluggableMap.prototype.getOverlayContainer = function() {
return this.overlayContainer_; return this.overlayContainer_;
@@ -882,7 +882,7 @@ PluggableMap.prototype.getOverlayContainer = function() {
* event propagation. Elements added to this container won't let mousedown and * event propagation. Elements added to this container won't let mousedown and
* touchstart events through to the map, so clicks and gestures on an overlay * touchstart events through to the map, so clicks and gestures on an overlay
* don't trigger any {@link module:ol/MapBrowserEvent~MapBrowserEvent}. * don't trigger any {@link module:ol/MapBrowserEvent~MapBrowserEvent}.
* @return {!HTMLElement} The map's overlay container that stops events. * @return {!Element} The map's overlay container that stops events.
*/ */
PluggableMap.prototype.getOverlayContainerStopEvent = function() { PluggableMap.prototype.getOverlayContainerStopEvent = function() {
return this.overlayContainerStopEvent_; return this.overlayContainerStopEvent_;
@@ -1322,7 +1322,7 @@ PluggableMap.prototype.setSize = function(size) {
/** /**
* Set the target element to render this map into. * Set the target element to render this map into.
* @param {HTMLElement|string|undefined} target The Element or id of the Element * @param {Element|string|undefined} target The Element or id of the Element
* that the map is rendered in. * that the map is rendered in.
* @observable * @observable
* @api * @api
@@ -1398,7 +1398,7 @@ PluggableMap.prototype.unskipFeature = function(feature) {
function createOptionsInternal(options) { function createOptionsInternal(options) {
/** /**
* @type {HTMLElement|Document} * @type {Element|Document}
*/ */
let keyboardEventTarget = null; let keyboardEventTarget = null;
if (options.keyboardEventTarget !== undefined) { if (options.keyboardEventTarget !== undefined) {

View File

@@ -256,7 +256,7 @@ Attribution.prototype.updateElement_ = function(frameState) {
/** /**
* @param {MouseEvent} event The event to handle * @param {Event} event The event to handle
* @private * @private
*/ */
Attribution.prototype.handleClick_ = function(event) { Attribution.prototype.handleClick_ = function(event) {

View File

@@ -136,7 +136,7 @@ inherits(FullScreen, Control);
/** /**
* @param {MouseEvent} event The event to handle * @param {Event} event The event to handle
* @private * @private
*/ */
FullScreen.prototype.handleClick_ = function(event) { FullScreen.prototype.handleClick_ = function(event) {

View File

@@ -498,7 +498,7 @@ OverviewMap.prototype.calculateCoordinateRotate_ = function(
/** /**
* @param {MouseEvent} event The event to handle * @param {Event} event The event to handle
* @private * @private
*/ */
OverviewMap.prototype.handleClick_ = function(event) { OverviewMap.prototype.handleClick_ = function(event) {

View File

@@ -113,7 +113,7 @@ inherits(Rotate, Control);
/** /**
* @param {MouseEvent} event The event to handle * @param {Event} event The event to handle
* @private * @private
*/ */
Rotate.prototype.handleClick_ = function(event) { Rotate.prototype.handleClick_ = function(event) {

View File

@@ -72,14 +72,14 @@ const ScaleLine = function(opt_options) {
/** /**
* @private * @private
* @type {HTMLElement} * @type {Element}
*/ */
this.innerElement_ = document.createElement('DIV'); this.innerElement_ = document.createElement('DIV');
this.innerElement_.className = className + '-inner'; this.innerElement_.className = className + '-inner';
/** /**
* @private * @private
* @type {HTMLElement} * @type {Element}
*/ */
this.element_ = document.createElement('DIV'); this.element_ = document.createElement('DIV');
this.element_.className = className + ' ' + CLASS_UNSELECTABLE; this.element_.className = className + ' ' + CLASS_UNSELECTABLE;

View File

@@ -98,7 +98,7 @@ inherits(Zoom, Control);
/** /**
* @param {number} delta Zoom delta. * @param {number} delta Zoom delta.
* @param {MouseEvent} event The event to handle * @param {Event} event The event to handle
* @private * @private
*/ */
Zoom.prototype.handleClick_ = function(delta, event) { Zoom.prototype.handleClick_ = function(delta, event) {

View File

@@ -227,7 +227,7 @@ export function render(mapEvent) {
/** /**
* @param {MouseEvent} event The browser event to handle. * @param {Event} event The browser event to handle.
* @private * @private
*/ */
ZoomSlider.prototype.handleContainerClick_ = function(event) { ZoomSlider.prototype.handleContainerClick_ = function(event) {

View File

@@ -68,7 +68,7 @@ inherits(ZoomToExtent, Control);
/** /**
* @param {MouseEvent} event The event to handle * @param {Event} event The event to handle
* @private * @private
*/ */
ZoomToExtent.prototype.handleClick_ = function(event) { ZoomToExtent.prototype.handleClick_ = function(event) {

View File

@@ -25,7 +25,7 @@ export function createCanvasContext2D(opt_width, opt_height) {
* Get the current computed width for the given element including margin, * Get the current computed width for the given element including margin,
* padding and border. * padding and border.
* Equivalent to jQuery's `$(el).outerWidth(true)`. * Equivalent to jQuery's `$(el).outerWidth(true)`.
* @param {!HTMLElement} element Element. * @param {!Element} element Element.
* @return {number} The width. * @return {number} The width.
*/ */
export function outerWidth(element) { export function outerWidth(element) {
@@ -41,7 +41,7 @@ export function outerWidth(element) {
* Get the current computed height for the given element including margin, * Get the current computed height for the given element including margin,
* padding and border. * padding and border.
* Equivalent to jQuery's `$(el).outerHeight(true)`. * Equivalent to jQuery's `$(el).outerHeight(true)`.
* @param {!HTMLElement} element Element. * @param {!Element} element Element.
* @return {number} The height. * @return {number} The height.
*/ */
export function outerHeight(element) { export function outerHeight(element) {

View File

@@ -12,7 +12,7 @@ const NAMESPACE_URI = 'http://www.w3.org/1999/xlink';
/** /**
* @param {Node} node Node. * @param {Node} node Node.
* @return {string|undefined} href. * @return {boolean|undefined} Boolean.
*/ */
export function readHref(node) { export function readHref(node) {
return node.getAttributeNS(NAMESPACE_URI, 'href'); return node.getAttributeNS(NAMESPACE_URI, 'href');

View File

@@ -1,6 +1,6 @@
{ {
"name": "ol", "name": "ol",
"version": "5.0.1", "version": "5.0.2",
"description": "OpenLayers mapping library", "description": "OpenLayers mapping library",
"main": "index.js", "main": "index.js",
"module": "index.js", "module": "index.js",
@@ -11,4 +11,4 @@
"rbush": "2.0.2" "rbush": "2.0.2"
}, },
"sideEffects": "false" "sideEffects": "false"
} }

View File

@@ -106,7 +106,7 @@ const DEDUP_DIST = 25;
* or detect that the positions are invalid. * or detect that the positions are invalid.
* *
* @private * @private
* @param {MouseEvent} inEvent The in event. * @param {Event} inEvent The in event.
* @return {boolean} True, if the event was generated by a touch. * @return {boolean} True, if the event was generated by a touch.
*/ */
MouseSource.prototype.isEventSimulatedFromTouch_ = function(inEvent) { MouseSource.prototype.isEventSimulatedFromTouch_ = function(inEvent) {
@@ -154,7 +154,7 @@ function prepareEvent(inEvent, dispatcher) {
/** /**
* Handler for `mousedown`. * Handler for `mousedown`.
* *
* @param {MouseEvent} inEvent The in event. * @param {Event} inEvent The in event.
*/ */
MouseSource.prototype.mousedown = function(inEvent) { MouseSource.prototype.mousedown = function(inEvent) {
if (!this.isEventSimulatedFromTouch_(inEvent)) { if (!this.isEventSimulatedFromTouch_(inEvent)) {
@@ -173,7 +173,7 @@ MouseSource.prototype.mousedown = function(inEvent) {
/** /**
* Handler for `mousemove`. * Handler for `mousemove`.
* *
* @param {MouseEvent} inEvent The in event. * @param {Event} inEvent The in event.
*/ */
MouseSource.prototype.mousemove = function(inEvent) { MouseSource.prototype.mousemove = function(inEvent) {
if (!this.isEventSimulatedFromTouch_(inEvent)) { if (!this.isEventSimulatedFromTouch_(inEvent)) {
@@ -186,7 +186,7 @@ MouseSource.prototype.mousemove = function(inEvent) {
/** /**
* Handler for `mouseup`. * Handler for `mouseup`.
* *
* @param {MouseEvent} inEvent The in event. * @param {Event} inEvent The in event.
*/ */
MouseSource.prototype.mouseup = function(inEvent) { MouseSource.prototype.mouseup = function(inEvent) {
if (!this.isEventSimulatedFromTouch_(inEvent)) { if (!this.isEventSimulatedFromTouch_(inEvent)) {
@@ -204,7 +204,7 @@ MouseSource.prototype.mouseup = function(inEvent) {
/** /**
* Handler for `mouseover`. * Handler for `mouseover`.
* *
* @param {MouseEvent} inEvent The in event. * @param {Event} inEvent The in event.
*/ */
MouseSource.prototype.mouseover = function(inEvent) { MouseSource.prototype.mouseover = function(inEvent) {
if (!this.isEventSimulatedFromTouch_(inEvent)) { if (!this.isEventSimulatedFromTouch_(inEvent)) {
@@ -217,7 +217,7 @@ MouseSource.prototype.mouseover = function(inEvent) {
/** /**
* Handler for `mouseout`. * Handler for `mouseout`.
* *
* @param {MouseEvent} inEvent The in event. * @param {Event} inEvent The in event.
*/ */
MouseSource.prototype.mouseout = function(inEvent) { MouseSource.prototype.mouseout = function(inEvent) {
if (!this.isEventSimulatedFromTouch_(inEvent)) { if (!this.isEventSimulatedFromTouch_(inEvent)) {

View File

@@ -131,7 +131,7 @@ TouchSource.prototype.setPrimaryTouch_ = function(inTouch) {
/** /**
* @private * @private
* @param {PointerEvent} inPointer The in pointer object. * @param {Object} inPointer The in pointer object.
*/ */
TouchSource.prototype.removePrimaryPointer_ = function(inPointer) { TouchSource.prototype.removePrimaryPointer_ = function(inPointer) {
if (inPointer.isPrimary) { if (inPointer.isPrimary) {
@@ -172,9 +172,9 @@ TouchSource.prototype.cancelResetClickCount_ = function() {
/** /**
* @private * @private
* @param {TouchEvent} browserEvent Browser event * @param {Event} browserEvent Browser event
* @param {Touch} inTouch Touch event * @param {Touch} inTouch Touch event
* @return {PointerEvent} A pointer object. * @return {Object} A pointer object.
*/ */
TouchSource.prototype.touchToPointer_ = function(browserEvent, inTouch) { TouchSource.prototype.touchToPointer_ = function(browserEvent, inTouch) {
const e = this.dispatcher.cloneEvent(browserEvent, inTouch); const e = this.dispatcher.cloneEvent(browserEvent, inTouch);
@@ -208,8 +208,8 @@ TouchSource.prototype.touchToPointer_ = function(browserEvent, inTouch) {
/** /**
* @private * @private
* @param {TouchEvent} inEvent Touch event * @param {Event} inEvent Touch event
* @param {function(TouchEvent, PointerEvent)} inFunction In function. * @param {function(Event, Object)} inFunction In function.
*/ */
TouchSource.prototype.processTouches_ = function(inEvent, inFunction) { TouchSource.prototype.processTouches_ = function(inEvent, inFunction) {
const touches = Array.prototype.slice.call(inEvent.changedTouches); const touches = Array.prototype.slice.call(inEvent.changedTouches);
@@ -253,7 +253,7 @@ TouchSource.prototype.findTouch_ = function(touchList, searchId) {
* this "abandoned" touch * this "abandoned" touch
* *
* @private * @private
* @param {TouchEvent} inEvent The in event. * @param {Event} inEvent The in event.
*/ */
TouchSource.prototype.vacuumTouches_ = function(inEvent) { TouchSource.prototype.vacuumTouches_ = function(inEvent) {
const touchList = inEvent.touches; const touchList = inEvent.touches;
@@ -284,7 +284,7 @@ TouchSource.prototype.vacuumTouches_ = function(inEvent) {
* Handler for `touchstart`, triggers `pointerover`, * Handler for `touchstart`, triggers `pointerover`,
* `pointerenter` and `pointerdown` events. * `pointerenter` and `pointerdown` events.
* *
* @param {TouchEvent} inEvent The in event. * @param {Event} inEvent The in event.
*/ */
TouchSource.prototype.touchstart = function(inEvent) { TouchSource.prototype.touchstart = function(inEvent) {
this.vacuumTouches_(inEvent); this.vacuumTouches_(inEvent);
@@ -297,8 +297,8 @@ TouchSource.prototype.touchstart = function(inEvent) {
/** /**
* @private * @private
* @param {TouchEvent} browserEvent The event. * @param {Event} browserEvent The event.
* @param {PointerEvent} inPointer The in pointer object. * @param {Object} inPointer The in pointer object.
*/ */
TouchSource.prototype.overDown_ = function(browserEvent, inPointer) { TouchSource.prototype.overDown_ = function(browserEvent, inPointer) {
this.pointerMap[inPointer.pointerId] = { this.pointerMap[inPointer.pointerId] = {
@@ -315,7 +315,7 @@ TouchSource.prototype.overDown_ = function(browserEvent, inPointer) {
/** /**
* Handler for `touchmove`. * Handler for `touchmove`.
* *
* @param {TouchEvent} inEvent The in event. * @param {Event} inEvent The in event.
*/ */
TouchSource.prototype.touchmove = function(inEvent) { TouchSource.prototype.touchmove = function(inEvent) {
inEvent.preventDefault(); inEvent.preventDefault();
@@ -325,8 +325,8 @@ TouchSource.prototype.touchmove = function(inEvent) {
/** /**
* @private * @private
* @param {TouchEvent} browserEvent The event. * @param {Event} browserEvent The event.
* @param {PointerEvent} inPointer The in pointer. * @param {Object} inPointer The in pointer.
*/ */
TouchSource.prototype.moveOverOut_ = function(browserEvent, inPointer) { TouchSource.prototype.moveOverOut_ = function(browserEvent, inPointer) {
const event = inPointer; const event = inPointer;
@@ -362,7 +362,7 @@ TouchSource.prototype.moveOverOut_ = function(browserEvent, inPointer) {
* Handler for `touchend`, triggers `pointerup`, * Handler for `touchend`, triggers `pointerup`,
* `pointerout` and `pointerleave` events. * `pointerout` and `pointerleave` events.
* *
* @param {TouchEvent} inEvent The event. * @param {Event} inEvent The event.
*/ */
TouchSource.prototype.touchend = function(inEvent) { TouchSource.prototype.touchend = function(inEvent) {
this.dedupSynthMouse_(inEvent); this.dedupSynthMouse_(inEvent);
@@ -372,8 +372,8 @@ TouchSource.prototype.touchend = function(inEvent) {
/** /**
* @private * @private
* @param {TouchEvent} browserEvent An event. * @param {Event} browserEvent An event.
* @param {PointerEvent} inPointer The inPointer object. * @param {Object} inPointer The inPointer object.
*/ */
TouchSource.prototype.upOut_ = function(browserEvent, inPointer) { TouchSource.prototype.upOut_ = function(browserEvent, inPointer) {
this.dispatcher.up(inPointer, browserEvent); this.dispatcher.up(inPointer, browserEvent);
@@ -387,7 +387,7 @@ TouchSource.prototype.upOut_ = function(browserEvent, inPointer) {
* Handler for `touchcancel`, triggers `pointercancel`, * Handler for `touchcancel`, triggers `pointercancel`,
* `pointerout` and `pointerleave` events. * `pointerout` and `pointerleave` events.
* *
* @param {TouchEvent} inEvent The in event. * @param {Event} inEvent The in event.
*/ */
TouchSource.prototype.touchcancel = function(inEvent) { TouchSource.prototype.touchcancel = function(inEvent) {
this.processTouches_(inEvent, this.cancelOut_); this.processTouches_(inEvent, this.cancelOut_);
@@ -396,8 +396,8 @@ TouchSource.prototype.touchcancel = function(inEvent) {
/** /**
* @private * @private
* @param {TouchEvent} browserEvent The event. * @param {Event} browserEvent The event.
* @param {PointerEvent} inPointer The in pointer. * @param {Object} inPointer The in pointer.
*/ */
TouchSource.prototype.cancelOut_ = function(browserEvent, inPointer) { TouchSource.prototype.cancelOut_ = function(browserEvent, inPointer) {
this.dispatcher.cancel(inPointer, browserEvent); this.dispatcher.cancel(inPointer, browserEvent);
@@ -409,7 +409,7 @@ TouchSource.prototype.cancelOut_ = function(browserEvent, inPointer) {
/** /**
* @private * @private
* @param {PointerEvent} inPointer The inPointer object. * @param {Object} inPointer The inPointer object.
*/ */
TouchSource.prototype.cleanUpPointer_ = function(inPointer) { TouchSource.prototype.cleanUpPointer_ = function(inPointer) {
delete this.pointerMap[inPointer.pointerId]; delete this.pointerMap[inPointer.pointerId];
@@ -421,7 +421,7 @@ TouchSource.prototype.cleanUpPointer_ = function(inPointer) {
* Prevent synth mouse events from creating pointer events. * Prevent synth mouse events from creating pointer events.
* *
* @private * @private
* @param {TouchEvent} inEvent The in event. * @param {Event} inEvent The in event.
*/ */
TouchSource.prototype.dedupSynthMouse_ = function(inEvent) { TouchSource.prototype.dedupSynthMouse_ = function(inEvent) {
const lts = this.mouseSource.lastTouches; const lts = this.mouseSource.lastTouches;

View File

@@ -45,9 +45,9 @@ import {METERS_PER_UNIT} from '../proj/Units.js';
* urn:ogc:def:crs:EPSG:6.18:3:3857, * urn:ogc:def:crs:EPSG:6.18:3:3857,
* http://www.opengis.net/gml/srs/epsg.xml#3857 * http://www.opengis.net/gml/srs/epsg.xml#3857
* *
* If you use [proj4js](https://github.com/proj4js/proj4js), aliases can * If you use proj4js, aliases can be added using `proj4.defs()`; see
* be added using `proj4.defs()`. After all required projection definitions are * [documentation](https://github.com/proj4js/proj4js). To set an alternative
* added, call the {@link module:ol/proj/proj4~register} function. * namespace for proj4, use {@link module:ol/proj~setProj4}.
* *
* @constructor * @constructor
* @param {module:ol/proj/Projection~Options} options Projection options. * @param {module:ol/proj/Projection~Options} options Projection options.

View File

@@ -29,13 +29,13 @@ const CanvasImageReplay = function(
/** /**
* @private * @private
* @type {HTMLCanvasElement|HTMLVideoElement|HTMLImageElement} * @type {HTMLCanvasElement|HTMLVideoElement|Image}
*/ */
this.hitDetectionImage_ = null; this.hitDetectionImage_ = null;
/** /**
* @private * @private
* @type {HTMLCanvasElement|HTMLVideoElement|HTMLImageElement} * @type {HTMLCanvasElement|HTMLVideoElement|Image}
*/ */
this.image_ = null; this.image_ = null;

View File

@@ -100,7 +100,7 @@ const CanvasImmediateRenderer = function(context, pixelRatio, extent, transform,
/** /**
* @private * @private
* @type {HTMLCanvasElement|HTMLVideoElement|HTMLImageElement} * @type {HTMLCanvasElement|HTMLVideoElement|Image}
*/ */
this.image_ = null; this.image_ = null;

View File

@@ -652,7 +652,7 @@ CanvasReplay.prototype.replay_ = function(
case CanvasInstruction.DRAW_IMAGE: case CanvasInstruction.DRAW_IMAGE:
d = /** @type {number} */ (instruction[1]); d = /** @type {number} */ (instruction[1]);
dd = /** @type {number} */ (instruction[2]); dd = /** @type {number} */ (instruction[2]);
image = /** @type {HTMLCanvasElement|HTMLVideoElement|HTMLImageElement} */ image = /** @type {HTMLCanvasElement|HTMLVideoElement|Image} */
(instruction[3]); (instruction[3]);
// Remaining arguments in DRAW_IMAGE are in alphabetical order // Remaining arguments in DRAW_IMAGE are in alphabetical order
anchorX = /** @type {number} */ (instruction[4]); anchorX = /** @type {number} */ (instruction[4]);

View File

@@ -83,7 +83,7 @@ IntermediateCanvasRenderer.prototype.composeFrame = function(frameState, layerSt
/** /**
* @abstract * @abstract
* @return {HTMLCanvasElement|HTMLVideoElement|HTMLImageElement} Canvas. * @return {HTMLCanvasElement|HTMLVideoElement|Image} Canvas.
*/ */
IntermediateCanvasRenderer.prototype.getImage = function() {}; IntermediateCanvasRenderer.prototype.getImage = function() {};

View File

@@ -84,7 +84,7 @@ function enlargeClipPoint(centroidX, centroidY, x, y) {
* @param {module:ol/reproj/Triangulation} triangulation * @param {module:ol/reproj/Triangulation} triangulation
* Calculated triangulation. * Calculated triangulation.
* @param {Array.<{extent: module:ol/extent~Extent, * @param {Array.<{extent: module:ol/extent~Extent,
* image: (HTMLCanvasElement|HTMLImageElement|HTMLVideoElement)}>} sources * image: (HTMLCanvasElement|Image|HTMLVideoElement)}>} sources
* Array of sources. * Array of sources.
* @param {number} gutter Gutter of the sources. * @param {number} gutter Gutter of the sources.
* @param {boolean=} opt_renderEdges Render reprojection edges. * @param {boolean=} opt_renderEdges Render reprojection edges.

View File

@@ -80,7 +80,7 @@ inherits(CustomTile, Tile);
/** /**
* Get the image element for this tile. * Get the image element for this tile.
* @return {HTMLImageElement} Image. * @return {Image} Image.
*/ */
CustomTile.prototype.getImage = function() { CustomTile.prototype.getImage = function() {
return null; return null;

View File

@@ -29,7 +29,7 @@ import ImageStyle from '../style/Image.js';
* @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that you must provide a * @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that you must provide a
* `crossOrigin` value if you are using the WebGL renderer or if you want to access pixel data with the Canvas renderer. * `crossOrigin` value if you are using the WebGL renderer or if you want to access pixel data with the Canvas renderer.
* See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image} for more detail. * See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image} for more detail.
* @property {HTMLImageElement|HTMLCanvasElement} [img] Image object for the icon. If the `src` option is not provided then the * @property {Image|HTMLCanvasElement} [img] Image object for the icon. If the `src` option is not provided then the
* provided image must already be loaded. And in that case, it is required * provided image must already be loaded. And in that case, it is required
* to provide the size of the image, with the `imgSize` option. * to provide the size of the image, with the `imgSize` option.
* @property {Array.<number>} [offset=[0, 0]] Offset, which, together with the size and the offset origin, define the * @property {Array.<number>} [offset=[0, 0]] Offset, which, together with the size and the offset origin, define the
@@ -106,7 +106,7 @@ const Icon = function(opt_options) {
options.crossOrigin !== undefined ? options.crossOrigin : null; options.crossOrigin !== undefined ? options.crossOrigin : null;
/** /**
* @type {HTMLImageElement|HTMLCanvasElement} * @type {Image|HTMLCanvasElement}
*/ */
const image = options.img !== undefined ? options.img : null; const image = options.img !== undefined ? options.img : null;
@@ -299,7 +299,7 @@ Icon.prototype.getColor = function() {
/** /**
* Get the image icon. * Get the image icon.
* @param {number} pixelRatio Pixel ratio. * @param {number} pixelRatio Pixel ratio.
* @return {HTMLImageElement|HTMLCanvasElement} Image or Canvas element. * @return {Image|HTMLCanvasElement} Image or Canvas element.
* @override * @override
* @api * @api
*/ */

View File

@@ -11,7 +11,7 @@ import {shared as iconImageCache} from '../style/IconImageCache.js';
/** /**
* @constructor * @constructor
* @param {HTMLImageElement|HTMLCanvasElement} image Image. * @param {Image|HTMLCanvasElement} image Image.
* @param {string|undefined} src Src. * @param {string|undefined} src Src.
* @param {module:ol/size~Size} size Size. * @param {module:ol/size~Size} size Size.
* @param {?string} crossOrigin Cross origin. * @param {?string} crossOrigin Cross origin.
@@ -25,13 +25,13 @@ const IconImage = function(image, src, size, crossOrigin, imageState, color) {
/** /**
* @private * @private
* @type {HTMLImageElement|HTMLCanvasElement} * @type {Image|HTMLCanvasElement}
*/ */
this.hitDetectionImage_ = null; this.hitDetectionImage_ = null;
/** /**
* @private * @private
* @type {HTMLImageElement|HTMLCanvasElement} * @type {Image|HTMLCanvasElement}
*/ */
this.image_ = !image ? new Image() : image; this.image_ = !image ? new Image() : image;
@@ -92,7 +92,7 @@ inherits(IconImage, EventTarget);
/** /**
* @param {HTMLImageElement|HTMLCanvasElement} image Image. * @param {Image|HTMLCanvasElement} image Image.
* @param {string} src Src. * @param {string} src Src.
* @param {module:ol/size~Size} size Size. * @param {module:ol/size~Size} size Size.
* @param {?string} crossOrigin Cross origin. * @param {?string} crossOrigin Cross origin.
@@ -161,7 +161,7 @@ IconImage.prototype.handleImageLoad_ = function() {
/** /**
* @param {number} pixelRatio Pixel ratio. * @param {number} pixelRatio Pixel ratio.
* @return {HTMLImageElement|HTMLCanvasElement} Image or Canvas element. * @return {Image|HTMLCanvasElement} Image or Canvas element.
*/ */
IconImage.prototype.getImage = function(pixelRatio) { IconImage.prototype.getImage = function(pixelRatio) {
return this.canvas_ ? this.canvas_ : this.image_; return this.canvas_ ? this.canvas_ : this.image_;
@@ -178,7 +178,7 @@ IconImage.prototype.getImageState = function() {
/** /**
* @param {number} pixelRatio Pixel ratio. * @param {number} pixelRatio Pixel ratio.
* @return {HTMLImageElement|HTMLCanvasElement} Image element. * @return {Image|HTMLCanvasElement} Image element.
*/ */
IconImage.prototype.getHitDetectionImage = function(pixelRatio) { IconImage.prototype.getHitDetectionImage = function(pixelRatio) {
if (!this.hitDetectionImage_) { if (!this.hitDetectionImage_) {

View File

@@ -122,7 +122,7 @@ ImageStyle.prototype.getAnchor = function() {};
* Get the image element for the symbolizer. * Get the image element for the symbolizer.
* @abstract * @abstract
* @param {number} pixelRatio Pixel ratio. * @param {number} pixelRatio Pixel ratio.
* @return {HTMLCanvasElement|HTMLVideoElement|HTMLImageElement} Image element. * @return {HTMLCanvasElement|HTMLVideoElement|Image} Image element.
*/ */
ImageStyle.prototype.getImage = function(pixelRatio) {}; ImageStyle.prototype.getImage = function(pixelRatio) {};
@@ -130,7 +130,7 @@ ImageStyle.prototype.getImage = function(pixelRatio) {};
/** /**
* @abstract * @abstract
* @param {number} pixelRatio Pixel ratio. * @param {number} pixelRatio Pixel ratio.
* @return {HTMLCanvasElement|HTMLVideoElement|HTMLImageElement} Image element. * @return {HTMLCanvasElement|HTMLVideoElement|Image} Image element.
*/ */
ImageStyle.prototype.getHitDetectionImage = function(pixelRatio) {}; ImageStyle.prototype.getHitDetectionImage = function(pixelRatio) {};

View File

@@ -52,4 +52,4 @@ export function getUid(obj) {
* OpenLayers version. * OpenLayers version.
* @type {string} * @type {string}
*/ */
export const VERSION = '5.0.1'; export const VERSION = '5.0.2';