From 500a017fafc12f1a40a25fdba11943f986e9a475 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 5 Mar 2018 10:33:40 +0100 Subject: [PATCH] Better code indentation --- src/ol/Graticule.js | 27 +++++++------------ src/ol/MapBrowserEvent.js | 3 +-- src/ol/PluggableMap.js | 36 +++++++++----------------- src/ol/View.js | 3 +-- src/ol/format/EsriJSON.js | 47 ++++++++++++---------------------- src/ol/format/GML2.js | 3 +-- src/ol/format/GML3.js | 3 +-- src/ol/format/GeoJSON.js | 17 +++++------- src/ol/format/KML.js | 3 +-- src/ol/format/Polyline.js | 10 +++----- src/ol/format/XMLFeature.js | 3 +-- src/ol/render/canvas/Replay.js | 7 ++--- src/ol/source/Cluster.js | 3 +-- src/ol/source/ImageMapGuide.js | 3 +-- src/ol/source/ImageWMS.js | 3 +-- src/ol/source/Vector.js | 17 ++++++------ src/ol/webgl/Context.js | 6 ++--- 17 files changed, 71 insertions(+), 123 deletions(-) diff --git a/src/ol/Graticule.js b/src/ol/Graticule.js index b43f521553..9dc8c5eda0 100644 --- a/src/ol/Graticule.js +++ b/src/ol/Graticule.js @@ -192,8 +192,7 @@ const Graticule = function(opt_options) { * @type {number} * @private */ - this.targetSize_ = options.targetSize !== undefined ? - options.targetSize : 100; + this.targetSize_ = options.targetSize !== undefined ? options.targetSize : 100; /** * @type {number} @@ -337,8 +336,7 @@ const Graticule = function(opt_options) { * @private */ Graticule.prototype.addMeridian_ = function(lon, minLat, maxLat, squaredTolerance, extent, index) { - const lineString = this.getMeridian_(lon, minLat, maxLat, - squaredTolerance, index); + const lineString = this.getMeridian_(lon, minLat, maxLat, squaredTolerance, index); if (intersects(lineString.getExtent(), extent)) { if (this.meridiansLabels_) { const textPoint = this.getMeridianPoint_(lineString, extent, index); @@ -385,8 +383,7 @@ Graticule.prototype.getMeridianPoint_ = function(lineString, extent, index) { * @private */ Graticule.prototype.addParallel_ = function(lat, minLon, maxLon, squaredTolerance, extent, index) { - const lineString = this.getParallel_(lat, minLon, maxLon, squaredTolerance, - index); + const lineString = this.getParallel_(lat, minLon, maxLon, squaredTolerance, index); if (intersects(lineString.getExtent(), extent)) { if (this.parallelsLabels_) { const textPoint = this.getParallelPoint_(lineString, extent, index); @@ -457,8 +454,7 @@ Graticule.prototype.createGraticule_ = function(extent, center, resolution, squa Math.min(extent[3], this.maxLatP_) ]; - validExtent = transformExtent(validExtent, this.projection_, - 'EPSG:4326'); + validExtent = transformExtent(validExtent, this.projection_, 'EPSG:4326'); const maxLat = validExtent[3]; const maxLon = validExtent[2]; const minLat = validExtent[1]; @@ -572,10 +568,8 @@ Graticule.prototype.getMap = function() { * @private */ Graticule.prototype.getMeridian_ = function(lon, minLat, maxLat, squaredTolerance, index) { - const flatCoordinates = meridian(lon, - minLat, maxLat, this.projection_, squaredTolerance); - const lineString = this.meridians_[index] !== undefined ? - this.meridians_[index] : new LineString(null); + const flatCoordinates = meridian(lon, minLat, maxLat, this.projection_, squaredTolerance); + const lineString = this.meridians_[index] !== undefined ? this.meridians_[index] : new LineString(null); lineString.setFlatCoordinates(GeometryLayout.XY, flatCoordinates); return lineString; }; @@ -601,10 +595,8 @@ Graticule.prototype.getMeridians = function() { * @private */ Graticule.prototype.getParallel_ = function(lat, minLon, maxLon, squaredTolerance, index) { - const flatCoordinates = parallel(lat, - minLon, maxLon, this.projection_, squaredTolerance); - const lineString = this.parallels_[index] !== undefined ? - this.parallels_[index] : new LineString(null); + const flatCoordinates = parallel(lat, minLon, maxLon, this.projection_, squaredTolerance); + const lineString = this.parallels_[index] !== undefined ? this.parallels_[index] : new LineString(null); lineString.setFlatCoordinates(GeometryLayout.XY, flatCoordinates); return lineString; }; @@ -685,8 +677,7 @@ Graticule.prototype.updateProjectionInfo_ = function(projection) { const extent = projection.getExtent(); const worldExtent = projection.getWorldExtent(); - const worldExtentP = transformExtent(worldExtent, - epsg4326Projection, projection); + const worldExtentP = transformExtent(worldExtent, epsg4326Projection, projection); const maxLat = worldExtent[3]; const maxLon = worldExtent[2]; diff --git a/src/ol/MapBrowserEvent.js b/src/ol/MapBrowserEvent.js index 518323dfa0..bc8d7ce8b8 100644 --- a/src/ol/MapBrowserEvent.js +++ b/src/ol/MapBrowserEvent.js @@ -18,8 +18,7 @@ import MapEvent from './MapEvent.js'; * @param {boolean=} opt_dragging Is the map currently being dragged? * @param {?olx.FrameState=} opt_frameState Frame state. */ -const MapBrowserEvent = function(type, map, browserEvent, opt_dragging, - opt_frameState) { +const MapBrowserEvent = function(type, map, browserEvent, opt_dragging, opt_frameState) { MapEvent.call(this, type, map, opt_frameState); diff --git a/src/ol/PluggableMap.js b/src/ol/PluggableMap.js index 576e9192c2..ed8d18f7c9 100644 --- a/src/ol/PluggableMap.js +++ b/src/ol/PluggableMap.js @@ -500,15 +500,11 @@ PluggableMap.prototype.addOverlayInternal_ = function(overlay) { */ PluggableMap.prototype.disposeInternal = function() { this.mapBrowserEventHandler_.dispose(); - unlisten(this.viewport_, EventType.CONTEXTMENU, - this.handleBrowserEvent, this); - unlisten(this.viewport_, EventType.WHEEL, - this.handleBrowserEvent, this); - unlisten(this.viewport_, EventType.MOUSEWHEEL, - this.handleBrowserEvent, this); + unlisten(this.viewport_, EventType.CONTEXTMENU, this.handleBrowserEvent, this); + unlisten(this.viewport_, EventType.WHEEL, this.handleBrowserEvent, this); + unlisten(this.viewport_, EventType.MOUSEWHEEL, this.handleBrowserEvent, this); if (this.handleResize_ !== undefined) { - removeEventListener(EventType.RESIZE, - this.handleResize_, false); + removeEventListener(EventType.RESIZE, this.handleResize_, false); this.handleResize_ = undefined; } if (this.animationDelayKey_) { @@ -792,8 +788,7 @@ PluggableMap.prototype.getPixelFromCoordinate = function(coordinate) { if (!frameState) { return null; } else { - return applyTransform(frameState.coordinateToPixelTransform, - coordinate.slice(0, 2)); + return applyTransform(frameState.coordinateToPixelTransform, coordinate.slice(0, 2)); } }; @@ -1010,8 +1005,7 @@ PluggableMap.prototype.handleTargetChanged_ = function() { this.renderer_.removeLayerRenderers(); removeNode(this.viewport_); if (this.handleResize_ !== undefined) { - removeEventListener(EventType.RESIZE, - this.handleResize_, false); + removeEventListener(EventType.RESIZE, this.handleResize_, false); this.handleResize_ = undefined; } } else { @@ -1020,16 +1014,13 @@ PluggableMap.prototype.handleTargetChanged_ = function() { const keyboardEventTarget = !this.keyboardEventTarget_ ? targetElement : this.keyboardEventTarget_; this.keyHandlerKeys_ = [ - listen(keyboardEventTarget, EventType.KEYDOWN, - this.handleBrowserEvent, this), - listen(keyboardEventTarget, EventType.KEYPRESS, - this.handleBrowserEvent, this) + listen(keyboardEventTarget, EventType.KEYDOWN, this.handleBrowserEvent, this), + listen(keyboardEventTarget, EventType.KEYPRESS, this.handleBrowserEvent, this) ]; if (!this.handleResize_) { this.handleResize_ = this.updateSize.bind(this); - addEventListener(EventType.RESIZE, - this.handleResize_, false); + addEventListener(EventType.RESIZE, this.handleResize_, false); } } @@ -1130,8 +1121,7 @@ PluggableMap.prototype.renderSync = function() { */ PluggableMap.prototype.render = function() { if (this.animationDelayKey_ === undefined) { - this.animationDelayKey_ = requestAnimationFrame( - this.animationDelay_); + this.animationDelayKey_ = requestAnimationFrame(this.animationDelay_); } }; @@ -1267,14 +1257,12 @@ PluggableMap.prototype.renderFrame_ = function(time) { !equals(frameState.extent, this.previousExtent_); if (idle) { - this.dispatchEvent( - new MapEvent(MapEventType.MOVEEND, this, frameState)); + this.dispatchEvent(new MapEvent(MapEventType.MOVEEND, this, frameState)); clone(frameState.extent, this.previousExtent_); } } - this.dispatchEvent( - new MapEvent(MapEventType.POSTRENDER, this, frameState)); + this.dispatchEvent(new MapEvent(MapEventType.POSTRENDER, this, frameState)); setTimeout(this.handlePostRender.bind(this), 0); diff --git a/src/ol/View.js b/src/ol/View.js index b8e473e5e9..685fdffaf8 100644 --- a/src/ol/View.js +++ b/src/ol/View.js @@ -543,8 +543,7 @@ View.prototype.constrainCenter = function(center) { * @return {number|undefined} Constrained resolution. * @api */ -View.prototype.constrainResolution = function( - resolution, opt_delta, opt_direction) { +View.prototype.constrainResolution = function(resolution, opt_delta, opt_direction) { const delta = opt_delta || 0; const direction = opt_direction || 0; return this.constraints_.resolution(resolution, delta, direction); diff --git a/src/ol/format/EsriJSON.js b/src/ol/format/EsriJSON.js index c101ac31ad..a0afd0c536 100644 --- a/src/ol/format/EsriJSON.js +++ b/src/ol/format/EsriJSON.js @@ -109,9 +109,8 @@ function readGeometry(object, opt_options) { } } const geometryReader = GEOMETRY_READERS[type]; - return ( - /** @type {ol.geom.Geometry} */ transformWithOptions( - geometryReader(object), false, opt_options) + return /** @type {ol.geom.Geometry} */ (transformWithOptions( + geometryReader(object), false, opt_options) ); } @@ -429,11 +428,9 @@ EsriJSON.prototype.readFeatures; /** * @inheritDoc */ -EsriJSON.prototype.readFeatureFromObject = function( - object, opt_options) { +EsriJSON.prototype.readFeatureFromObject = function(object, opt_options) { const esriJSONFeature = /** @type {EsriJSONFeature} */ (object); - const geometry = readGeometry(esriJSONFeature.geometry, - opt_options); + const geometry = readGeometry(esriJSONFeature.geometry, opt_options); const feature = new Feature(); if (this.geometryName_) { feature.setGeometryName(this.geometryName_); @@ -441,8 +438,7 @@ EsriJSON.prototype.readFeatureFromObject = function( feature.setGeometry(geometry); if (opt_options && opt_options.idField && esriJSONFeature.attributes[opt_options.idField]) { - feature.setId(/** @type {number} */( - esriJSONFeature.attributes[opt_options.idField])); + feature.setId(/** @type {number} */(esriJSONFeature.attributes[opt_options.idField])); } if (esriJSONFeature.attributes) { feature.setProperties(esriJSONFeature.attributes); @@ -454,21 +450,17 @@ EsriJSON.prototype.readFeatureFromObject = function( /** * @inheritDoc */ -EsriJSON.prototype.readFeaturesFromObject = function( - object, opt_options) { +EsriJSON.prototype.readFeaturesFromObject = function(object, opt_options) { const esriJSONObject = /** @type {EsriJSONObject} */ (object); const options = opt_options ? opt_options : {}; if (esriJSONObject.features) { - const esriJSONFeatureCollection = /** @type {EsriJSONFeatureCollection} */ - (object); + const esriJSONFeatureCollection = /** @type {EsriJSONFeatureCollection} */ (object); /** @type {Array.} */ const features = []; const esriJSONFeatures = esriJSONFeatureCollection.features; - let i, ii; options.idField = object.objectIdFieldName; - for (i = 0, ii = esriJSONFeatures.length; i < ii; ++i) { - features.push(this.readFeatureFromObject(esriJSONFeatures[i], - options)); + for (let i = 0, ii = esriJSONFeatures.length; i < ii; ++i) { + features.push(this.readFeatureFromObject(esriJSONFeatures[i], options)); } return features; } else { @@ -492,10 +484,8 @@ EsriJSON.prototype.readGeometry; /** * @inheritDoc */ -EsriJSON.prototype.readGeometryFromObject = function( - object, opt_options) { - return readGeometry( - /** @type {EsriJSONGeometry} */(object), opt_options); +EsriJSON.prototype.readGeometryFromObject = function(object, opt_options) { + return readGeometry(/** @type {EsriJSONGeometry} */(object), opt_options); }; @@ -557,10 +547,8 @@ EsriJSON.prototype.writeGeometry; * @override * @api */ -EsriJSON.prototype.writeGeometryObject = function(geometry, - opt_options) { - return writeGeometry(geometry, - this.adaptOptions(opt_options)); +EsriJSON.prototype.writeGeometryObject = function(geometry, opt_options) { + return writeGeometry(geometry, this.adaptOptions(opt_options)); }; @@ -585,14 +573,12 @@ EsriJSON.prototype.writeFeature; * @override * @api */ -EsriJSON.prototype.writeFeatureObject = function( - feature, opt_options) { +EsriJSON.prototype.writeFeatureObject = function(feature, opt_options) { opt_options = this.adaptOptions(opt_options); const object = {}; const geometry = feature.getGeometry(); if (geometry) { - object['geometry'] = - writeGeometry(geometry, opt_options); + object['geometry'] = writeGeometry(geometry, opt_options); if (opt_options && opt_options.featureProjection) { object['geometry']['spatialReference'] = /** @type {EsriJSONCRS} */({ wkid: getProjection(opt_options.featureProjection).getCode().split(':').pop() @@ -634,8 +620,7 @@ EsriJSON.prototype.writeFeatures; EsriJSON.prototype.writeFeaturesObject = function(features, opt_options) { opt_options = this.adaptOptions(opt_options); const objects = []; - let i, ii; - for (i = 0, ii = features.length; i < ii; ++i) { + for (let i = 0, ii = features.length; i < ii; ++i) { objects.push(this.writeFeatureObject(features[i], opt_options)); } return /** @type {EsriJSONFeatureCollection} */ ({ diff --git a/src/ol/format/GML2.js b/src/ol/format/GML2.js index 64ac17bde4..a3f5c83b08 100644 --- a/src/ol/format/GML2.js +++ b/src/ol/format/GML2.js @@ -479,8 +479,7 @@ GML2.prototype.writePoint_ = function(node, geometry, objectStack) { * @param {Array.<*>} objectStack Node stack. * @private */ -GML2.prototype.writeMultiPoint_ = function(node, geometry, - objectStack) { +GML2.prototype.writeMultiPoint_ = function(node, geometry, objectStack) { const context = objectStack[objectStack.length - 1]; const hasZ = context['hasZ']; const srsName = context['srsName']; diff --git a/src/ol/format/GML3.js b/src/ol/format/GML3.js index bc11be4b12..6bf34d470e 100644 --- a/src/ol/format/GML3.js +++ b/src/ol/format/GML3.js @@ -813,8 +813,7 @@ GML3.prototype.writeMultiSurfaceOrPolygon_ = function(node, geometry, objectStac * @param {Array.<*>} objectStack Node stack. * @private */ -GML3.prototype.writeMultiPoint_ = function(node, geometry, - objectStack) { +GML3.prototype.writeMultiPoint_ = function(node, geometry, objectStack) { const context = objectStack[objectStack.length - 1]; const srsName = context['srsName']; const hasZ = context['hasZ']; diff --git a/src/ol/format/GeoJSON.js b/src/ol/format/GeoJSON.js index ce46e9f7ad..3a1a0aa423 100644 --- a/src/ol/format/GeoJSON.js +++ b/src/ol/format/GeoJSON.js @@ -106,9 +106,8 @@ function readGeometry(object, opt_options) { return null; } const geometryReader = GEOMETRY_READERS[object.type]; - return ( - /** @type {ol.geom.Geometry} */ transformWithOptions( - geometryReader(object), false, opt_options) + return /** @type {ol.geom.Geometry} */ (transformWithOptions( + geometryReader(object), false, opt_options) ); } @@ -121,9 +120,9 @@ function readGeometry(object, opt_options) { function readGeometryCollectionGeometry(object, opt_options) { const geometries = object.geometries.map( /** - * @param {GeoJSONGeometry} geometry Geometry. - * @return {ol.geom.Geometry} geometry Geometry. - */ + * @param {GeoJSONGeometry} geometry Geometry. + * @return {ol.geom.Geometry} geometry Geometry. + */ function(geometry) { return readGeometry(geometry, opt_options); }); @@ -388,8 +387,7 @@ GeoJSON.prototype.readFeaturesFromObject = function(object, opt_options) { const geoJSONFeatureCollection = /** @type {GeoJSONFeatureCollection} */ (object); features = []; const geoJSONFeatures = geoJSONFeatureCollection.features; - let i, ii; - for (i = 0, ii = geoJSONFeatures.length; i < ii; ++i) { + for (let i = 0, ii = geoJSONFeatures.length; i < ii; ++i) { features.push(this.readFeatureFromObject(geoJSONFeatures[i], opt_options)); } } else { @@ -523,8 +521,7 @@ GeoJSON.prototype.writeFeatures; GeoJSON.prototype.writeFeaturesObject = function(features, opt_options) { opt_options = this.adaptOptions(opt_options); const objects = []; - let i, ii; - for (i = 0, ii = features.length; i < ii; ++i) { + for (let i = 0, ii = features.length; i < ii; ++i) { objects.push(this.writeFeatureObject(features[i], opt_options)); } return /** @type {GeoJSONFeatureCollection} */ ({ diff --git a/src/ol/format/KML.js b/src/ol/format/KML.js index 052ae49ca6..fddeb78adf 100644 --- a/src/ol/format/KML.js +++ b/src/ol/format/KML.js @@ -2192,8 +2192,7 @@ const DOCUMENT_SERIALIZERS = makeStructureNS( * @param {string=} opt_nodeName Node name. * @return {Node|undefined} Node. */ -const DOCUMENT_NODE_FACTORY = function(value, objectStack, - opt_nodeName) { +const DOCUMENT_NODE_FACTORY = function(value, objectStack, opt_nodeName) { const parentNode = objectStack[objectStack.length - 1].node; return createElementNS(parentNode.namespaceURI, 'Placemark'); }; diff --git a/src/ol/format/Polyline.js b/src/ol/format/Polyline.js index 70f59650f0..d185b33d9d 100644 --- a/src/ol/format/Polyline.js +++ b/src/ol/format/Polyline.js @@ -319,13 +319,11 @@ Polyline.prototype.readGeometryFromText = function(text, opt_options) { const stride = getStrideForLayout(this.geometryLayout_); const flatCoordinates = decodeDeltas(text, stride, this.factor_); flipXY(flatCoordinates, 0, flatCoordinates.length, stride, flatCoordinates); - const coordinates = inflateCoordinates( - flatCoordinates, 0, flatCoordinates.length, stride); + const coordinates = inflateCoordinates(flatCoordinates, 0, flatCoordinates.length, stride); - return ( - /** @type {ol.geom.Geometry} */ transformWithOptions( - new LineString(coordinates, this.geometryLayout_), false, - this.adaptOptions(opt_options)) + return /** @type {ol.geom.Geometry} */ (transformWithOptions( + new LineString(coordinates, this.geometryLayout_), false, + this.adaptOptions(opt_options)) ); }; diff --git a/src/ol/format/XMLFeature.js b/src/ol/format/XMLFeature.js index a35afd7504..33efdf772e 100644 --- a/src/ol/format/XMLFeature.js +++ b/src/ol/format/XMLFeature.js @@ -61,8 +61,7 @@ XMLFeature.prototype.readFeature = function(source, opt_options) { * @param {olx.format.ReadOptions=} opt_options Options. * @return {ol.Feature} Feature. */ -XMLFeature.prototype.readFeatureFromDocument = function( - doc, opt_options) { +XMLFeature.prototype.readFeatureFromDocument = function(doc, opt_options) { const features = this.readFeaturesFromDocument(doc, opt_options); if (features.length > 0) { return features[0]; diff --git a/src/ol/render/canvas/Replay.js b/src/ol/render/canvas/Replay.js index afa467d860..cf39fa6794 100644 --- a/src/ol/render/canvas/Replay.js +++ b/src/ol/render/canvas/Replay.js @@ -16,7 +16,9 @@ import {transform2D} from '../../geom/flat/transform.js'; import {CANVAS_LINE_DASH} from '../../has.js'; import {isEmpty} from '../../obj.js'; import VectorContext from '../VectorContext.js'; -import {drawImage, resetTransform, defaultPadding, defaultFillStyle, defaultStrokeStyle, defaultMiterLimit, defaultLineWidth, defaultLineJoin, defaultLineDashOffset, defaultLineDash, defaultLineCap} from '../canvas.js'; +import {drawImage, resetTransform, defaultPadding, defaultFillStyle, defaultStrokeStyle, + defaultMiterLimit, defaultLineWidth, defaultLineJoin, defaultLineDashOffset, + defaultLineDash, defaultLineCap} from '../canvas.js'; import CanvasInstruction from '../canvas/Instruction.js'; import {TEXT_ALIGN} from '../replay.js'; import { @@ -581,8 +583,7 @@ CanvasReplay.prototype.replay_ = function( // When the batch size gets too big, performance decreases. 200 is a good // balance between batch size and number of fill/stroke instructions. - const batchSize = - this.instructions != instructions || this.overlaps ? 0 : 200; + const batchSize = this.instructions != instructions || this.overlaps ? 0 : 200; let /** @type {ol.Feature|ol.render.Feature} */ feature; let x, y; while (i < ii) { diff --git a/src/ol/source/Cluster.js b/src/ol/source/Cluster.js index 5afad2b958..aab25d360a 100644 --- a/src/ol/source/Cluster.js +++ b/src/ol/source/Cluster.js @@ -96,8 +96,7 @@ Cluster.prototype.getSource = function() { /** * @inheritDoc */ -Cluster.prototype.loadFeatures = function(extent, resolution, - projection) { +Cluster.prototype.loadFeatures = function(extent, resolution, projection) { this.source.loadFeatures(extent, resolution, projection); if (resolution !== this.resolution) { this.clear(); diff --git a/src/ol/source/ImageMapGuide.js b/src/ol/source/ImageMapGuide.js index 841004f5e5..a3d6e20bbf 100644 --- a/src/ol/source/ImageMapGuide.js +++ b/src/ol/source/ImageMapGuide.js @@ -233,8 +233,7 @@ ImageMapGuide.prototype.getUrl = function(baseUrl, params, extent, size, project * @param {ol.ImageLoadFunctionType} imageLoadFunction Image load function. * @api */ -ImageMapGuide.prototype.setImageLoadFunction = function( - imageLoadFunction) { +ImageMapGuide.prototype.setImageLoadFunction = function(imageLoadFunction) { this.image_ = null; this.imageLoadFunction_ = imageLoadFunction; this.changed(); diff --git a/src/ol/source/ImageWMS.js b/src/ol/source/ImageWMS.js index f0d2c4a858..4425b86772 100644 --- a/src/ol/source/ImageWMS.js +++ b/src/ol/source/ImageWMS.js @@ -326,8 +326,7 @@ ImageWMS.prototype.getUrl = function() { * @param {ol.ImageLoadFunctionType} imageLoadFunction Image load function. * @api */ -ImageWMS.prototype.setImageLoadFunction = function( - imageLoadFunction) { +ImageWMS.prototype.setImageLoadFunction = function(imageLoadFunction) { this.image_ = null; this.imageLoadFunction_ = imageLoadFunction; this.changed(); diff --git a/src/ol/source/Vector.js b/src/ol/source/Vector.js index 5189ebf2f8..01aa6702da 100644 --- a/src/ol/source/Vector.js +++ b/src/ol/source/Vector.js @@ -490,10 +490,10 @@ VectorSource.prototype.forEachFeatureInExtent = function(extent, callback) { VectorSource.prototype.forEachFeatureIntersectingExtent = function(extent, callback) { return this.forEachFeatureInExtent(extent, /** - * @param {ol.Feature} feature Feature. - * @return {T|undefined} The return value from the last call to the callback. - * @template T - */ + * @param {ol.Feature} feature Feature. + * @return {T|undefined} The return value from the last call to the callback. + * @template T + */ function(feature) { const geometry = feature.getGeometry(); if (geometry.intersectsExtent(extent)) { @@ -754,17 +754,16 @@ VectorSource.prototype.isEmpty = function() { * @param {number} resolution Resolution. * @param {ol.proj.Projection} projection Projection. */ -VectorSource.prototype.loadFeatures = function( - extent, resolution, projection) { +VectorSource.prototype.loadFeatures = function(extent, resolution, projection) { const loadedExtentsRtree = this.loadedExtentsRtree_; const extentsToLoad = this.strategy_(extent, resolution); for (let i = 0, ii = extentsToLoad.length; i < ii; ++i) { const extentToLoad = extentsToLoad[i]; const alreadyLoaded = loadedExtentsRtree.forEachInExtent(extentToLoad, /** - * @param {{extent: ol.Extent}} object Object. - * @return {boolean} Contains. - */ + * @param {{extent: ol.Extent}} object Object. + * @return {boolean} Contains. + */ function(object) { return containsExtent(object.extent, extentToLoad); }); diff --git a/src/ol/webgl/Context.js b/src/ol/webgl/Context.js index aa232347a7..658eca2d29 100644 --- a/src/ol/webgl/Context.js +++ b/src/ol/webgl/Context.js @@ -224,10 +224,8 @@ WebGLContext.prototype.getShader = function(shaderObject) { * @param {ol.webgl.Vertex} vertexShaderObject Vertex shader. * @return {WebGLProgram} Program. */ -WebGLContext.prototype.getProgram = function( - fragmentShaderObject, vertexShaderObject) { - const programKey = - getUid(fragmentShaderObject) + '/' + getUid(vertexShaderObject); +WebGLContext.prototype.getProgram = function(fragmentShaderObject, vertexShaderObject) { + const programKey = getUid(fragmentShaderObject) + '/' + getUid(vertexShaderObject); if (programKey in this.programCache_) { return this.programCache_[programKey]; } else {