diff --git a/src/ol/PluggableMap.js b/src/ol/PluggableMap.js index a510c66f1d..bf7cbd6942 100644 --- a/src/ol/PluggableMap.js +++ b/src/ol/PluggableMap.js @@ -303,12 +303,9 @@ const PluggableMap = function(options) { */ this.keyHandlerKeys_ = null; - listen(this.viewport_, EventType.CONTEXTMENU, - this.handleBrowserEvent, this); - listen(this.viewport_, EventType.WHEEL, - this.handleBrowserEvent, this); - listen(this.viewport_, EventType.MOUSEWHEEL, - this.handleBrowserEvent, this); + listen(this.viewport_, EventType.CONTEXTMENU, this.handleBrowserEvent, this); + listen(this.viewport_, EventType.WHEEL, this.handleBrowserEvent, this); + listen(this.viewport_, EventType.MOUSEWHEEL, this.handleBrowserEvent, this); /** * @type {module:ol/Collection.} diff --git a/src/ol/TileQueue.js b/src/ol/TileQueue.js index f6fd1b533f..5403e1e1a0 100644 --- a/src/ol/TileQueue.js +++ b/src/ol/TileQueue.js @@ -27,20 +27,18 @@ const TileQueue = function(tilePriorityFunction, tileChangeCallback) { PriorityQueue.call( this, /** - * @param {Array} element Element. - * @return {number} Priority. - */ + * @param {Array} element Element. + * @return {number} Priority. + */ function(element) { return tilePriorityFunction.apply(null, element); }, /** - * @param {Array} element Element. - * @return {string} Key. - */ + * @param {Array} element Element. + * @return {string} Key. + */ function(element) { - return ( - /** @type {module:ol/Tile} */ (element[0]).getKey() - ); + return (/** @type {module:ol/Tile} */ (element[0]).getKey()); }); /** @@ -73,8 +71,7 @@ TileQueue.prototype.enqueue = function(element) { const added = PriorityQueue.prototype.enqueue.call(this, element); if (added) { const tile = element[0]; - listen(tile, EventType.CHANGE, - this.handleTileChange, this); + listen(tile, EventType.CHANGE, this.handleTileChange, this); } return added; }; @@ -97,8 +94,7 @@ TileQueue.prototype.handleTileChange = function(event) { const state = tile.getState(); if (state === TileState.LOADED || state === TileState.ERROR || state === TileState.EMPTY || state === TileState.ABORT) { - unlisten(tile, EventType.CHANGE, - this.handleTileChange, this); + unlisten(tile, EventType.CHANGE, this.handleTileChange, this); const tileKey = tile.getKey(); if (tileKey in this.tilesLoadingKeys_) { delete this.tilesLoadingKeys_[tileKey]; diff --git a/src/ol/View.js b/src/ol/View.js index 5d3e73e98e..13a7dfeee2 100644 --- a/src/ol/View.js +++ b/src/ol/View.js @@ -280,8 +280,7 @@ View.prototype.applyOptions_ = function(options) { properties[ViewProperty.CENTER] = options.center !== undefined ? options.center : null; - const resolutionConstraintInfo = createResolutionConstraint( - options); + const resolutionConstraintInfo = createResolutionConstraint(options); /** * @private @@ -638,10 +637,8 @@ View.prototype.calculateCenterZoom = function(resolution, anchor) { const currentCenter = this.getCenter(); const currentResolution = this.getResolution(); if (currentCenter !== undefined && currentResolution !== undefined) { - const x = anchor[0] - - resolution * (anchor[0] - currentCenter[0]) / currentResolution; - const y = anchor[1] - - resolution * (anchor[1] - currentCenter[1]) / currentResolution; + const x = anchor[0] - resolution * (anchor[0] - currentCenter[0]) / currentResolution; + const y = anchor[1] - resolution * (anchor[1] - currentCenter[1]) / currentResolution; center = [x, y]; } return center; @@ -922,8 +919,7 @@ View.prototype.getValueForResolutionFunction = function(opt_power) { * @return {number} Value. */ function(resolution) { - const value = - (Math.log(maxResolution / resolution) / Math.log(power)) / max; + const value = (Math.log(maxResolution / resolution) / Math.log(power)) / max; return value; }); }; diff --git a/src/ol/pointer/MouseSource.js b/src/ol/pointer/MouseSource.js index 924bba2efd..7703b473f8 100644 --- a/src/ol/pointer/MouseSource.js +++ b/src/ol/pointer/MouseSource.js @@ -117,8 +117,7 @@ MouseSource.prototype.isEventSimulatedFromTouch_ = function(inEvent) { // simulated mouse events will be swallowed near a primary touchend const dx = Math.abs(x - t[0]); const dy = Math.abs(y - t[1]); - if (dx <= DEDUP_DIST && - dy <= DEDUP_DIST) { + if (dx <= DEDUP_DIST && dy <= DEDUP_DIST) { return true; } } diff --git a/src/ol/pointer/MsSource.js b/src/ol/pointer/MsSource.js index 2e1b7618c5..09f4a941d0 100644 --- a/src/ol/pointer/MsSource.js +++ b/src/ol/pointer/MsSource.js @@ -177,8 +177,7 @@ MsSource.prototype.msPointerCancel = function(inEvent) { * @param {MSPointerEvent} inEvent The in event. */ MsSource.prototype.msLostPointerCapture = function(inEvent) { - const e = this.dispatcher.makeEvent('lostpointercapture', - inEvent, inEvent); + const e = this.dispatcher.makeEvent('lostpointercapture', inEvent, inEvent); this.dispatcher.dispatchEvent(e); }; @@ -189,8 +188,7 @@ MsSource.prototype.msLostPointerCapture = function(inEvent) { * @param {MSPointerEvent} inEvent The in event. */ MsSource.prototype.msGotPointerCapture = function(inEvent) { - const e = this.dispatcher.makeEvent('gotpointercapture', - inEvent, inEvent); + const e = this.dispatcher.makeEvent('gotpointercapture', inEvent, inEvent); this.dispatcher.dispatchEvent(e); }; export default MsSource; diff --git a/src/ol/pointer/TouchSource.js b/src/ol/pointer/TouchSource.js index 6aedb98c82..ae9919e654 100644 --- a/src/ol/pointer/TouchSource.js +++ b/src/ol/pointer/TouchSource.js @@ -122,8 +122,7 @@ TouchSource.prototype.isPrimaryTouch_ = function(inTouch) { */ TouchSource.prototype.setPrimaryTouch_ = function(inTouch) { const count = Object.keys(this.pointerMap).length; - if (count === 0 || (count === 1 && - POINTER_ID.toString() in this.pointerMap)) { + if (count === 0 || (count === 1 && POINTER_ID.toString() in this.pointerMap)) { this.firstTouchId_ = inTouch.identifier; this.cancelResetClickCount_(); } @@ -213,8 +212,7 @@ TouchSource.prototype.touchToPointer_ = function(browserEvent, inTouch) { * @param {function(Event, Object)} inFunction In function. */ TouchSource.prototype.processTouches_ = function(inEvent, inFunction) { - const touches = Array.prototype.slice.call( - inEvent.changedTouches); + const touches = Array.prototype.slice.call(inEvent.changedTouches); const count = touches.length; function preventDefault() { inEvent.preventDefault(); @@ -271,8 +269,7 @@ TouchSource.prototype.vacuumTouches_ = function(inEvent) { // Never remove pointerId == 1, which is mouse. // Touch identifiers are 2 smaller than their pointerId, which is the // index in pointermap. - if (key != POINTER_ID && - !this.findTouch_(touchList, key - 2)) { + if (key != POINTER_ID && !this.findTouch_(touchList, key - 2)) { d.push(value.out); } } diff --git a/src/ol/style/AtlasManager.js b/src/ol/style/AtlasManager.js index ff88dc11b1..09fe03b476 100644 --- a/src/ol/style/AtlasManager.js +++ b/src/ol/style/AtlasManager.js @@ -195,8 +195,7 @@ AtlasManager.prototype.add = function(id, width, height, } /** @type {?module:ol/style/Atlas~AtlasInfo} */ - const info = this.add_(false, - id, width, height, renderCallback, opt_this); + const info = this.add_(false, id, width, height, renderCallback, opt_this); if (!info) { return null; } @@ -227,8 +226,7 @@ AtlasManager.prototype.add = function(id, width, height, * @return {?module:ol/style/Atlas~AtlasInfo} The position and atlas image for the entry, * or `null` if the image is too big. */ -AtlasManager.prototype.add_ = function(isHitAtlas, id, width, height, - renderCallback, opt_this) { +AtlasManager.prototype.add_ = function(isHitAtlas, id, width, height, renderCallback, opt_this) { const atlases = (isHitAtlas) ? this.hitAtlases_ : this.atlases_; let atlas, info, i, ii; for (i = 0, ii = atlases.length; i < ii; ++i) {