diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000000..edb51380de --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +examples/Jugl.js +examples/resources/ diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index 036fde760a..0000000000 --- a/.jshintrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "-W030": true, - "-W083": true, - "-W069": true -} diff --git a/.travis.yml b/.travis.yml index 25d4ca8bb1..cfd58c07b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,4 @@ -sudo: required -dist: trusty +sudo: false language: node_js @@ -14,7 +13,6 @@ env: before_install: - "npm prune" - - "sudo pip install -r requirements.txt" before_script: - "rm src/ol/renderer/webgl/*shader.js" diff --git a/DEVELOPING.md b/DEVELOPING.md index 1627ca25c9..769d01e66e 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -26,10 +26,10 @@ The minimum requirements are: * GNU Make * Git * [Node.js](http://nodejs.org/) (0.10.x or higher) -* Python 2.6 or 2.7 with a couple of extra modules (see below) +* Python 2.6 or 2.7 * Java 7 (JRE and JDK) -The executables `git`, `node`, `python` and `java` should be in your `PATH`. +The executables `git`, `node`, and `java` should be in your `PATH`. You can check your configuration by running: @@ -39,17 +39,6 @@ To install the Node.js dependencies run $ npm install -To install the extra Python modules, run: - - $ sudo pip install -r requirements.txt -or - - $ cat requirements.txt | sudo xargs easy_install - -depending on your OS and Python installation. - -(You can also install the Python modules in a Python virtual environment if you want to.) - ## Working with the build tool As an ol3 developer you will use `make` to run build targets defined in the diff --git a/Makefile b/Makefile index 072abd9838..b97a2653f4 100644 --- a/Makefile +++ b/Makefile @@ -93,8 +93,7 @@ compile-examples: build/compiled-examples/all.combined.js .PHONY: clean clean: - rm -f build/timestamps/gjslint-timestamp - rm -f build/timestamps/jshint-timestamp + rm -f build/timestamps/eslint-timestamp rm -f build/timestamps/check-*-timestamp rm -f build/ol.css rm -f build/ol.js @@ -120,7 +119,7 @@ examples: $(BUILD_EXAMPLES) install: build/timestamps/node-modules-timestamp .PHONY: lint -lint: build/timestamps/gjslint-timestamp build/timestamps/jshint-timestamp \ +lint: build/timestamps/eslint-timestamp \ build/timestamps/check-requires-timestamp \ build/timestamps/check-whitespace-timestamp @@ -231,13 +230,6 @@ build/timestamps/jsdoc-$(BRANCH)-timestamp: config/jsdoc/api/index.md \ ./node_modules/.bin/jsdoc config/jsdoc/api/index.md -c config/jsdoc/api/conf.json -d $(BUILD_HOSTED)/apidoc @touch $@ -build/timestamps/gjslint-timestamp: $(SRC_JS) $(SPEC_JS) $(SPEC_RENDERING_JS) \ - $(EXAMPLES_JS) - @mkdir -p $(@D) - @echo "Running gjslint..." - @gjslint --jslint_error=all --custom_jsdoc_tags=event,fires,function,classdesc,api,observable --strict $? - @touch $@ - $(BUILD_HOSTED_EXAMPLES_JS): $(BUILD_HOSTED)/examples/%.js: build/examples/%.js @mkdir -p $(@D) @python bin/split-example.py $< $(@D) @@ -271,13 +263,12 @@ $(BUILD_HOSTED)/build/ol-deps.js: host-libraries --root_with_prefix "$(BUILD_HOSTED)/closure-library/third_party ../../third_party" \ --output_file $@ -build/timestamps/jshint-timestamp: $(SRC_JS) $(SPEC_JS) $(SPEC_RENDERING_JS) \ +build/timestamps/eslint-timestamp: $(SRC_JS) $(SPEC_JS) $(SPEC_RENDERING_JS) \ $(TASKS_JS) $(EXAMPLES_JS) \ - examples/resources/common.js \ build/timestamps/node-modules-timestamp @mkdir -p $(@D) - @echo "Running jshint..." - @./node_modules/.bin/jshint --verbose $? + @echo "Running eslint..." + @./node_modules/.bin/eslint $? @touch $@ build/timestamps/node-modules-timestamp: package.json diff --git a/examples/.eslintrc b/examples/.eslintrc new file mode 100644 index 0000000000..7b44c0a1ae --- /dev/null +++ b/examples/.eslintrc @@ -0,0 +1,17 @@ +{ + "globals": { + "FastClick": false, + "$": false, + "arc": false, + "common": false, + "createMapboxStreetsV6Style": false, + "d3": false, + "jsPDF": false, + "jsts": false, + "topojson": false, + "turf": false + }, + "rules": { + "no-unused-vars": [2, {"varsIgnorePattern": "^map"}] + } +} diff --git a/examples/attributions.js b/examples/attributions.js index 7b6a7c5865..128aa42c8c 100644 --- a/examples/attributions.js +++ b/examples/attributions.js @@ -14,7 +14,7 @@ var map = new ol.Map({ source: new ol.source.OSM() }) ], - controls: ol.control.defaults({ attribution: false }).extend([attribution]), + controls: ol.control.defaults({attribution: false}).extend([attribution]), renderer: common.getRendererFromQueryString(), target: 'map', view: new ol.View({ diff --git a/examples/blend-modes.js b/examples/blend-modes.js index a64ec87296..45bd1b96a6 100644 --- a/examples/blend-modes.js +++ b/examples/blend-modes.js @@ -85,8 +85,13 @@ var map = new ol.Map({ }) }); +// Get the form elements and bind the listeners +var select = document.getElementById('blend-mode'); +var affectRed = document.getElementById('affect-red'); +var affectGreen = document.getElementById('affect-green'); +var affectBlue = document.getElementById('affect-blue'); + -// Various helper methods and event handlers /** * This method sets the globalCompositeOperation to the value of the select * field and it is bound to the precompose event of the layers. @@ -154,12 +159,6 @@ var affectLayerClicked = function() { }; -// Get the form elements and bind the listeners -var select = document.getElementById('blend-mode'); -var affectRed = document.getElementById('affect-red'); -var affectGreen = document.getElementById('affect-green'); -var affectBlue = document.getElementById('affect-blue'); - // Rerender map when blend mode changes select.addEventListener('change', function() { map.render(); diff --git a/examples/box-selection.js b/examples/box-selection.js index 69ed2a936a..a01702a5ed 100644 --- a/examples/box-selection.js +++ b/examples/box-selection.js @@ -48,7 +48,7 @@ map.addInteraction(dragBox); var infoBox = document.getElementById('info'); -dragBox.on('boxend', function(e) { +dragBox.on('boxend', function() { // features that intersect the box are added to the collection of // selected features, and their names are displayed in the "info" // div @@ -64,7 +64,7 @@ dragBox.on('boxend', function(e) { }); // clear selection when drawing a new box and when clicking on the map -dragBox.on('boxstart', function(e) { +dragBox.on('boxstart', function() { selectedFeatures.clear(); infoBox.innerHTML = ' '; }); diff --git a/examples/center.js b/examples/center.js index 1392aee78f..809ebdab13 100644 --- a/examples/center.js +++ b/examples/center.js @@ -65,14 +65,7 @@ zoomtoswitzerlandbest.addEventListener('click', function() { var feature = source.getFeatures()[0]; var polygon = /** @type {ol.geom.SimpleGeometry} */ (feature.getGeometry()); var size = /** @type {ol.Size} */ (map.getSize()); - view.fit( - polygon, - size, - { - padding: [170, 50, 30, 150], - constrainResolution: false - } - ); + view.fit(polygon, size, {padding: [170, 50, 30, 150], constrainResolution: false}); }, false); var zoomtoswitzerlandconstrained = @@ -81,13 +74,7 @@ zoomtoswitzerlandconstrained.addEventListener('click', function() { var feature = source.getFeatures()[0]; var polygon = /** @type {ol.geom.SimpleGeometry} */ (feature.getGeometry()); var size = /** @type {ol.Size} */ (map.getSize()); - view.fit( - polygon, - size, - { - padding: [170, 50, 30, 150] - } - ); + view.fit(polygon, size, {padding: [170, 50, 30, 150]}); }, false); var zoomtoswitzerlandnearest = @@ -96,14 +83,7 @@ zoomtoswitzerlandnearest.addEventListener('click', function() { var feature = source.getFeatures()[0]; var polygon = /** @type {ol.geom.SimpleGeometry} */ (feature.getGeometry()); var size = /** @type {ol.Size} */ (map.getSize()); - view.fit( - polygon, - size, - { - padding: [170, 50, 30, 150], - nearest: true - } - ); + view.fit(polygon, size, {padding: [170, 50, 30, 150], nearest: true}); }, false); var zoomtolausanne = document.getElementById('zoomtolausanne'); @@ -111,14 +91,7 @@ zoomtolausanne.addEventListener('click', function() { var feature = source.getFeatures()[1]; var point = /** @type {ol.geom.SimpleGeometry} */ (feature.getGeometry()); var size = /** @type {ol.Size} */ (map.getSize()); - view.fit( - point, - size, - { - padding: [170, 50, 30, 150], - minResolution: 50 - } - ); + view.fit(point, size, {padding: [170, 50, 30, 150], minResolution: 50}); }, false); var centerlausanne = document.getElementById('centerlausanne'); @@ -126,9 +99,5 @@ centerlausanne.addEventListener('click', function() { var feature = source.getFeatures()[1]; var point = /** @type {ol.geom.Point} */ (feature.getGeometry()); var size = /** @type {ol.Size} */ (map.getSize()); - view.centerOn( - point.getCoordinates(), - size, - [570, 500] - ); + view.centerOn(point.getCoordinates(), size, [570, 500]); }, false); diff --git a/examples/cluster.js b/examples/cluster.js index 852982ff8d..2e477721dc 100644 --- a/examples/cluster.js +++ b/examples/cluster.js @@ -34,7 +34,7 @@ var clusterSource = new ol.source.Cluster({ var styleCache = {}; var clusters = new ol.layer.Vector({ source: clusterSource, - style: function(feature, resolution) { + style: function(feature) { var size = feature.get('features').length; var style = styleCache[size]; if (!style) { @@ -65,10 +65,6 @@ var raster = new ol.layer.Tile({ source: new ol.source.MapQuest({layer: 'sat'}) }); -var raw = new ol.layer.Vector({ - source: source -}); - var map = new ol.Map({ layers: [raster, clusters], renderer: 'canvas', diff --git a/examples/color-manipulation.js b/examples/color-manipulation.js index db6fe838bb..6e6f8565b3 100644 --- a/examples/color-manipulation.js +++ b/examples/color-manipulation.js @@ -138,6 +138,8 @@ var raster = new ol.source.Raster({ } }); +var controls = {}; + raster.on('beforeoperations', function(event) { var data = event.data; for (var id in controls) { @@ -160,7 +162,6 @@ var map = new ol.Map({ }); var controlIds = ['hue', 'chroma', 'lightness']; -var controls = {}; controlIds.forEach(function(id) { var control = document.getElementById(id); var output = document.getElementById(id + 'Out'); diff --git a/examples/custom-controls.js b/examples/custom-controls.js index 3c81d909b2..b1836362a1 100644 --- a/examples/custom-controls.js +++ b/examples/custom-controls.js @@ -19,7 +19,6 @@ var app = window.app; // - /** * @constructor * @extends {ol.control.Control} @@ -33,7 +32,7 @@ app.RotateNorthControl = function(opt_options) { button.innerHTML = 'N'; var this_ = this; - var handleRotateNorth = function(e) { + var handleRotateNorth = function() { this_.getMap().getView().setRotation(0); }; diff --git a/examples/custom-interactions.js b/examples/custom-interactions.js index 5c659ef00e..aa3977d0f8 100644 --- a/examples/custom-interactions.js +++ b/examples/custom-interactions.js @@ -22,7 +22,6 @@ goog.require('ol.style.Style'); var app = {}; - /** * @constructor * @extends {ol.interaction.Pointer} @@ -72,7 +71,7 @@ app.Drag.prototype.handleDownEvent = function(evt) { var map = evt.map; var feature = map.forEachFeatureAtPixel(evt.pixel, - function(feature, layer) { + function(feature) { return feature; }); @@ -89,13 +88,6 @@ app.Drag.prototype.handleDownEvent = function(evt) { * @param {ol.MapBrowserEvent} evt Map browser event. */ app.Drag.prototype.handleDragEvent = function(evt) { - var map = evt.map; - - var feature = map.forEachFeatureAtPixel(evt.pixel, - function(feature, layer) { - return feature; - }); - var deltaX = evt.coordinate[0] - this.coordinate_[0]; var deltaY = evt.coordinate[1] - this.coordinate_[1]; @@ -115,7 +107,7 @@ app.Drag.prototype.handleMoveEvent = function(evt) { if (this.cursor_) { var map = evt.map; var feature = map.forEachFeatureAtPixel(evt.pixel, - function(feature, layer) { + function(feature) { return feature; }); var element = evt.map.getTargetElement(); @@ -133,10 +125,9 @@ app.Drag.prototype.handleMoveEvent = function(evt) { /** - * @param {ol.MapBrowserEvent} evt Map browser event. * @return {boolean} `false` to stop the drag sequence. */ -app.Drag.prototype.handleUpEvent = function(evt) { +app.Drag.prototype.handleUpEvent = function() { this.coordinate_ = null; this.feature_ = null; return false; diff --git a/examples/d3.js b/examples/d3.js index 2bcbf7deaf..83d7306f55 100644 --- a/examples/d3.js +++ b/examples/d3.js @@ -39,7 +39,7 @@ d3.json('data/topojson/us.json', function(error, us) { * @param {number} pixelRatio Pixel ratio. * @param {ol.Size} size Size. * @param {ol.proj.Projection} projection Projection. - * @return {HTMLCanvasElement} + * @return {HTMLCanvasElement} A canvas element. */ var canvasFunction = function(extent, resolution, pixelRatio, size, projection) { diff --git a/examples/device-orientation.js b/examples/device-orientation.js index 903ba0c1a4..f2d976afb4 100644 --- a/examples/device-orientation.js +++ b/examples/device-orientation.js @@ -39,7 +39,7 @@ el('track').addEventListener('change', function() { deviceOrientation.setTracking(this.checked); }); -deviceOrientation.on('change', function(event) { +deviceOrientation.on('change', function() { el('alpha').innerText = deviceOrientation.getAlpha() + ' [rad]'; el('beta').innerText = deviceOrientation.getBeta() + ' [rad]'; el('gamma').innerText = deviceOrientation.getGamma() + ' [rad]'; diff --git a/examples/drag-and-drop-image-vector.js b/examples/drag-and-drop-image-vector.js index 9a705d1993..35545d2ea8 100644 --- a/examples/drag-and-drop-image-vector.js +++ b/examples/drag-and-drop-image-vector.js @@ -128,7 +128,7 @@ dragAndDropInteraction.on('addfeatures', function(event) { var displayFeatureInfo = function(pixel) { var features = []; - map.forEachFeatureAtPixel(pixel, function(feature, layer) { + map.forEachFeatureAtPixel(pixel, function(feature) { features.push(feature); }); if (features.length > 0) { diff --git a/examples/drag-and-drop.js b/examples/drag-and-drop.js index 18c16d60a7..49a39ea780 100644 --- a/examples/drag-and-drop.js +++ b/examples/drag-and-drop.js @@ -124,7 +124,7 @@ dragAndDropInteraction.on('addfeatures', function(event) { var displayFeatureInfo = function(pixel) { var features = []; - map.forEachFeatureAtPixel(pixel, function(feature, layer) { + map.forEachFeatureAtPixel(pixel, function(feature) { features.push(feature); }); if (features.length > 0) { diff --git a/examples/draw-and-modify-features.js b/examples/draw-and-modify-features.js index 8e79524424..6540f416cb 100644 --- a/examples/draw-and-modify-features.js +++ b/examples/draw-and-modify-features.js @@ -60,6 +60,8 @@ var modify = new ol.interaction.Modify({ map.addInteraction(modify); var draw; // global so we can remove it later +var typeSelect = document.getElementById('type'); + function addInteraction() { draw = new ol.interaction.Draw({ features: features, @@ -68,14 +70,11 @@ function addInteraction() { map.addInteraction(draw); } -var typeSelect = document.getElementById('type'); - /** - * Let user change the geometry type. - * @param {Event} e Change event. + * Handle change event. */ -typeSelect.onchange = function(e) { +typeSelect.onchange = function() { map.removeInteraction(draw); addInteraction(); }; diff --git a/examples/draw-features.js b/examples/draw-features.js index b7cb4cec5f..39e46a0e15 100644 --- a/examples/draw-features.js +++ b/examples/draw-features.js @@ -83,10 +83,9 @@ function addInteraction() { /** - * Let user change the geometry type. - * @param {Event} e Change event. + * Handle change event. */ -typeSelect.onchange = function(e) { +typeSelect.onchange = function() { map.removeInteraction(draw); addInteraction(); }; diff --git a/examples/earthquake-clusters.js b/examples/earthquake-clusters.js index 1e26e39b66..05daeb0e56 100644 --- a/examples/earthquake-clusters.js +++ b/examples/earthquake-clusters.js @@ -56,7 +56,7 @@ function createEarthquakeStyle(feature) { }); } -var maxFeatureCount; +var maxFeatureCount, vector; function calculateClusterInfo(resolution) { maxFeatureCount = 0; var features = vector.getSource().getFeatures(); @@ -65,7 +65,8 @@ function calculateClusterInfo(resolution) { feature = features[i]; var originalFeatures = feature.get('features'); var extent = ol.extent.createEmpty(); - for (var j = 0, jj = originalFeatures.length; j < jj; ++j) { + var j, jj; + for (j = 0, jj = originalFeatures.length; j < jj; ++j) { ol.extent.extend(extent, originalFeatures[j].getGeometry().getExtent()); } maxFeatureCount = Math.max(maxFeatureCount, jj); @@ -104,7 +105,7 @@ function styleFunction(feature, resolution) { return style; } -function selectStyleFunction(feature, resolution) { +function selectStyleFunction(feature) { var styles = [new ol.style.Style({ image: new ol.style.Circle({ radius: feature.get('radius'), @@ -120,7 +121,7 @@ function selectStyleFunction(feature, resolution) { return styles; } -var vector = new ol.layer.Vector({ +vector = new ol.layer.Vector({ source: new ol.source.Cluster({ distance: 40, source: new ol.source.Vector({ diff --git a/examples/earthquake-custom-symbol.js b/examples/earthquake-custom-symbol.js index d52a455745..6d0016a174 100644 --- a/examples/earthquake-custom-symbol.js +++ b/examples/earthquake-custom-symbol.js @@ -14,7 +14,7 @@ goog.require('ol.style.Style'); var styleCache = {}; -var styleFunction = function(feature, resolution) { +var styleFunction = function(feature) { // 2012_Earthquakes_Mag5.kml stores the magnitude of each earthquake in a // standards-violating tag in each Placemark. We extract it from // the Placemark's name instead. @@ -29,8 +29,8 @@ var styleFunction = function(feature, resolution) { /** @type {CanvasRenderingContext2D} */ (canvas.getContext('2d')), {size: [size + 2, size + 2], pixelRatio: size / 10}); render.setFillStrokeStyle( - new ol.style.Fill({ color: 'rgba(255, 153, 0, 0.4)' }), - new ol.style.Stroke({ color: 'rgba(255, 204, 0, 0.2)', width: 1 })); + new ol.style.Fill({color: 'rgba(255, 153, 0, 0.4)'}), + new ol.style.Stroke({color: 'rgba(255, 204, 0, 0.2)', width: 1})); render.drawPolygonGeometry(new ol.geom.Polygon( [[[0, 0], [4, 2], [6, 0], [10, 5], [6, 3], [4, 5], [0, 0]]])); style = new ol.style.Style({ diff --git a/examples/export-map.js b/examples/export-map.js index 4b22a09ce8..ccb95959c3 100644 --- a/examples/export-map.js +++ b/examples/export-map.js @@ -34,7 +34,7 @@ var map = new ol.Map({ var exportPNGElement = document.getElementById('export-png'); if ('download' in exportPNGElement) { - exportPNGElement.addEventListener('click', function(e) { + exportPNGElement.addEventListener('click', function() { map.once('postcompose', function(event) { var canvas = event.context.canvas; exportPNGElement.href = canvas.toDataURL('image/png'); diff --git a/examples/export-pdf.js b/examples/export-pdf.js index 44c5c2d323..c13ac852aa 100644 --- a/examples/export-pdf.js +++ b/examples/export-pdf.js @@ -54,7 +54,7 @@ var loaded = 0; var exportButton = document.getElementById('export-pdf'); -exportButton.addEventListener('click', function(e) { +exportButton.addEventListener('click', function() { exportButton.disabled = true; document.body.style.cursor = 'progress'; @@ -73,7 +73,7 @@ exportButton.addEventListener('click', function(e) { ++loading; }; - var tileLoadEnd = function(callback) { + var tileLoadEnd = function() { ++loaded; if (loading === loaded) { var canvas = this; diff --git a/examples/feature-move-animation.js b/examples/feature-move-animation.js index d4c8df48a9..6a62d6e1fa 100644 --- a/examples/feature-move-animation.js +++ b/examples/feature-move-animation.js @@ -108,11 +108,16 @@ var styles = { }) }; +var animating = false; +var speed, now; +var speedInput = document.getElementById('speed'); +var startButton = document.getElementById('start-animation'); + var vectorLayer = new ol.layer.Vector({ source: new ol.source.Vector({ features: [routeFeature, geoMarker, startMarker, endMarker] }), - style: function(feature, resolution) { + style: function(feature) { // hide geoMarker if animation is active if (animating && feature.get('type') === 'geoMarker') { return null; @@ -198,8 +203,4 @@ function stopAnimation(ended) { map.un('postcompose', moveFeature); } -var speed, now; -var animating = false; -var speedInput = document.getElementById('speed'); -var startButton = document.getElementById('start-animation'); startButton.addEventListener('click', startAnimation, false); diff --git a/examples/flight-animation.js b/examples/flight-animation.js index 6a47e9e43b..552172bb8b 100644 --- a/examples/flight-animation.js +++ b/examples/flight-animation.js @@ -35,6 +35,14 @@ var defaultStyle = new ol.style.Style({ stroke: defaultStroke }); +var flightsSource; +var addLater = function(feature, timeout) { + window.setTimeout(function() { + feature.set('start', new Date().getTime()); + flightsSource.addFeature(feature); + }, timeout); +}; + var pointsPerMs = 0.1; var animateFlights = function(event) { var vectorContext = event.vectorContext; @@ -66,20 +74,13 @@ var animateFlights = function(event) { map.render(); }; -var addLater = function(feature, timeout) { - window.setTimeout(function() { - feature.set('start', new Date().getTime()); - flightsSource.addFeature(feature); - }, timeout); -}; - -var flightsSource = new ol.source.Vector({ +flightsSource = new ol.source.Vector({ wrapX: false, attributions: [new ol.Attribution({ html: 'Flight data by ' + 'OpenFlights,' })], - loader: function(extent, resolution, projection) { + loader: function() { var url = 'data/openflights/flights.json'; fetch(url).then(function(response) { return response.json(); @@ -116,7 +117,7 @@ var flightsSource = new ol.source.Vector({ var flightsLayer = new ol.layer.Vector({ source: flightsSource, - style: function(feature, resolution) { + style: function(feature) { // if the animation is still active for a feature, do not // render the feature with the layer style if (feature.get('finished')) { diff --git a/examples/geojson.js b/examples/geojson.js index ff83ead26f..f0bb72c7d5 100644 --- a/examples/geojson.js +++ b/examples/geojson.js @@ -85,7 +85,7 @@ var styles = { }) }; -var styleFunction = function(feature, resolution) { +var styleFunction = function(feature) { return styles[feature.getGeometry().getType()]; }; @@ -97,79 +97,67 @@ var geojsonObject = { 'name': 'EPSG:3857' } }, - 'features': [ - { - 'type': 'Feature', - 'geometry': { - 'type': 'Point', - 'coordinates': [0, 0] - } - }, - { - 'type': 'Feature', - 'geometry': { - 'type': 'LineString', - 'coordinates': [[4e6, -2e6], [8e6, 2e6]] - } - }, - { - 'type': 'Feature', - 'geometry': { - 'type': 'LineString', - 'coordinates': [[4e6, 2e6], [8e6, -2e6]] - } - }, - { - 'type': 'Feature', - 'geometry': { - 'type': 'Polygon', - 'coordinates': [[[-5e6, -1e6], [-4e6, 1e6], [-3e6, -1e6]]] - } - }, - { - 'type': 'Feature', - 'geometry': { - 'type': 'MultiLineString', - 'coordinates': [ - [[-1e6, -7.5e5], [-1e6, 7.5e5]], - [[1e6, -7.5e5], [1e6, 7.5e5]], - [[-7.5e5, -1e6], [7.5e5, -1e6]], - [[-7.5e5, 1e6], [7.5e5, 1e6]] - ] - } - }, - { - 'type': 'Feature', - 'geometry': { - 'type': 'MultiPolygon', - 'coordinates': [ - [[[-5e6, 6e6], [-5e6, 8e6], [-3e6, 8e6], [-3e6, 6e6]]], - [[[-2e6, 6e6], [-2e6, 8e6], [0, 8e6], [0, 6e6]]], - [[[1e6, 6e6], [1e6, 8e6], [3e6, 8e6], [3e6, 6e6]]] - ] - } - }, - { - 'type': 'Feature', - 'geometry': { - 'type': 'GeometryCollection', - 'geometries': [ - { - 'type': 'LineString', - 'coordinates': [[-5e6, -5e6], [0, -5e6]] - }, - { - 'type': 'Point', - 'coordinates': [4e6, -5e6] - }, - { - 'type': 'Polygon', - 'coordinates': [[[1e6, -6e6], [2e6, -4e6], [3e6, -6e6]]] - } - ] - } + 'features': [{ + 'type': 'Feature', + 'geometry': { + 'type': 'Point', + 'coordinates': [0, 0] } - ] + }, { + 'type': 'Feature', + 'geometry': { + 'type': 'LineString', + 'coordinates': [[4e6, -2e6], [8e6, 2e6]] + } + }, { + 'type': 'Feature', + 'geometry': { + 'type': 'LineString', + 'coordinates': [[4e6, 2e6], [8e6, -2e6]] + } + }, { + 'type': 'Feature', + 'geometry': { + 'type': 'Polygon', + 'coordinates': [[[-5e6, -1e6], [-4e6, 1e6], [-3e6, -1e6]]] + } + }, { + 'type': 'Feature', + 'geometry': { + 'type': 'MultiLineString', + 'coordinates': [ + [[-1e6, -7.5e5], [-1e6, 7.5e5]], + [[1e6, -7.5e5], [1e6, 7.5e5]], + [[-7.5e5, -1e6], [7.5e5, -1e6]], + [[-7.5e5, 1e6], [7.5e5, 1e6]] + ] + } + }, { + 'type': 'Feature', + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + [[[-5e6, 6e6], [-5e6, 8e6], [-3e6, 8e6], [-3e6, 6e6]]], + [[[-2e6, 6e6], [-2e6, 8e6], [0, 8e6], [0, 6e6]]], + [[[1e6, 6e6], [1e6, 8e6], [3e6, 8e6], [3e6, 6e6]]] + ] + } + }, { + 'type': 'Feature', + 'geometry': { + 'type': 'GeometryCollection', + 'geometries': [{ + 'type': 'LineString', + 'coordinates': [[-5e6, -5e6], [0, -5e6]] + }, { + 'type': 'Point', + 'coordinates': [4e6, -5e6] + }, { + 'type': 'Polygon', + 'coordinates': [[[1e6, -6e6], [2e6, -4e6], [3e6, -6e6]]] + }] + } + }] }; var vectorSource = new ol.source.Vector({ diff --git a/examples/geolocation-orientation.js b/examples/geolocation-orientation.js index f597c56e69..a14a908355 100644 --- a/examples/geolocation-orientation.js +++ b/examples/geolocation-orientation.js @@ -58,7 +58,7 @@ var geolocation = new ol.Geolocation(/** @type {olx.GeolocationOptions} */ ({ var deltaMean = 500; // the geolocation sampling period mean in ms // Listen to position changes -geolocation.on('change', function(evt) { +geolocation.on('change', function() { var position = geolocation.getPosition(); var accuracy = geolocation.getAccuracy(); var heading = geolocation.getHeading() || 0; @@ -113,7 +113,7 @@ function addPosition(position, heading, m, speed) { // force the rotation change to be less than 180° if (Math.abs(headingDiff) > Math.PI) { var sign = (headingDiff >= 0) ? 1 : -1; - headingDiff = - sign * (2 * Math.PI - Math.abs(headingDiff)); + headingDiff = -sign * (2 * Math.PI - Math.abs(headingDiff)); } heading = prevHeading + headingDiff; } diff --git a/examples/geolocation.js b/examples/geolocation.js index a35eacd2b2..d7d3e96bec 100644 --- a/examples/geolocation.js +++ b/examples/geolocation.js @@ -86,7 +86,7 @@ geolocation.on('change:position', function() { new ol.geom.Point(coordinates) : null); }); -var featuresOverlay = new ol.layer.Vector({ +new ol.layer.Vector({ map: map, source: new ol.source.Vector({ features: [accuracyFeature, positionFeature] diff --git a/examples/getfeatureinfo-image.js b/examples/getfeatureinfo-image.js index f3e6ac3434..d9d37f5bd8 100644 --- a/examples/getfeatureinfo-image.js +++ b/examples/getfeatureinfo-image.js @@ -44,7 +44,7 @@ map.on('pointermove', function(evt) { return; } var pixel = map.getEventPixel(evt.originalEvent); - var hit = map.forEachLayerAtPixel(pixel, function(layer) { + var hit = map.forEachLayerAtPixel(pixel, function() { return true; }); map.getTargetElement().style.cursor = hit ? 'pointer' : ''; diff --git a/examples/getfeatureinfo-tile.js b/examples/getfeatureinfo-tile.js index 1f6fcbf170..3363fc2947 100644 --- a/examples/getfeatureinfo-tile.js +++ b/examples/getfeatureinfo-tile.js @@ -44,7 +44,7 @@ map.on('pointermove', function(evt) { return; } var pixel = map.getEventPixel(evt.originalEvent); - var hit = map.forEachLayerAtPixel(pixel, function(layer) { + var hit = map.forEachLayerAtPixel(pixel, function() { return true; }); map.getTargetElement().style.cursor = hit ? 'pointer' : ''; diff --git a/examples/gpx.js b/examples/gpx.js index 5f486d67f1..8afc8db144 100644 --- a/examples/gpx.js +++ b/examples/gpx.js @@ -3,7 +3,6 @@ goog.require('ol.View'); goog.require('ol.format.GPX'); goog.require('ol.layer.Tile'); goog.require('ol.layer.Vector'); -goog.require('ol.proj'); goog.require('ol.source.BingMaps'); goog.require('ol.source.Vector'); goog.require('ol.style.Circle'); @@ -11,8 +10,6 @@ goog.require('ol.style.Fill'); goog.require('ol.style.Stroke'); goog.require('ol.style.Style'); -var projection = ol.proj.get('EPSG:3857'); - var raster = new ol.layer.Tile({ source: new ol.source.BingMaps({ imagerySet: 'Aerial', @@ -52,7 +49,7 @@ var vector = new ol.layer.Vector({ url: 'data/gpx/fells_loop.gpx', format: new ol.format.GPX() }), - style: function(feature, resolution) { + style: function(feature) { return style[feature.getGeometry().getType()]; } }); @@ -68,7 +65,7 @@ var map = new ol.Map({ var displayFeatureInfo = function(pixel) { var features = []; - map.forEachFeatureAtPixel(pixel, function(feature, layer) { + map.forEachFeatureAtPixel(pixel, function(feature) { features.push(feature); }); if (features.length > 0) { diff --git a/examples/icon-negative.js b/examples/icon-negative.js index 86f6839889..e85371216c 100644 --- a/examples/icon-negative.js +++ b/examples/icon-negative.js @@ -28,11 +28,13 @@ iconFeature.set('style', createStyle('data/icon.png', undefined)); var map = new ol.Map({ layers: [ new ol.layer.Tile({ - source: new ol.source.Stamen({ layer: 'watercolor' }) + source: new ol.source.Stamen({layer: 'watercolor'}) }), new ol.layer.Vector({ - style: function(feature) { return feature.get('style'); }, - source: new ol.source.Vector({ features: [iconFeature] }) + style: function(feature) { + return feature.get('style'); + }, + source: new ol.source.Vector({features: [iconFeature]}) }) ], target: document.getElementById('map'), @@ -44,7 +46,7 @@ var map = new ol.Map({ var selectStyle = {}; var select = new ol.interaction.Select({ - style: function(feature, resolution) { + style: function(feature) { var image = feature.get('style').getImage().getImage(); if (!selectStyle[image.src]) { var canvas = document.createElement('canvas'); diff --git a/examples/icon-sprite-webgl.js b/examples/icon-sprite-webgl.js index 04d0fb160b..48d5716b86 100644 --- a/examples/icon-sprite-webgl.js +++ b/examples/icon-sprite-webgl.js @@ -95,7 +95,7 @@ for (i = 0; i < featureCount; i += 30) { overlayFeatures.push(clone); } -var featureOverlay = new ol.layer.Vector({ +new ol.layer.Vector({ map: map, source: new ol.source.Vector({ features: overlayFeatures @@ -112,8 +112,8 @@ map.on('click', function(evt) { window.setTimeout(function() { var features = []; - map.forEachFeatureAtPixel(evt.pixel, function(feature, layer) { - features.push(features); + map.forEachFeatureAtPixel(evt.pixel, function(feature) { + features.push(feature); return false; }); diff --git a/examples/icon.js b/examples/icon.js index b2a77c67db..3b91d37c5a 100644 --- a/examples/icon.js +++ b/examples/icon.js @@ -66,7 +66,7 @@ map.addOverlay(popup); // display popup on click map.on('click', function(evt) { var feature = map.forEachFeatureAtPixel(evt.pixel, - function(feature, layer) { + function(feature) { return feature; }); if (feature) { diff --git a/examples/igc.js b/examples/igc.js index af151b7f92..521b0923ee 100644 --- a/examples/igc.js +++ b/examples/igc.js @@ -25,7 +25,7 @@ var colors = { }; var styleCache = {}; -var styleFunction = function(feature, resolution) { +var styleFunction = function(feature) { var color = colors[feature.get('PLT')]; var style = styleCache[color]; if (!style) { diff --git a/examples/image-load-events.js b/examples/image-load-events.js index 885556aff3..27ef99b01a 100644 --- a/examples/image-load-events.js +++ b/examples/image-load-events.js @@ -4,7 +4,6 @@ goog.require('ol.layer.Image'); goog.require('ol.source.ImageWMS'); - /** * Renders a progress bar. * @param {Element} el The target element. @@ -84,14 +83,14 @@ var source = new ol.source.ImageWMS({ serverType: 'geoserver' }); -source.on('imageloadstart', function(event) { +source.on('imageloadstart', function() { progress.addLoading(); }); -source.on('imageloadend', function(event) { +source.on('imageloadend', function() { progress.addLoaded(); }); -source.on('imageloaderror', function(event) { +source.on('imageloaderror', function() { progress.addLoaded(); }); diff --git a/examples/image-vector-layer.js b/examples/image-vector-layer.js index 47111dfff8..9853b2d293 100644 --- a/examples/image-vector-layer.js +++ b/examples/image-vector-layer.js @@ -59,7 +59,7 @@ var featureOverlay = new ol.layer.Vector({ var highlight; var displayFeatureInfo = function(pixel) { - var feature = map.forEachFeatureAtPixel(pixel, function(feature, layer) { + var feature = map.forEachFeatureAtPixel(pixel, function(feature) { return feature; }); diff --git a/examples/kml-earthquakes.js b/examples/kml-earthquakes.js index 80608113e5..656bd41236 100644 --- a/examples/kml-earthquakes.js +++ b/examples/kml-earthquakes.js @@ -12,7 +12,7 @@ goog.require('ol.style.Style'); var styleCache = {}; -var styleFunction = function(feature, resolution) { +var styleFunction = function(feature) { // 2012_Earthquakes_Mag5.kml stores the magnitude of each earthquake in a // standards-violating tag in each Placemark. We extract it from // the Placemark's name instead. @@ -74,7 +74,7 @@ var displayFeatureInfo = function(pixel) { left: pixel[0] + 'px', top: (pixel[1] - 15) + 'px' }); - var feature = map.forEachFeatureAtPixel(pixel, function(feature, layer) { + var feature = map.forEachFeatureAtPixel(pixel, function(feature) { return feature; }); if (feature) { diff --git a/examples/kml-timezones.js b/examples/kml-timezones.js index 3e3630c389..9db2419682 100644 --- a/examples/kml-timezones.js +++ b/examples/kml-timezones.js @@ -17,7 +17,7 @@ goog.require('ol.style.Style'); * currently midnight would have an opacity of 0. This doesn't account for * daylight savings, so don't use it to plan your vacation. */ -var styleFunction = function(feature, resolution) { +var styleFunction = function(feature) { var offset = 0; var name = feature.get('name'); // e.g. GMT -08:30 var match = name.match(/([\-+]\d{2}):(\d{2})$/); @@ -81,7 +81,7 @@ var displayFeatureInfo = function(pixel) { left: pixel[0] + 'px', top: (pixel[1] - 15) + 'px' }); - var feature = map.forEachFeatureAtPixel(pixel, function(feature, layer) { + var feature = map.forEachFeatureAtPixel(pixel, function(feature) { return feature; }); if (feature) { diff --git a/examples/kml.js b/examples/kml.js index dd4c2ad2c9..5218974899 100644 --- a/examples/kml.js +++ b/examples/kml.js @@ -35,7 +35,7 @@ var map = new ol.Map({ var displayFeatureInfo = function(pixel) { var features = []; - map.forEachFeatureAtPixel(pixel, function(feature, layer) { + map.forEachFeatureAtPixel(pixel, function(feature) { features.push(feature); }); if (features.length > 0) { diff --git a/examples/line-arrows.js b/examples/line-arrows.js index b03d110437..4676e2fb75 100644 --- a/examples/line-arrows.js +++ b/examples/line-arrows.js @@ -16,7 +16,7 @@ var raster = new ol.layer.Tile({ var source = new ol.source.Vector(); -var styleFunction = function(feature, resolution) { +var styleFunction = function(feature) { var geometry = feature.getGeometry(); var styles = [ // linestring diff --git a/examples/measure.js b/examples/measure.js index c1d45615f2..b637a74b74 100644 --- a/examples/measure.js +++ b/examples/measure.js @@ -96,7 +96,7 @@ var continueLineMsg = 'Click to continue drawing the line'; /** * Handle pointer move. - * @param {ol.MapBrowserEvent} evt + * @param {ol.MapBrowserEvent} evt The event. */ var pointerMoveHandler = function(evt) { if (evt.dragging) { @@ -140,6 +140,66 @@ var typeSelect = document.getElementById('type'); var geodesicCheckbox = document.getElementById('geodesic'); var draw; // global so we can remove it later + + +/** + * Format length output. + * @param {ol.geom.LineString} line The line. + * @return {string} The formatted length. + */ +var formatLength = function(line) { + var length; + if (geodesicCheckbox.checked) { + var coordinates = line.getCoordinates(); + length = 0; + var sourceProj = map.getView().getProjection(); + for (var i = 0, ii = coordinates.length - 1; i < ii; ++i) { + var c1 = ol.proj.transform(coordinates[i], sourceProj, 'EPSG:4326'); + var c2 = ol.proj.transform(coordinates[i + 1], sourceProj, 'EPSG:4326'); + length += wgs84Sphere.haversineDistance(c1, c2); + } + } else { + length = Math.round(line.getLength() * 100) / 100; + } + var output; + if (length > 100) { + output = (Math.round(length / 1000 * 100) / 100) + + ' ' + 'km'; + } else { + output = (Math.round(length * 100) / 100) + + ' ' + 'm'; + } + return output; +}; + + +/** + * Format length output. + * @param {ol.geom.Polygon} polygon The polygon. + * @return {string} Formatted area. + */ +var formatArea = function(polygon) { + var area; + if (geodesicCheckbox.checked) { + var sourceProj = map.getView().getProjection(); + var geom = /** @type {ol.geom.Polygon} */(polygon.clone().transform( + sourceProj, 'EPSG:4326')); + var coordinates = geom.getLinearRing(0).getCoordinates(); + area = Math.abs(wgs84Sphere.geodesicArea(coordinates)); + } else { + area = polygon.getArea(); + } + var output; + if (area > 10000) { + output = (Math.round(area / 1000000 * 100) / 100) + + ' ' + 'km2'; + } else { + output = (Math.round(area * 100) / 100) + + ' ' + 'm2'; + } + return output; +}; + function addInteraction() { var type = (typeSelect.value == 'area' ? 'Polygon' : 'LineString'); draw = new ol.interaction.Draw({ @@ -186,7 +246,7 @@ function addInteraction() { output = formatArea(/** @type {ol.geom.Polygon} */ (geom)); tooltipCoord = geom.getInteriorPoint().getCoordinates(); } else if (geom instanceof ol.geom.LineString) { - output = formatLength( /** @type {ol.geom.LineString} */ (geom)); + output = formatLength(/** @type {ol.geom.LineString} */ (geom)); tooltipCoord = geom.getLastCoordinate(); } measureTooltipElement.innerHTML = output; @@ -195,7 +255,7 @@ function addInteraction() { }, this); draw.on('drawend', - function(evt) { + function() { measureTooltipElement.className = 'tooltip tooltip-static'; measureTooltip.setOffset([0, -7]); // unset sketch @@ -246,70 +306,10 @@ function createMeasureTooltip() { /** * Let user change the geometry type. - * @param {Event} e Change event. */ -typeSelect.onchange = function(e) { +typeSelect.onchange = function() { map.removeInteraction(draw); addInteraction(); }; - -/** - * format length output - * @param {ol.geom.LineString} line - * @return {string} - */ -var formatLength = function(line) { - var length; - if (geodesicCheckbox.checked) { - var coordinates = line.getCoordinates(); - length = 0; - var sourceProj = map.getView().getProjection(); - for (var i = 0, ii = coordinates.length - 1; i < ii; ++i) { - var c1 = ol.proj.transform(coordinates[i], sourceProj, 'EPSG:4326'); - var c2 = ol.proj.transform(coordinates[i + 1], sourceProj, 'EPSG:4326'); - length += wgs84Sphere.haversineDistance(c1, c2); - } - } else { - length = Math.round(line.getLength() * 100) / 100; - } - var output; - if (length > 100) { - output = (Math.round(length / 1000 * 100) / 100) + - ' ' + 'km'; - } else { - output = (Math.round(length * 100) / 100) + - ' ' + 'm'; - } - return output; -}; - - -/** - * format length output - * @param {ol.geom.Polygon} polygon - * @return {string} - */ -var formatArea = function(polygon) { - var area; - if (geodesicCheckbox.checked) { - var sourceProj = map.getView().getProjection(); - var geom = /** @type {ol.geom.Polygon} */(polygon.clone().transform( - sourceProj, 'EPSG:4326')); - var coordinates = geom.getLinearRing(0).getCoordinates(); - area = Math.abs(wgs84Sphere.geodesicArea(coordinates)); - } else { - area = polygon.getArea(); - } - var output; - if (area > 10000) { - output = (Math.round(area / 1000000 * 100) / 100) + - ' ' + 'km2'; - } else { - output = (Math.round(area * 100) / 100) + - ' ' + 'm2'; - } - return output; -}; - addInteraction(); diff --git a/examples/modify-test.js b/examples/modify-test.js index cbbe2001a1..4d7cd24782 100644 --- a/examples/modify-test.js +++ b/examples/modify-test.js @@ -54,7 +54,7 @@ var styleFunction = (function() { }), image: image }); - return function(feature, resolution) { + return function(feature) { return styles[feature.getGeometry().getType()] || styles['default']; }; })(); @@ -67,94 +67,81 @@ var geojsonObject = { 'name': 'EPSG:3857' } }, - 'features': [ - { - 'type': 'Feature', - 'geometry': { - 'type': 'Point', - 'coordinates': [0, 0] - } - }, - { - 'type': 'Feature', - 'geometry': { - 'type': 'MultiPoint', - 'coordinates': [[-2e6, 0], [0, -2e6]] - } - }, - { - 'type': 'Feature', - 'geometry': { - 'type': 'LineString', - 'coordinates': [[4e6, -2e6], [8e6, 2e6], [9e6, 2e6]] - } - }, - { - 'type': 'Feature', - 'geometry': { - 'type': 'LineString', - 'coordinates': [[4e6, -2e6], [8e6, 2e6], [8e6, 3e6]] - } - }, - { - 'type': 'Feature', - 'geometry': { - 'type': 'Polygon', - 'coordinates': [[[-5e6, -1e6], [-4e6, 1e6], - [-3e6, -1e6], [-5e6, -1e6]], [[-4.5e6, -0.5e6], - [-3.5e6, -0.5e6], [-4e6, 0.5e6], [-4.5e6, -0.5e6]]] - } - }, - { - 'type': 'Feature', - 'geometry': { - 'type': 'MultiLineString', - 'coordinates': [ - [[-1e6, -7.5e5], [-1e6, 7.5e5]], - [[-1e6, -7.5e5], [-1e6, 7.5e5], [-5e5, 0], [-1e6, -7.5e5]], - [[1e6, -7.5e5], [15e5, 0], [15e5, 0], [1e6, 7.5e5]], - [[-7.5e5, -1e6], [7.5e5, -1e6]], - [[-7.5e5, 1e6], [7.5e5, 1e6]] - ] - } - }, - { - 'type': 'Feature', - 'geometry': { - 'type': 'MultiPolygon', - 'coordinates': [ - [[[-5e6, 6e6], [-5e6, 8e6], [-3e6, 8e6], - [-3e6, 6e6], [-5e6, 6e6]]], - [[[-3e6, 6e6], [-2e6, 8e6], [0, 8e6], - [0, 6e6], [-3e6, 6e6]]], - [[[1e6, 6e6], [1e6, 8e6], [3e6, 8e6], - [3e6, 6e6], [1e6, 6e6]]] - ] - } - }, - { - 'type': 'Feature', - 'geometry': { - 'type': 'GeometryCollection', - 'geometries': [ - { - 'type': 'LineString', - 'coordinates': [[-5e6, -5e6], [0, -5e6]] - }, - { - 'type': 'Point', - 'coordinates': [4e6, -5e6] - }, - { - 'type': 'Polygon', - 'coordinates': [ - [[1e6, -6e6], [2e6, -4e6], [3e6, -6e6], [1e6, -6e6]] - ] - } - ] - } + 'features': [{ + 'type': 'Feature', + 'geometry': { + 'type': 'Point', + 'coordinates': [0, 0] } - ] + }, { + 'type': 'Feature', + 'geometry': { + 'type': 'MultiPoint', + 'coordinates': [[-2e6, 0], [0, -2e6]] + } + }, { + 'type': 'Feature', + 'geometry': { + 'type': 'LineString', + 'coordinates': [[4e6, -2e6], [8e6, 2e6], [9e6, 2e6]] + } + }, { + 'type': 'Feature', + 'geometry': { + 'type': 'LineString', + 'coordinates': [[4e6, -2e6], [8e6, 2e6], [8e6, 3e6]] + } + }, { + 'type': 'Feature', + 'geometry': { + 'type': 'Polygon', + 'coordinates': [[[-5e6, -1e6], [-4e6, 1e6], + [-3e6, -1e6], [-5e6, -1e6]], [[-4.5e6, -0.5e6], + [-3.5e6, -0.5e6], [-4e6, 0.5e6], [-4.5e6, -0.5e6]]] + } + }, { + 'type': 'Feature', + 'geometry': { + 'type': 'MultiLineString', + 'coordinates': [ + [[-1e6, -7.5e5], [-1e6, 7.5e5]], + [[-1e6, -7.5e5], [-1e6, 7.5e5], [-5e5, 0], [-1e6, -7.5e5]], + [[1e6, -7.5e5], [15e5, 0], [15e5, 0], [1e6, 7.5e5]], + [[-7.5e5, -1e6], [7.5e5, -1e6]], + [[-7.5e5, 1e6], [7.5e5, 1e6]] + ] + } + }, { + 'type': 'Feature', + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + [[[-5e6, 6e6], [-5e6, 8e6], [-3e6, 8e6], + [-3e6, 6e6], [-5e6, 6e6]]], + [[[-3e6, 6e6], [-2e6, 8e6], [0, 8e6], + [0, 6e6], [-3e6, 6e6]]], + [[[1e6, 6e6], [1e6, 8e6], [3e6, 8e6], + [3e6, 6e6], [1e6, 6e6]]] + ] + } + }, { + 'type': 'Feature', + 'geometry': { + 'type': 'GeometryCollection', + 'geometries': [{ + 'type': 'LineString', + 'coordinates': [[-5e6, -5e6], [0, -5e6]] + }, { + 'type': 'Point', + 'coordinates': [4e6, -5e6] + }, { + 'type': 'Polygon', + 'coordinates': [ + [[1e6, -6e6], [2e6, -4e6], [3e6, -6e6], [1e6, -6e6]] + ] + }] + } + }] }; var source = new ol.source.Vector({ @@ -224,7 +211,7 @@ var overlayStyle = (function() { styles['GeometryCollection'] = styles['Polygon'].concat(styles['Point']); - return function(feature, resolution) { + return function(feature) { return styles[feature.getGeometry().getType()]; }; })(); diff --git a/examples/osm-vector-tiles.js b/examples/osm-vector-tiles.js index 0631e17ec0..bef1e300e1 100644 --- a/examples/osm-vector-tiles.js +++ b/examples/osm-vector-tiles.js @@ -10,7 +10,7 @@ goog.require('ol.style.Style'); var format = new ol.format.TopoJSON(); -var tileGrid = ol.tilegrid.createXYZ({ maxZoom: 19 }); +var tileGrid = ol.tilegrid.createXYZ({maxZoom: 19}); var roadStyleCache = {}; var roadColor = { 'major_road': '#776', @@ -51,7 +51,7 @@ var map = new ol.Map({ url: 'http://{a-c}.tile.openstreetmap.us/' + 'vectiles-highroad/{z}/{x}/{y}.topojson' }), - style: function(feature, resolution) { + style: function(feature) { var kind = feature.get('kind'); var railway = feature.get('railway'); var sort_key = feature.get('sort_key'); @@ -97,7 +97,7 @@ var map = new ol.Map({ 'vectiles-land-usages/{z}/{x}/{y}.topojson' }), visible: false, - style: function(feature, resolution) { + style: function(feature) { var kind = feature.get('kind'); var styleKey = kind; var style = landuseStyleCache[styleKey]; diff --git a/examples/polygon-styles.js b/examples/polygon-styles.js index 45c40e8377..d8700c2792 100644 --- a/examples/polygon-styles.js +++ b/examples/polygon-styles.js @@ -49,40 +49,35 @@ var geojsonObject = { 'name': 'EPSG:3857' } }, - 'features': [ - { - 'type': 'Feature', - 'geometry': { - 'type': 'Polygon', - 'coordinates': [[[-5e6, 6e6], [-5e6, 8e6], [-3e6, 8e6], - [-3e6, 6e6], [-5e6, 6e6]]] - } - }, - { - 'type': 'Feature', - 'geometry': { - 'type': 'Polygon', - 'coordinates': [[[-2e6, 6e6], [-2e6, 8e6], [0, 8e6], - [0, 6e6], [-2e6, 6e6]]] - } - }, - { - 'type': 'Feature', - 'geometry': { - 'type': 'Polygon', - 'coordinates': [[[1e6, 6e6], [1e6, 8e6], [3e6, 8e6], - [3e6, 6e6], [1e6, 6e6]]] - } - }, - { - 'type': 'Feature', - 'geometry': { - 'type': 'Polygon', - 'coordinates': [[[-2e6, -1e6], [-1e6, 1e6], - [0, -1e6], [-2e6, -1e6]]] - } + 'features': [{ + 'type': 'Feature', + 'geometry': { + 'type': 'Polygon', + 'coordinates': [[[-5e6, 6e6], [-5e6, 8e6], [-3e6, 8e6], + [-3e6, 6e6], [-5e6, 6e6]]] } - ] + }, { + 'type': 'Feature', + 'geometry': { + 'type': 'Polygon', + 'coordinates': [[[-2e6, 6e6], [-2e6, 8e6], [0, 8e6], + [0, 6e6], [-2e6, 6e6]]] + } + }, { + 'type': 'Feature', + 'geometry': { + 'type': 'Polygon', + 'coordinates': [[[1e6, 6e6], [1e6, 8e6], [3e6, 8e6], + [3e6, 6e6], [1e6, 6e6]]] + } + }, { + 'type': 'Feature', + 'geometry': { + 'type': 'Polygon', + 'coordinates': [[[-2e6, -1e6], [-1e6, 1e6], + [0, -1e6], [-2e6, -1e6]]] + } + }] }; var source = new ol.source.Vector({ diff --git a/examples/popup.js b/examples/popup.js index 2afbbd125d..f25794e7f9 100644 --- a/examples/popup.js +++ b/examples/popup.js @@ -15,17 +15,6 @@ var content = document.getElementById('popup-content'); var closer = document.getElementById('popup-closer'); -/** - * Add a click handler to hide the popup. - * @return {boolean} Don't follow the href. - */ -closer.onclick = function() { - overlay.setPosition(undefined); - closer.blur(); - return false; -}; - - /** * Create an overlay to anchor the popup to the map. */ @@ -38,6 +27,17 @@ var overlay = new ol.Overlay(/** @type {olx.OverlayOptions} */ ({ })); +/** + * Add a click handler to hide the popup. + * @return {boolean} Don't follow the href. + */ +closer.onclick = function() { + overlay.setPosition(undefined); + closer.blur(); + return false; +}; + + /** * Create the map. */ diff --git a/examples/raster.js b/examples/raster.js index a400a63450..d2a29de092 100644 --- a/examples/raster.js +++ b/examples/raster.js @@ -61,6 +61,12 @@ var bing = new ol.source.BingMaps({ */ var raster = new ol.source.Raster({ sources: [bing], + /** + * Run calculations on pixel data. + * @param {Array} pixels List of pixels (one per source). + * @param {Object} data User data object. + * @return {Array} The output pixel. + */ operation: function(pixels, data) { var pixel = pixels[0]; var value = vgi(pixel); diff --git a/examples/region-growing.js b/examples/region-growing.js index b5ce834c4d..75218f5b17 100644 --- a/examples/region-growing.js +++ b/examples/region-growing.js @@ -31,7 +31,7 @@ function growRegion(inputs, data) { // As noted in the Raster source constructor, this function is provided // using the `lib` option. Other functions will NOT be visible unless // provided using the `lib` option. - var next = nextEdges(edge[i]); + var next = next4Edges(edge[i]); for (var j = 0, jj = next.length; j < jj; j++) { var s = next[j][0], t = next[j][1]; if (s >= 0 && s < width && t >= 0 && t < height) { @@ -85,7 +85,7 @@ var raster = new ol.source.Raster({ // Functions in the `lib` object will be available to the operation run in // the web worker. lib: { - nextEdges: next4Edges + next4Edges: next4Edges } }); @@ -110,6 +110,8 @@ map.on('click', function(event) { raster.changed(); }); +var thresholdControl = document.getElementById('threshold'); + raster.on('beforeoperations', function(event) { // the event.data object will be passed to operations var data = event.data; @@ -119,8 +121,6 @@ raster.on('beforeoperations', function(event) { } }); -var thresholdControl = document.getElementById('threshold'); - function updateControlValue() { document.getElementById('threshold-value').innerText = thresholdControl.value; } diff --git a/examples/render-geometry.js b/examples/render-geometry.js index 7682fbf47e..0540a66a81 100644 --- a/examples/render-geometry.js +++ b/examples/render-geometry.js @@ -10,8 +10,8 @@ goog.require('ol.style.Stroke'); var canvas = document.getElementById('canvas'); var render = ol.render.toContext(canvas.getContext('2d'), {size: [100, 100]}); -var fill = new ol.style.Fill({ color: 'blue' }); -var stroke = new ol.style.Stroke({ color: 'black' }); +var fill = new ol.style.Fill({color: 'blue'}); +var stroke = new ol.style.Stroke({color: 'black'}); render.setFillStrokeStyle(fill, stroke); render.setImageStyle(new ol.style.Circle({ radius: 10, diff --git a/examples/reprojection-by-code.js b/examples/reprojection-by-code.js index b9c0f357bb..b5fc914dde 100644 --- a/examples/reprojection-by-code.js +++ b/examples/reprojection-by-code.js @@ -7,7 +7,6 @@ goog.require('ol.source.MapQuest'); goog.require('ol.source.TileImage'); - var map = new ol.Map({ layers: [ new ol.layer.Tile({ @@ -89,18 +88,19 @@ function search(query) { /** - * @param {Event} e Change event. + * Handle click event. + * @param {Event} event The event. */ -searchButton.onclick = function(e) { +searchButton.onclick = function(event) { search(queryInput.value); - e.preventDefault(); + event.preventDefault(); }; /** - * @param {Event} e Change event. + * Handle change event. */ -renderEdgesCheckbox.onchange = function(e) { +renderEdgesCheckbox.onchange = function() { map.getLayers().forEach(function(layer) { if (layer instanceof ol.layer.Tile) { var source = layer.getSource(); diff --git a/examples/reprojection.js b/examples/reprojection.js index b460b4659f..20d4263f3e 100644 --- a/examples/reprojection.js +++ b/examples/reprojection.js @@ -192,9 +192,9 @@ function updateViewProjection() { /** - * @param {Event} e Change event. + * Handle change event. */ -viewProjSelect.onchange = function(e) { +viewProjSelect.onchange = function() { updateViewProjection(); }; @@ -211,9 +211,9 @@ var updateRenderEdgesOnLayer = function(layer) { /** - * @param {Event} e Change event. + * Handle change event. */ -baseLayerSelect.onchange = function(e) { +baseLayerSelect.onchange = function() { var layer = layers[baseLayerSelect.value]; if (layer) { layer.setOpacity(1); @@ -224,9 +224,9 @@ baseLayerSelect.onchange = function(e) { /** - * @param {Event} e Change event. + * Handle change event. */ -overlayLayerSelect.onchange = function(e) { +overlayLayerSelect.onchange = function() { var layer = layers[overlayLayerSelect.value]; if (layer) { layer.setOpacity(0.7); @@ -237,9 +237,9 @@ overlayLayerSelect.onchange = function(e) { /** - * @param {Event} e Change event. + * Handle change event. */ -renderEdgesCheckbox.onchange = function(e) { +renderEdgesCheckbox.onchange = function() { renderEdges = renderEdgesCheckbox.checked; map.getLayers().forEach(function(layer) { updateRenderEdgesOnLayer(layer); diff --git a/examples/side-by-side.js b/examples/side-by-side.js index 6d50c3f8da..d6d9c31ac5 100644 --- a/examples/side-by-side.js +++ b/examples/side-by-side.js @@ -5,7 +5,7 @@ goog.require('ol.layer.Tile'); goog.require('ol.source.MapQuest'); -var domMap = new ol.Map({ +var map1 = new ol.Map({ layers: [ new ol.layer.Tile({ source: new ol.source.MapQuest({layer: 'sat'}) @@ -19,12 +19,18 @@ var domMap = new ol.Map({ }) }); +var map2 = new ol.Map({ + target: 'canvasMap', + layers: map1.getLayers(), + view: map1.getView() +}); + if (ol.has.WEBGL) { - var webglMap = new ol.Map({ + var map3 = new ol.Map({ renderer: 'webgl', target: 'webglMap', - layers: domMap.getLayers(), - view: domMap.getView() + layers: map1.getLayers(), + view: map1.getView() }); } else { var info = document.getElementById('no-webgl'); @@ -33,9 +39,3 @@ if (ol.has.WEBGL) { */ info.style.display = ''; } - -var canvasMap = new ol.Map({ - target: 'canvasMap', - layers: domMap.getLayers(), - view: domMap.getView() -}); diff --git a/examples/snap.js b/examples/snap.js index 3c9e4a31d7..5d8924225c 100644 --- a/examples/snap.js +++ b/examples/snap.js @@ -72,6 +72,7 @@ var Modify = { }; Modify.init(); +var optionsForm = document.getElementById('options-form'); var Draw = { init: function() { @@ -111,8 +112,6 @@ var Draw = { }; Draw.init(); -var optionsForm = document.getElementById('options-form'); - /** * Let user change the geometry type. diff --git a/examples/sphere-mollweide.js b/examples/sphere-mollweide.js index a3c1ad7c9f..0039afcbce 100644 --- a/examples/sphere-mollweide.js +++ b/examples/sphere-mollweide.js @@ -39,6 +39,6 @@ var map = new ol.Map({ }) }); -var graticule = new ol.Graticule({ +new ol.Graticule({ map: map }); diff --git a/examples/synthetic-points.js b/examples/synthetic-points.js index 348b6979d7..3056132a40 100644 --- a/examples/synthetic-points.js +++ b/examples/synthetic-points.js @@ -45,7 +45,7 @@ var vectorSource = new ol.source.Vector({ }); var vector = new ol.layer.Vector({ source: vectorSource, - style: function(feature, resolution) { + style: function(feature) { return styles[feature.get('size')]; } }); diff --git a/examples/tile-load-events.js b/examples/tile-load-events.js index b4da086502..abf75deec6 100644 --- a/examples/tile-load-events.js +++ b/examples/tile-load-events.js @@ -4,7 +4,6 @@ goog.require('ol.layer.Tile'); goog.require('ol.source.TileJSON'); - /** * Renders a progress bar. * @param {Element} el The target element. @@ -83,14 +82,14 @@ var source = new ol.source.TileJSON({ crossOrigin: 'anonymous' }); -source.on('tileloadstart', function(event) { +source.on('tileloadstart', function() { progress.addLoading(); }); -source.on('tileloadend', function(event) { +source.on('tileloadend', function() { progress.addLoaded(); }); -source.on('tileloaderror', function(event) { +source.on('tileloaderror', function() { progress.addLoaded(); }); diff --git a/examples/topojson.js b/examples/topojson.js index 6f2a6d84d8..551636788a 100644 --- a/examples/topojson.js +++ b/examples/topojson.js @@ -31,7 +31,7 @@ var vector = new ol.layer.Vector({ url: 'data/topojson/world-110m.json', format: new ol.format.TopoJSON() }), - style: function(feature, resolution) { + style: function(feature) { // don't want to render the full world polygon, which repeats all countries return feature.getId() !== undefined ? style : null; } diff --git a/examples/vector-esri-edit.js b/examples/vector-esri-edit.js index d646f18b26..184ff5f85e 100644 --- a/examples/vector-esri-edit.js +++ b/examples/vector-esri-edit.js @@ -53,6 +53,19 @@ var vector = new ol.layer.Vector({ source: vectorSource }); +var attribution = new ol.Attribution({ + html: 'Tiles © ArcGIS' +}); + +var raster = new ol.layer.Tile({ + source: new ol.source.XYZ({ + attributions: [attribution], + url: 'http://server.arcgisonline.com/ArcGIS/rest/services/' + + 'World_Topo_Map/MapServer/tile/{z}/{y}/{x}' + }) +}); + var draw = new ol.interaction.Draw({ source: vectorSource, type: /** @type {ol.geom.GeometryType} */ ('Polygon') @@ -67,14 +80,23 @@ var modify = new ol.interaction.Modify({ }); modify.setActive(false); +var map = new ol.Map({ + interactions: ol.interaction.defaults().extend([draw, select, modify]), + layers: [raster, vector], + target: document.getElementById('map'), + view: new ol.View({ + center: ol.proj.transform([-122.619, 45.512], 'EPSG:4326', 'EPSG:3857'), + zoom: 12 + }) +}); + var typeSelect = document.getElementById('type'); /** * Let user change the interaction type. - * @param {Event} e Change event. */ -typeSelect.onchange = function(e) { +typeSelect.onchange = function() { draw.setActive(typeSelect.value === 'DRAW'); select.setActive(typeSelect.value === 'MODIFY'); modify.setActive(typeSelect.value === 'MODIFY'); @@ -97,7 +119,7 @@ selected.on('remove', function(evt) { featureProjection: map.getView().getProjection() }) + ']'; var url = serviceUrl + layer + '/updateFeatures'; - $.post(url, { f: 'json', features: payload }).done(function(data) { + $.post(url, {f: 'json', features: payload}).done(function(data) { var result = JSON.parse(data); if (result.updateResults && result.updateResults.length > 0) { if (result.updateResults[0].success !== true) { @@ -117,7 +139,7 @@ draw.on('drawend', function(evt) { featureProjection: map.getView().getProjection() }) + ']'; var url = serviceUrl + layer + '/addFeatures'; - $.post(url, { f: 'json', features: payload }).done(function(data) { + $.post(url, {f: 'json', features: payload}).done(function(data) { var result = JSON.parse(data); if (result.addResults && result.addResults.length > 0) { if (result.addResults[0].success === true) { @@ -130,26 +152,3 @@ draw.on('drawend', function(evt) { } }); }); - -var attribution = new ol.Attribution({ - html: 'Tiles © ArcGIS' -}); - -var raster = new ol.layer.Tile({ - source: new ol.source.XYZ({ - attributions: [attribution], - url: 'http://server.arcgisonline.com/ArcGIS/rest/services/' + - 'World_Topo_Map/MapServer/tile/{z}/{y}/{x}' - }) -}); - -var map = new ol.Map({ - interactions: ol.interaction.defaults().extend([draw, select, modify]), - layers: [raster, vector], - target: document.getElementById('map'), - view: new ol.View({ - center: ol.proj.transform([-122.619, 45.512], 'EPSG:4326', 'EPSG:3857'), - zoom: 12 - }) -}); diff --git a/examples/vector-esri.js b/examples/vector-esri.js index 640b3bd73a..9875f67aa5 100644 --- a/examples/vector-esri.js +++ b/examples/vector-esri.js @@ -89,7 +89,7 @@ var vectorSource = new ol.source.Vector({ var vector = new ol.layer.Vector({ source: vectorSource, - style: function(feature, resolution) { + style: function(feature) { var classify = feature.get('activeprod'); return styleCache[classify]; } @@ -120,7 +120,7 @@ var map = new ol.Map({ var displayFeatureInfo = function(pixel) { var features = []; - map.forEachFeatureAtPixel(pixel, function(feature, layer) { + map.forEachFeatureAtPixel(pixel, function(feature) { features.push(feature); }); if (features.length > 0) { diff --git a/examples/vector-labels.js b/examples/vector-labels.js index f016a2f1f2..9b4ec827a8 100644 --- a/examples/vector-labels.js +++ b/examples/vector-labels.js @@ -215,7 +215,8 @@ String.prototype.trunc = String.prototype.trunc || function stringDivider(str, width, spaceReplacer) { if (str.length > width) { var p = width; - for (; p > 0 && (str[p] != ' ' && str[p] != '-'); p--) { + while (p > 0 && (str[p] != ' ' && str[p] != '-')) { + p--; } if (p > 0) { var left; diff --git a/examples/vector-layer.js b/examples/vector-layer.js index 794058609f..05bfa9da64 100644 --- a/examples/vector-layer.js +++ b/examples/vector-layer.js @@ -92,7 +92,7 @@ var featureOverlay = new ol.layer.Vector({ var highlight; var displayFeatureInfo = function(pixel) { - var feature = map.forEachFeatureAtPixel(pixel, function(feature, layer) { + var feature = map.forEachFeatureAtPixel(pixel, function(feature) { return feature; }); diff --git a/examples/vector-osm.js b/examples/vector-osm.js index 81d8e77b45..92df3b7214 100644 --- a/examples/vector-osm.js +++ b/examples/vector-osm.js @@ -90,7 +90,7 @@ var vectorSource = new ol.source.Vector({ var vector = new ol.layer.Vector({ source: vectorSource, - style: function(feature, resolution) { + style: function(feature) { for (var key in styles) { var value = feature.get(key); if (value !== undefined) { diff --git a/examples/vector-wfs.js b/examples/vector-wfs.js index eb9bede9e4..96da3fbb6d 100644 --- a/examples/vector-wfs.js +++ b/examples/vector-wfs.js @@ -10,10 +10,9 @@ goog.require('ol.style.Stroke'); goog.require('ol.style.Style'); - var vectorSource = new ol.source.Vector({ format: new ol.format.GeoJSON(), - url: function(extent, resolution, projection) { + url: function(extent) { return 'http://demo.boundlessgeo.com/geoserver/wfs?service=WFS&' + 'version=1.1.0&request=GetFeature&typename=osm:water_areas&' + 'outputFormat=application/json&srsname=EPSG:3857&' + diff --git a/examples/wms-custom-proj.js b/examples/wms-custom-proj.js index 3afa7784e3..d01fdcd0ed 100644 --- a/examples/wms-custom-proj.js +++ b/examples/wms-custom-proj.js @@ -9,7 +9,6 @@ goog.require('ol.proj.Projection'); goog.require('ol.source.TileWMS'); - // By default OpenLayers does not know about the EPSG:21781 (Swiss) projection. // So we create a projection instance for EPSG:21781 and pass it to // ol.proj.addProjection to make it available to the library for lookup by its @@ -97,7 +96,6 @@ var map = new ol.Map({ }); - /* * Swiss projection transform functions downloaded from * http://www.swisstopo.admin.ch/internet/swisstopo/en/home/products/software/products/skripts.html @@ -202,19 +200,6 @@ function CHtoWGSlng(y, x) { } -// Convert SEX DMS angle to DEC -function SEXtoDEC(angle) { - - // Extract DMS - var deg = parseInt(angle, 10); - var min = parseInt((angle - deg) * 100, 10); - var sec = (((angle - deg) * 100) - min) * 100; - - // Result in degrees sex (dd.mmss) - return deg + (sec / 60 + min) / 60; - -} - // Convert DEC angle to SEX DMS function DECtoSEX(angle) { diff --git a/examples/zoomify.js b/examples/zoomify.js index 6421960aad..d9d89ab2e4 100644 --- a/examples/zoomify.js +++ b/examples/zoomify.js @@ -8,7 +8,7 @@ goog.require('ol.source.Zoomify'); var imgWidth = 9911; var imgHeight = 6100; -var imgCenter = [imgWidth / 2, - imgHeight / 2]; +var imgCenter = [imgWidth / 2, -imgHeight / 2]; // Maps always need a projection, but Zoomify layers are not geo-referenced, and // are only measured in pixels. So, we create a fake projection that the map diff --git a/examples/zoomslider.js b/examples/zoomslider.js index 97cd8385e7..200891f5c1 100644 --- a/examples/zoomslider.js +++ b/examples/zoomslider.js @@ -12,7 +12,7 @@ goog.require('ol.source.MapQuest'); * @return {ol.Map} The ol.Map instance. */ var createMap = function(divId) { - var source, layer, map, zoomslider, resolutions; + var source, layer, map, zoomslider; source = new ol.source.MapQuest({layer: 'sat'}); layer = new ol.layer.Tile({ diff --git a/package.json b/package.json index b60fef141e..0a820a8a80 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "install": "node tasks/install.js", "postinstall": "closure-util update", "start": "node tasks/serve.js", + "pretest": "eslint tasks test test_rendering src examples", "test": "node tasks/test.js", "debug-server": "node tasks/serve-lib.js" }, @@ -53,11 +54,12 @@ "clean-css": "3.4.9", "coveralls": "2.11.6", "debounce": "^1.0.0", + "eslint": "v2.0.0-beta.1", + "eslint-config-openlayers": "^2.0.0", "expect.js": "0.3.1", "gaze": "^0.5.1", "istanbul": "0.4.1", "jquery": "2.1.4", - "jshint": "2.8.0", "mocha": "2.3.4", "mocha-phantomjs-core": "^1.3.0", "mustache": "2.2.1", @@ -68,6 +70,22 @@ "slimerjs-edge": "0.10.0-pre-3", "wrench": "1.5.8" }, + "eslintConfig": { + "extends": "openlayers", + "globals": { + "ArrayBuffer": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "ol": false, + "goog": false, + "proj4": false + }, + "rules": { + "no-constant-condition": 0 + } + }, "ext": [ "rbush", { diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 51ef3c38d5..0000000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -http://closure-linter.googlecode.com/files/closure_linter-latest.tar.gz diff --git a/src/ol/attribution.js b/src/ol/attribution.js index 45c32d9dfe..9ed407153f 100644 --- a/src/ol/attribution.js +++ b/src/ol/attribution.js @@ -4,7 +4,6 @@ goog.require('goog.math'); goog.require('ol.TileRange'); - /** * @classdesc * An attribution for a layer source. @@ -59,8 +58,7 @@ ol.Attribution.prototype.getHTML = function() { * @param {!ol.proj.Projection} projection Projection. * @return {boolean} Intersects any tile range. */ -ol.Attribution.prototype.intersectsAnyTileRange = - function(tileRanges, tileGrid, projection) { +ol.Attribution.prototype.intersectsAnyTileRange = function(tileRanges, tileGrid, projection) { if (!this.tileRanges_) { return true; } diff --git a/src/ol/centerconstraint.js b/src/ol/centerconstraint.js index b02dd21fa4..e1d1a9705a 100644 --- a/src/ol/centerconstraint.js +++ b/src/ol/centerconstraint.js @@ -12,7 +12,7 @@ ol.CenterConstraintType; /** * @param {ol.Extent} extent Extent. - * @return {ol.CenterConstraintType} + * @return {ol.CenterConstraintType} The constraint. */ ol.CenterConstraint.createExtent = function(extent) { return ( diff --git a/src/ol/collection.js b/src/ol/collection.js index 91050cae02..005947634c 100644 --- a/src/ol/collection.js +++ b/src/ol/collection.js @@ -31,7 +31,6 @@ ol.CollectionEventType = { }; - /** * @classdesc * Events emitted by {@link ol.Collection} instances are instances of this @@ -67,7 +66,6 @@ ol.CollectionProperty = { }; - /** * @classdesc * An expanded version of standard JS Array, adding convenience methods for diff --git a/src/ol/color/color.js b/src/ol/color/color.js index 81225c3bc6..105fe5e387 100644 --- a/src/ol/color/color.js +++ b/src/ol/color/color.js @@ -145,9 +145,6 @@ ol.color.equals = function(color1, color2) { * @return {ol.Color} Color. */ ol.color.fromString = ( - /** - * @return {function(string): ol.Color} - */ function() { // We maintain a small cache of parsed strings. To provide cheap LRU-like diff --git a/src/ol/constraints.js b/src/ol/constraints.js index 84fc289b6f..2b5344c1a1 100644 --- a/src/ol/constraints.js +++ b/src/ol/constraints.js @@ -5,7 +5,6 @@ goog.require('ol.ResolutionConstraintType'); goog.require('ol.RotationConstraintType'); - /** * @constructor * @param {ol.CenterConstraintType} centerConstraint Center constraint. @@ -14,8 +13,7 @@ goog.require('ol.RotationConstraintType'); * @param {ol.RotationConstraintType} rotationConstraint * Rotation constraint. */ -ol.Constraints = - function(centerConstraint, resolutionConstraint, rotationConstraint) { +ol.Constraints = function(centerConstraint, resolutionConstraint, rotationConstraint) { /** * @type {ol.CenterConstraintType} diff --git a/src/ol/control/attributioncontrol.js b/src/ol/control/attributioncontrol.js index 28e2f4a256..7bbe152f72 100644 --- a/src/ol/control/attributioncontrol.js +++ b/src/ol/control/attributioncontrol.js @@ -16,7 +16,6 @@ goog.require('ol.css'); goog.require('ol.source.Tile'); - /** * @classdesc * Control to show all the attributions associated with the layer sources @@ -238,16 +237,14 @@ ol.control.Attribution.prototype.updateElement_ = function(frameState) { this.attributionElementRenderedVisible_[attributionKey] = true; } delete visibleAttributions[attributionKey]; - } - else if (attributionKey in hiddenAttributions) { + } else if (attributionKey in hiddenAttributions) { if (this.attributionElementRenderedVisible_[attributionKey]) { goog.style.setElementShown( this.attributionElements_[attributionKey], false); delete this.attributionElementRenderedVisible_[attributionKey]; } delete hiddenAttributions[attributionKey]; - } - else { + } else { goog.dom.removeNode(this.attributionElements_[attributionKey]); delete this.attributionElements_[attributionKey]; delete this.attributionElementRenderedVisible_[attributionKey]; diff --git a/src/ol/control/control.js b/src/ol/control/control.js index 74f78545bd..20350fc5b4 100644 --- a/src/ol/control/control.js +++ b/src/ol/control/control.js @@ -7,7 +7,6 @@ goog.require('ol.MapEventType'); goog.require('ol.Object'); - /** * @classdesc * A control is a visible widget with a DOM element in a fixed position on the diff --git a/src/ol/control/fullscreencontrol.js b/src/ol/control/fullscreencontrol.js index b4e1531e7d..78534dd1fe 100644 --- a/src/ol/control/fullscreencontrol.js +++ b/src/ol/control/fullscreencontrol.js @@ -12,7 +12,6 @@ goog.require('ol.control.Control'); goog.require('ol.css'); - /** * @classdesc * Provides a button that when clicked fills up the full screen with the map. diff --git a/src/ol/control/mousepositioncontrol.js b/src/ol/control/mousepositioncontrol.js index d3ac82736a..d2f18b4aee 100644 --- a/src/ol/control/mousepositioncontrol.js +++ b/src/ol/control/mousepositioncontrol.js @@ -23,7 +23,6 @@ ol.control.MousePositionProperty = { }; - /** * @classdesc * A control to show the 2D coordinates of the mouse cursor. By default, these diff --git a/src/ol/control/overviewmapcontrol.js b/src/ol/control/overviewmapcontrol.js index e19bd14d64..1490832597 100644 --- a/src/ol/control/overviewmapcontrol.js +++ b/src/ol/control/overviewmapcontrol.js @@ -23,7 +23,6 @@ goog.require('ol.css'); goog.require('ol.extent'); - /** * Create a new control with a map acting as an overview map for an other * defined map. diff --git a/src/ol/control/rotatecontrol.js b/src/ol/control/rotatecontrol.js index 9d8facd3e6..378a47f4c6 100644 --- a/src/ol/control/rotatecontrol.js +++ b/src/ol/control/rotatecontrol.js @@ -11,7 +11,6 @@ goog.require('ol.css'); goog.require('ol.easing'); - /** * @classdesc * A button control to reset rotation to 0. diff --git a/src/ol/control/scalelinecontrol.js b/src/ol/control/scalelinecontrol.js index fdb61c2227..d1d22e34ec 100644 --- a/src/ol/control/scalelinecontrol.js +++ b/src/ol/control/scalelinecontrol.js @@ -37,7 +37,6 @@ ol.control.ScaleLineUnits = { }; - /** * @classdesc * A control displaying rough x-axis distances, calculated for the center of the diff --git a/src/ol/control/zoomcontrol.js b/src/ol/control/zoomcontrol.js index c963b41032..8dc740e447 100644 --- a/src/ol/control/zoomcontrol.js +++ b/src/ol/control/zoomcontrol.js @@ -9,7 +9,6 @@ goog.require('ol.css'); goog.require('ol.easing'); - /** * @classdesc * A control with 2 buttons, one for zoom in and one for zoom out. diff --git a/src/ol/control/zoomslidercontrol.js b/src/ol/control/zoomslidercontrol.js index 92905e89c9..cfc7a3f807 100644 --- a/src/ol/control/zoomslidercontrol.js +++ b/src/ol/control/zoomslidercontrol.js @@ -21,7 +21,6 @@ goog.require('ol.easing'); goog.require('ol.math'); - /** * @classdesc * A slider type of control for zooming. diff --git a/src/ol/control/zoomtoextentcontrol.js b/src/ol/control/zoomtoextentcontrol.js index 2cb0706dcc..90758326da 100644 --- a/src/ol/control/zoomtoextentcontrol.js +++ b/src/ol/control/zoomtoextentcontrol.js @@ -8,7 +8,6 @@ goog.require('ol.control.Control'); goog.require('ol.css'); - /** * @classdesc * A button control which, when pressed, changes the map view to a specific diff --git a/src/ol/deviceorientation.js b/src/ol/deviceorientation.js index a1724f559b..55fcf0a716 100644 --- a/src/ol/deviceorientation.js +++ b/src/ol/deviceorientation.js @@ -20,7 +20,6 @@ ol.DeviceOrientationProperty = { }; - /** * @classdesc * The ol.DeviceOrientation class provides access to information from diff --git a/src/ol/dom/dom.js b/src/ol/dom/dom.js index 1fa51ed61b..2ce721b6de 100644 --- a/src/ol/dom/dom.js +++ b/src/ol/dom/dom.js @@ -14,7 +14,7 @@ goog.require('ol'); * Create an html canvas element and returns its 2d context. * @param {number=} opt_width Canvas width. * @param {number=} opt_height Canvas height. - * @return {CanvasRenderingContext2D} + * @return {CanvasRenderingContext2D} The context. */ ol.dom.createCanvasContext2D = function(opt_width, opt_height) { var canvas = document.createElement('CANVAS'); @@ -196,7 +196,7 @@ ol.dom.transformElement2D = function(element, transform, opt_precision) { * padding and border. * Equivalent to jQuery's `$(el).outerWidth(true)`. * @param {!Element} element Element. - * @return {number} + * @return {number} The width. */ ol.dom.outerWidth = function(element) { var width = element.offsetWidth; @@ -212,7 +212,7 @@ ol.dom.outerWidth = function(element) { * padding and border. * Equivalent to jQuery's `$(el).outerHeight(true)`. * @param {!Element} element Element. - * @return {number} + * @return {number} The height. */ ol.dom.outerHeight = function(element) { var height = element.offsetHeight; diff --git a/src/ol/extent.js b/src/ol/extent.js index 086f7e433d..2ce48e6fff 100644 --- a/src/ol/extent.js +++ b/src/ol/extent.js @@ -301,8 +301,7 @@ ol.extent.createOrUpdateFromCoordinates = function(coordinates, opt_extent) { * @param {ol.Extent=} opt_extent Extent. * @return {ol.Extent} Extent. */ -ol.extent.createOrUpdateFromFlatCoordinates = - function(flatCoordinates, offset, end, stride, opt_extent) { +ol.extent.createOrUpdateFromFlatCoordinates = function(flatCoordinates, offset, end, stride, opt_extent) { var extent = ol.extent.createOrUpdateEmpty(opt_extent); return ol.extent.extendFlatCoordinates( extent, flatCoordinates, offset, end, stride); @@ -411,8 +410,7 @@ ol.extent.extendCoordinates = function(extent, coordinates) { * @param {number} stride Stride. * @return {ol.Extent} Extent. */ -ol.extent.extendFlatCoordinates = - function(extent, flatCoordinates, offset, end, stride) { +ol.extent.extendFlatCoordinates = function(extent, flatCoordinates, offset, end, stride) { for (; offset < end; offset += stride) { ol.extent.extendXY( extent, flatCoordinates[offset], flatCoordinates[offset + 1]); @@ -572,8 +570,7 @@ ol.extent.getEnlargedArea = function(extent1, extent2) { * @param {ol.Extent=} opt_extent Destination extent. * @return {ol.Extent} Extent. */ -ol.extent.getForViewAndSize = - function(center, resolution, rotation, size, opt_extent) { +ol.extent.getForViewAndSize = function(center, resolution, rotation, size, opt_extent) { var dx = resolution * size[0] / 2; var dy = resolution * size[1] / 2; var cosRotation = Math.cos(rotation); diff --git a/src/ol/feature.js b/src/ol/feature.js index 0088e93c76..3ef0523f5e 100644 --- a/src/ol/feature.js +++ b/src/ol/feature.js @@ -10,7 +10,6 @@ goog.require('ol.geom.Geometry'); goog.require('ol.style.Style'); - /** * @classdesc * A vector object for geographic features with a geometry and other diff --git a/src/ol/format/esrijsonformat.js b/src/ol/format/esrijsonformat.js index 4465a30a82..5831756aa5 100644 --- a/src/ol/format/esrijsonformat.js +++ b/src/ol/format/esrijsonformat.js @@ -20,7 +20,6 @@ goog.require('ol.geom.flat.orient'); goog.require('ol.proj'); - /** * @classdesc * Feature format for reading and writing data in the EsriJSON format. @@ -353,8 +352,7 @@ ol.format.EsriJSON.writePolygonGeometry_ = function(geometry, opt_options) { * @private * @return {EsriJSONPolyline} EsriJSON geometry. */ -ol.format.EsriJSON.writeMultiLineStringGeometry_ = - function(geometry, opt_options) { +ol.format.EsriJSON.writeMultiLineStringGeometry_ = function(geometry, opt_options) { goog.asserts.assertInstanceof(geometry, ol.geom.MultiLineString, 'geometry should be an ol.geom.MultiLineString'); var hasZM = ol.format.EsriJSON.getHasZM_(geometry); @@ -688,8 +686,7 @@ ol.format.EsriJSON.prototype.writeFeatures; * @return {Object} EsriJSON Object. * @api */ -ol.format.EsriJSON.prototype.writeFeaturesObject = - function(features, opt_options) { +ol.format.EsriJSON.prototype.writeFeaturesObject = function(features, opt_options) { opt_options = this.adaptOptions(opt_options); var objects = []; var i, ii; diff --git a/src/ol/format/featureformat.js b/src/ol/format/featureformat.js index 419f3376e8..c0bfafdaa9 100644 --- a/src/ol/format/featureformat.js +++ b/src/ol/format/featureformat.js @@ -4,7 +4,6 @@ goog.require('ol.geom.Geometry'); goog.require('ol.proj'); - /** * @classdesc * Abstract base class; normally only used for creating subclasses and not diff --git a/src/ol/format/geojsonformat.js b/src/ol/format/geojsonformat.js index c96a1d9ac6..a92cb63c69 100644 --- a/src/ol/format/geojsonformat.js +++ b/src/ol/format/geojsonformat.js @@ -18,7 +18,6 @@ goog.require('ol.geom.Polygon'); goog.require('ol.proj'); - /** * @classdesc * Feature format for reading and writing data in the GeoJSON format. @@ -243,8 +242,7 @@ ol.format.GeoJSON.writeLineStringGeometry_ = function(geometry, opt_options) { * @private * @return {GeoJSONGeometry} GeoJSON geometry. */ -ol.format.GeoJSON.writeMultiLineStringGeometry_ = - function(geometry, opt_options) { +ol.format.GeoJSON.writeMultiLineStringGeometry_ = function(geometry, opt_options) { goog.asserts.assertInstanceof(geometry, ol.geom.MultiLineString, 'geometry should be an ol.geom.MultiLineString'); return /** @type {GeoJSONGeometry} */ ({ @@ -572,8 +570,7 @@ ol.format.GeoJSON.prototype.writeFeatures; * @return {GeoJSONFeatureCollection} GeoJSON Object. * @api stable */ -ol.format.GeoJSON.prototype.writeFeaturesObject = - function(features, opt_options) { +ol.format.GeoJSON.prototype.writeFeaturesObject = function(features, opt_options) { opt_options = this.adaptOptions(opt_options); var objects = []; var i, ii; diff --git a/src/ol/format/gml/gml2format.js b/src/ol/format/gml/gml2format.js index 8255e28fa7..ff91f43de6 100644 --- a/src/ol/format/gml/gml2format.js +++ b/src/ol/format/gml/gml2format.js @@ -9,7 +9,6 @@ goog.require('ol.proj'); goog.require('ol.xml'); - /** * @classdesc * Feature format for reading and writing data in the GML format, @@ -120,8 +119,7 @@ ol.format.GML2.prototype.readBox_ = function(node, objectStack) { * @param {Array.<*>} objectStack Object stack. * @private */ -ol.format.GML2.prototype.innerBoundaryIsParser_ = - function(node, objectStack) { +ol.format.GML2.prototype.innerBoundaryIsParser_ = function(node, objectStack) { goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT, 'node.nodeType should be ELEMENT'); goog.asserts.assert(node.localName == 'innerBoundaryIs', @@ -146,8 +144,7 @@ ol.format.GML2.prototype.innerBoundaryIsParser_ = * @param {Array.<*>} objectStack Object stack. * @private */ -ol.format.GML2.prototype.outerBoundaryIsParser_ = - function(node, objectStack) { +ol.format.GML2.prototype.outerBoundaryIsParser_ = function(node, objectStack) { goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT, 'node.nodeType should be ELEMENT'); goog.asserts.assert(node.localName == 'outerBoundaryIs', diff --git a/src/ol/format/gml/gml3format.js b/src/ol/format/gml/gml3format.js index 4248ab411b..30242c0a60 100644 --- a/src/ol/format/gml/gml3format.js +++ b/src/ol/format/gml/gml3format.js @@ -23,7 +23,6 @@ goog.require('ol.proj'); goog.require('ol.xml'); - /** * @classdesc * Feature format for reading and writing data in the GML format @@ -224,8 +223,7 @@ ol.format.GML3.prototype.readPolygonPatch_ = function(node, objectStack) { * @private * @return {Array.|undefined} flat coordinates. */ -ol.format.GML3.prototype.readLineStringSegment_ = - function(node, objectStack) { +ol.format.GML3.prototype.readLineStringSegment_ = function(node, objectStack) { goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT, 'node.nodeType should be ELEMENT'); goog.asserts.assert(node.localName == 'LineStringSegment', @@ -661,7 +659,7 @@ ol.format.GML3.prototype.writePos_ = function(node, value, objectStack) { /** * @param {Array.} point Point geometry. * @param {string=} opt_srsName Optional srsName - * @return {string} + * @return {string} The coords string. * @private */ ol.format.GML3.prototype.getCoords_ = function(point, opt_srsName) { @@ -758,8 +756,7 @@ ol.format.GML3.prototype.writeEnvelope = function(node, extent, objectStack) { * @param {Array.<*>} objectStack Node stack. * @private */ -ol.format.GML3.prototype.writeLinearRing_ = - function(node, geometry, objectStack) { +ol.format.GML3.prototype.writeLinearRing_ = function(node, geometry, objectStack) { var context = objectStack[objectStack.length - 1]; goog.asserts.assert(goog.isObject(context), 'context should be an Object'); var srsName = context['srsName']; @@ -779,8 +776,7 @@ ol.format.GML3.prototype.writeLinearRing_ = * @return {Node} Node. * @private */ -ol.format.GML3.prototype.RING_NODE_FACTORY_ = - function(value, objectStack, opt_nodeName) { +ol.format.GML3.prototype.RING_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) { var context = objectStack[objectStack.length - 1]; var parentNode = context.node; goog.asserts.assert(goog.isObject(context), 'context should be an Object'); @@ -799,8 +795,7 @@ ol.format.GML3.prototype.RING_NODE_FACTORY_ = * @param {Array.<*>} objectStack Node stack. * @private */ -ol.format.GML3.prototype.writeSurfaceOrPolygon_ = - function(node, geometry, objectStack) { +ol.format.GML3.prototype.writeSurfaceOrPolygon_ = function(node, geometry, objectStack) { var context = objectStack[objectStack.length - 1]; goog.asserts.assert(goog.isObject(context), 'context should be an Object'); var srsName = context['srsName']; @@ -829,8 +824,7 @@ ol.format.GML3.prototype.writeSurfaceOrPolygon_ = * @param {Array.<*>} objectStack Node stack. * @private */ -ol.format.GML3.prototype.writeCurveOrLineString_ = - function(node, geometry, objectStack) { +ol.format.GML3.prototype.writeCurveOrLineString_ = function(node, geometry, objectStack) { var context = objectStack[objectStack.length - 1]; goog.asserts.assert(goog.isObject(context), 'context should be an Object'); var srsName = context['srsName']; @@ -857,8 +851,7 @@ ol.format.GML3.prototype.writeCurveOrLineString_ = * @param {Array.<*>} objectStack Node stack. * @private */ -ol.format.GML3.prototype.writeMultiSurfaceOrPolygon_ = - function(node, geometry, objectStack) { +ol.format.GML3.prototype.writeMultiSurfaceOrPolygon_ = function(node, geometry, objectStack) { var context = objectStack[objectStack.length - 1]; goog.asserts.assert(goog.isObject(context), 'context should be an Object'); var srsName = context['srsName']; @@ -902,8 +895,7 @@ ol.format.GML3.prototype.writeMultiPoint_ = function(node, geometry, * @param {Array.<*>} objectStack Node stack. * @private */ -ol.format.GML3.prototype.writeMultiCurveOrLineString_ = - function(node, geometry, objectStack) { +ol.format.GML3.prototype.writeMultiCurveOrLineString_ = function(node, geometry, objectStack) { var context = objectStack[objectStack.length - 1]; goog.asserts.assert(goog.isObject(context), 'context should be an Object'); var srsName = context['srsName']; @@ -938,8 +930,7 @@ ol.format.GML3.prototype.writeRing_ = function(node, ring, objectStack) { * @param {Array.<*>} objectStack Node stack. * @private */ -ol.format.GML3.prototype.writeSurfaceOrPolygonMember_ = - function(node, polygon, objectStack) { +ol.format.GML3.prototype.writeSurfaceOrPolygonMember_ = function(node, polygon, objectStack) { var context = objectStack[objectStack.length - 1]; goog.asserts.assert(goog.isObject(context), 'context should be an Object'); var child = this.GEOMETRY_NODE_FACTORY_( @@ -957,8 +948,7 @@ ol.format.GML3.prototype.writeSurfaceOrPolygonMember_ = * @param {Array.<*>} objectStack Node stack. * @private */ -ol.format.GML3.prototype.writePointMember_ = - function(node, point, objectStack) { +ol.format.GML3.prototype.writePointMember_ = function(node, point, objectStack) { var child = ol.xml.createElementNS(node.namespaceURI, 'Point'); node.appendChild(child); this.writePoint_(child, point, objectStack); @@ -971,8 +961,7 @@ ol.format.GML3.prototype.writePointMember_ = * @param {Array.<*>} objectStack Node stack. * @private */ -ol.format.GML3.prototype.writeLineStringOrCurveMember_ = - function(node, line, objectStack) { +ol.format.GML3.prototype.writeLineStringOrCurveMember_ = function(node, line, objectStack) { var context = objectStack[objectStack.length - 1]; goog.asserts.assert(goog.isObject(context), 'context should be an Object'); var child = this.GEOMETRY_NODE_FACTORY_(line, objectStack); @@ -989,8 +978,7 @@ ol.format.GML3.prototype.writeLineStringOrCurveMember_ = * @param {Array.<*>} objectStack Node stack. * @private */ -ol.format.GML3.prototype.writeSurfacePatches_ = - function(node, polygon, objectStack) { +ol.format.GML3.prototype.writeSurfacePatches_ = function(node, polygon, objectStack) { var child = ol.xml.createElementNS(node.namespaceURI, 'PolygonPatch'); node.appendChild(child); this.writeSurfaceOrPolygon_(child, polygon, objectStack); @@ -1003,8 +991,7 @@ ol.format.GML3.prototype.writeSurfacePatches_ = * @param {Array.<*>} objectStack Node stack. * @private */ -ol.format.GML3.prototype.writeCurveSegments_ = - function(node, line, objectStack) { +ol.format.GML3.prototype.writeCurveSegments_ = function(node, line, objectStack) { var child = ol.xml.createElementNS(node.namespaceURI, 'LineStringSegment'); node.appendChild(child); @@ -1017,8 +1004,7 @@ ol.format.GML3.prototype.writeCurveSegments_ = * @param {ol.geom.Geometry|ol.Extent} geometry Geometry. * @param {Array.<*>} objectStack Node stack. */ -ol.format.GML3.prototype.writeGeometryElement = - function(node, geometry, objectStack) { +ol.format.GML3.prototype.writeGeometryElement = function(node, geometry, objectStack) { var context = objectStack[objectStack.length - 1]; goog.asserts.assert(goog.isObject(context), 'context should be an Object'); var item = goog.object.clone(context); @@ -1049,8 +1035,7 @@ ol.format.GML3.prototype.writeGeometryElement = * @param {ol.Feature} feature Feature. * @param {Array.<*>} objectStack Node stack. */ -ol.format.GML3.prototype.writeFeatureElement = - function(node, feature, objectStack) { +ol.format.GML3.prototype.writeFeatureElement = function(node, feature, objectStack) { var fid = feature.getId(); if (fid) { node.setAttribute('fid', fid); @@ -1099,8 +1084,7 @@ ol.format.GML3.prototype.writeFeatureElement = * @param {Array.<*>} objectStack Node stack. * @private */ -ol.format.GML3.prototype.writeFeatureMembers_ = - function(node, features, objectStack) { +ol.format.GML3.prototype.writeFeatureMembers_ = function(node, features, objectStack) { var context = objectStack[objectStack.length - 1]; goog.asserts.assert(goog.isObject(context), 'context should be an Object'); var featureType = context['featureType']; @@ -1225,8 +1209,7 @@ ol.format.GML3.MULTIGEOMETRY_TO_MEMBER_NODENAME_ = { * @return {Node|undefined} Node. * @private */ -ol.format.GML3.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_ = - function(value, objectStack, opt_nodeName) { +ol.format.GML3.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) { var parentNode = objectStack[objectStack.length - 1].node; goog.asserts.assert(ol.xml.isNode(parentNode), 'parentNode should be a node'); @@ -1243,8 +1226,7 @@ ol.format.GML3.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_ = * @return {Node|undefined} Node. * @private */ -ol.format.GML3.prototype.GEOMETRY_NODE_FACTORY_ = - function(value, objectStack, opt_nodeName) { +ol.format.GML3.prototype.GEOMETRY_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) { var context = objectStack[objectStack.length - 1]; goog.asserts.assert(goog.isObject(context), 'context should be an Object'); var multiSurface = context['multiSurface']; @@ -1341,7 +1323,6 @@ ol.format.GML3.prototype.writeFeaturesNode = function(features, opt_options) { }; - /** * @classdesc * Feature format for reading and writing data in the GML format diff --git a/src/ol/format/gml/gmlbaseformat.js b/src/ol/format/gml/gmlbaseformat.js index e82c292160..6a50ba5ac2 100644 --- a/src/ol/format/gml/gmlbaseformat.js +++ b/src/ol/format/gml/gmlbaseformat.js @@ -24,7 +24,6 @@ goog.require('ol.proj'); goog.require('ol.xml'); - /** * @classdesc * Abstract base class; normally only used for creating subclasses and not @@ -340,8 +339,7 @@ ol.format.GMLBase.prototype.pointMemberParser_ = function(node, objectStack) { * @param {Array.<*>} objectStack Object stack. * @private */ -ol.format.GMLBase.prototype.lineStringMemberParser_ = - function(node, objectStack) { +ol.format.GMLBase.prototype.lineStringMemberParser_ = function(node, objectStack) { goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT, 'node.nodeType should be ELEMENT'); goog.asserts.assert(node.localName == 'lineStringMember' || @@ -357,8 +355,7 @@ ol.format.GMLBase.prototype.lineStringMemberParser_ = * @param {Array.<*>} objectStack Object stack. * @private */ -ol.format.GMLBase.prototype.polygonMemberParser_ = - function(node, objectStack) { +ol.format.GMLBase.prototype.polygonMemberParser_ = function(node, objectStack) { goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT, 'node.nodeType should be ELEMENT'); goog.asserts.assert(node.localName == 'polygonMember' || @@ -472,8 +469,7 @@ ol.format.GMLBase.prototype.readPolygon = function(node, objectStack) { * @private * @return {Array.} Flat coordinates. */ -ol.format.GMLBase.prototype.readFlatCoordinatesFromNode_ = - function(node, objectStack) { +ol.format.GMLBase.prototype.readFlatCoordinatesFromNode_ = function(node, objectStack) { goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT, 'node.nodeType should be ELEMENT'); return /** @type {Array.} */ (ol.xml.pushParseAndPop( @@ -583,8 +579,7 @@ ol.format.GMLBase.prototype.RING_PARSERS = Object({ /** * @inheritDoc */ -ol.format.GMLBase.prototype.readGeometryFromNode = - function(node, opt_options) { +ol.format.GMLBase.prototype.readGeometryFromNode = function(node, opt_options) { var geometry = this.readGeometryElement(node, [this.getReadOptions(node, opt_options ? opt_options : {})]); return geometry ? geometry : null; @@ -606,8 +601,7 @@ ol.format.GMLBase.prototype.readFeatures; /** * @inheritDoc */ -ol.format.GMLBase.prototype.readFeaturesFromNode = - function(node, opt_options) { +ol.format.GMLBase.prototype.readFeaturesFromNode = function(node, opt_options) { var options = { featureType: this.featureType, featureNS: this.featureNS diff --git a/src/ol/format/gpxformat.js b/src/ol/format/gpxformat.js index 8f1d8fa72c..ee51b3bf26 100644 --- a/src/ol/format/gpxformat.js +++ b/src/ol/format/gpxformat.js @@ -15,7 +15,6 @@ goog.require('ol.proj'); goog.require('ol.xml'); - /** * @classdesc * Feature format for reading and writing data in the GPX format. @@ -413,7 +412,7 @@ ol.format.GPX.WPT_PARSERS_ = ol.xml.makeStructureNS( /** - * @param {Array.} features + * @param {Array.} features List of features. * @private */ ol.format.GPX.prototype.handleReadExtensions_ = function(features) { @@ -551,12 +550,12 @@ ol.format.GPX.writeWptType_ = function(node, coordinate, objectStack) { ol.xml.setAttributeNS(node, null, 'lat', coordinate[1]); ol.xml.setAttributeNS(node, null, 'lon', coordinate[0]); var geometryLayout = context['geometryLayout']; - /* jshint -W086 */ switch (geometryLayout) { case ol.geom.GeometryLayout.XYZM: if (coordinate[3] !== 0) { properties['time'] = coordinate[3]; } + // fall through case ol.geom.GeometryLayout.XYZ: if (coordinate[2] !== 0) { properties['ele'] = coordinate[2]; @@ -566,8 +565,10 @@ ol.format.GPX.writeWptType_ = function(node, coordinate, objectStack) { if (coordinate[2] !== 0) { properties['time'] = coordinate[2]; } + break; + default: + // pass } - /* jshint +W086 */ var orderedKeys = ol.format.GPX.WPT_TYPE_SEQUENCE_[namespaceURI]; var values = ol.xml.makeSequence(properties, orderedKeys); ol.xml.pushSerializeAndPop(/** @type {ol.xml.NodeStackItem} */ diff --git a/src/ol/format/igcformat.js b/src/ol/format/igcformat.js index 4977dadbac..9df65bdfad 100644 --- a/src/ol/format/igcformat.js +++ b/src/ol/format/igcformat.js @@ -23,7 +23,6 @@ ol.format.IGCZ = { }; - /** * @classdesc * Feature format for `*.igc` flight recording files. diff --git a/src/ol/format/jsonfeatureformat.js b/src/ol/format/jsonfeatureformat.js index 5016f02d3d..a967b745e9 100644 --- a/src/ol/format/jsonfeatureformat.js +++ b/src/ol/format/jsonfeatureformat.js @@ -6,7 +6,6 @@ goog.require('ol.format.Feature'); goog.require('ol.format.FormatType'); - /** * @classdesc * Abstract base class; normally only used for creating subclasses and not diff --git a/src/ol/format/kmlformat.js b/src/ol/format/kmlformat.js index 93b7a49b87..033557a752 100644 --- a/src/ol/format/kmlformat.js +++ b/src/ol/format/kmlformat.js @@ -57,7 +57,6 @@ ol.format.KMLVec2_; ol.format.KMLGxTrackObject_; - /** * @classdesc * Feature format for reading and writing data in the KML format. @@ -1164,8 +1163,8 @@ ol.format.KML.readStyle_ = function(node, objectStack) { * Reads an array of geometries and creates arrays for common geometry * properties. Then sets them to the multi geometry. * @param {ol.geom.MultiPoint|ol.geom.MultiLineString|ol.geom.MultiPolygon} - * multiGeometry - * @param {Array.} geometries + * multiGeometry A multi-geometry. + * @param {Array.} geometries List of geometries. * @private */ ol.format.KML.setCommonGeometryProperties_ = function(multiGeometry, @@ -2137,8 +2136,7 @@ ol.format.KML.writeColorTextNode_ = function(node, color) { * @param {Array.<*>} objectStack Object stack. * @private */ -ol.format.KML.writeCoordinatesTextNode_ = - function(node, coordinates, objectStack) { +ol.format.KML.writeCoordinatesTextNode_ = function(node, coordinates, objectStack) { var context = objectStack[objectStack.length - 1]; goog.asserts.assert(goog.isObject(context), 'context should be an Object'); @@ -2322,8 +2320,7 @@ ol.format.KML.writeLineStyle_ = function(node, style, objectStack) { * @param {Array.<*>} objectStack Object stack. * @private */ -ol.format.KML.writeMultiGeometry_ = - function(node, geometry, objectStack) { +ol.format.KML.writeMultiGeometry_ = function(node, geometry, objectStack) { goog.asserts.assert( (geometry instanceof ol.geom.MultiPoint) || (geometry instanceof ol.geom.MultiLineString) || @@ -2605,9 +2602,8 @@ ol.format.KML.ICON_SEQUENCE_ = ol.xml.makeStructureNS( ol.format.KML.NAMESPACE_URIS_, [ 'href' ], - ol.xml.makeStructureNS( - ol.format.KML.GX_NAMESPACE_URIS_, [ - 'x', 'y', 'w', 'h' + ol.xml.makeStructureNS(ol.format.KML.GX_NAMESPACE_URIS_, [ + 'x', 'y', 'w', 'h' ])); diff --git a/src/ol/format/mvtformat.js b/src/ol/format/mvtformat.js index f625c0ed2b..ccf08b7295 100644 --- a/src/ol/format/mvtformat.js +++ b/src/ol/format/mvtformat.js @@ -22,7 +22,6 @@ goog.require('ol.proj.Units'); goog.require('ol.render.Feature'); - /** * @classdesc * Feature format for reading data in the Mapbox MVT format. @@ -207,11 +206,11 @@ ol.format.MVT.prototype.setLayers = function(layers) { ol.format.MVT.calculateFlatCoordinates_ = function( coords, flatCoordinates, ends) { var end = 0; - var line, coord; for (var i = 0, ii = coords.length; i < ii; ++i) { - line = coords[i]; - for (var j = 0, jj = line.length; j < jj; ++j) { - coord = line[j]; + var line = coords[i]; + var j, jj; + for (j = 0, jj = line.length; j < jj; ++j) { + var coord = line[j]; // Non-tilespace coords can be calculated here when a TileGrid and // TileCoord are known. flatCoordinates.push(coord.x, coord.y); diff --git a/src/ol/format/osmxmlformat.js b/src/ol/format/osmxmlformat.js index f45ca8211d..398ece9a71 100644 --- a/src/ol/format/osmxmlformat.js +++ b/src/ol/format/osmxmlformat.js @@ -16,7 +16,6 @@ goog.require('ol.proj'); goog.require('ol.xml'); - /** * @classdesc * Feature format for reading data in the @@ -128,7 +127,6 @@ ol.format.OSMXML.readWay_ = function(node, objectStack) { * @param {Node} node Node. * @param {Array.<*>} objectStack Object stack. * @private - * @return {ol.Feature|undefined} Track. */ ol.format.OSMXML.readNd_ = function(node, objectStack) { goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT, @@ -143,7 +141,6 @@ ol.format.OSMXML.readNd_ = function(node, objectStack) { * @param {Node} node Node. * @param {Array.<*>} objectStack Object stack. * @private - * @return {ol.Feature|undefined} Track. */ ol.format.OSMXML.readTag_ = function(node, objectStack) { goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT, diff --git a/src/ol/format/owsformat.js b/src/ol/format/owsformat.js index 701abb25b2..2c44fda4ce 100644 --- a/src/ol/format/owsformat.js +++ b/src/ol/format/owsformat.js @@ -8,7 +8,6 @@ goog.require('ol.format.XSD'); goog.require('ol.xml'); - /** * @constructor * @extends {ol.format.XML} @@ -52,7 +51,7 @@ ol.format.OWS.prototype.readFromNode = function(node) { * @param {Node} node Node. * @param {Array.<*>} objectStack Object stack. * @private - * @return {Object|undefined} + * @return {Object|undefined} The address. */ ol.format.OWS.readAddress_ = function(node, objectStack) { goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT, @@ -68,7 +67,7 @@ ol.format.OWS.readAddress_ = function(node, objectStack) { * @param {Node} node Node. * @param {Array.<*>} objectStack Object stack. * @private - * @return {Object|undefined} + * @return {Object|undefined} The values. */ ol.format.OWS.readAllowedValues_ = function(node, objectStack) { goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT, @@ -84,7 +83,7 @@ ol.format.OWS.readAllowedValues_ = function(node, objectStack) { * @param {Node} node Node. * @param {Array.<*>} objectStack Object stack. * @private - * @return {Object|undefined} + * @return {Object|undefined} The constraint. */ ol.format.OWS.readConstraint_ = function(node, objectStack) { goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT, @@ -105,7 +104,7 @@ ol.format.OWS.readConstraint_ = function(node, objectStack) { * @param {Node} node Node. * @param {Array.<*>} objectStack Object stack. * @private - * @return {Object|undefined} + * @return {Object|undefined} The contact info. */ ol.format.OWS.readContactInfo_ = function(node, objectStack) { goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT, @@ -121,7 +120,7 @@ ol.format.OWS.readContactInfo_ = function(node, objectStack) { * @param {Node} node Node. * @param {Array.<*>} objectStack Object stack. * @private - * @return {Object|undefined} + * @return {Object|undefined} The DCP. */ ol.format.OWS.readDcp_ = function(node, objectStack) { goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT, @@ -136,7 +135,7 @@ ol.format.OWS.readDcp_ = function(node, objectStack) { * @param {Node} node Node. * @param {Array.<*>} objectStack Object stack. * @private - * @return {Object|undefined} + * @return {Object|undefined} The GET object. */ ol.format.OWS.readGet_ = function(node, objectStack) { goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT, @@ -155,7 +154,7 @@ ol.format.OWS.readGet_ = function(node, objectStack) { * @param {Node} node Node. * @param {Array.<*>} objectStack Object stack. * @private - * @return {Object|undefined} + * @return {Object|undefined} The HTTP object. */ ol.format.OWS.readHttp_ = function(node, objectStack) { goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT, @@ -170,7 +169,7 @@ ol.format.OWS.readHttp_ = function(node, objectStack) { * @param {Node} node Node. * @param {Array.<*>} objectStack Object stack. * @private - * @return {Object|undefined} + * @return {Object|undefined} The operation. */ ol.format.OWS.readOperation_ = function(node, objectStack) { goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT, @@ -195,7 +194,7 @@ ol.format.OWS.readOperation_ = function(node, objectStack) { * @param {Node} node Node. * @param {Array.<*>} objectStack Object stack. * @private - * @return {Object|undefined} + * @return {Object|undefined} The operations metadata. */ ol.format.OWS.readOperationsMetadata_ = function(node, objectStack) { @@ -213,7 +212,7 @@ ol.format.OWS.readOperationsMetadata_ = function(node, * @param {Node} node Node. * @param {Array.<*>} objectStack Object stack. * @private - * @return {Object|undefined} + * @return {Object|undefined} The phone. */ ol.format.OWS.readPhone_ = function(node, objectStack) { goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT, @@ -228,7 +227,7 @@ ol.format.OWS.readPhone_ = function(node, objectStack) { * @param {Node} node Node. * @param {Array.<*>} objectStack Object stack. * @private - * @return {Object|undefined} + * @return {Object|undefined} The service identification. */ ol.format.OWS.readServiceIdentification_ = function(node, objectStack) { @@ -246,7 +245,7 @@ ol.format.OWS.readServiceIdentification_ = function(node, * @param {Node} node Node. * @param {Array.<*>} objectStack Object stack. * @private - * @return {Object|undefined} + * @return {Object|undefined} The service contact. */ ol.format.OWS.readServiceContact_ = function(node, objectStack) { goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT, @@ -263,7 +262,7 @@ ol.format.OWS.readServiceContact_ = function(node, objectStack) { * @param {Node} node Node. * @param {Array.<*>} objectStack Object stack. * @private - * @return {Object|undefined} + * @return {Object|undefined} The service provider. */ ol.format.OWS.readServiceProvider_ = function(node, objectStack) { goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT, @@ -280,7 +279,7 @@ ol.format.OWS.readServiceProvider_ = function(node, objectStack) { * @param {Node} node Node. * @param {Array.<*>} objectStack Object stack. * @private - * @return {string|undefined} + * @return {string|undefined} The value. */ ol.format.OWS.readValue_ = function(node, objectStack) { goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT, diff --git a/src/ol/format/polylineformat.js b/src/ol/format/polylineformat.js index 6ef878c57a..4fc08d74ad 100644 --- a/src/ol/format/polylineformat.js +++ b/src/ol/format/polylineformat.js @@ -12,7 +12,6 @@ goog.require('ol.geom.flat.inflate'); goog.require('ol.proj'); - /** * @classdesc * Feature format for reading and writing data in the Encoded @@ -301,8 +300,7 @@ ol.format.Polyline.prototype.readFeatures; /** * @inheritDoc */ -ol.format.Polyline.prototype.readFeaturesFromText = - function(text, opt_options) { +ol.format.Polyline.prototype.readFeaturesFromText = function(text, opt_options) { var feature = this.readFeatureFromText(text, opt_options); return [feature]; }; @@ -323,8 +321,7 @@ ol.format.Polyline.prototype.readGeometry; /** * @inheritDoc */ -ol.format.Polyline.prototype.readGeometryFromText = - function(text, opt_options) { +ol.format.Polyline.prototype.readGeometryFromText = function(text, opt_options) { var stride = ol.geom.SimpleGeometry.getStrideForLayout(this.geometryLayout_); var flatCoordinates = ol.format.Polyline.decodeDeltas( text, stride, this.factor_); @@ -368,8 +365,7 @@ ol.format.Polyline.prototype.writeFeatureText = function(feature, opt_options) { /** * @inheritDoc */ -ol.format.Polyline.prototype.writeFeaturesText = - function(features, opt_options) { +ol.format.Polyline.prototype.writeFeaturesText = function(features, opt_options) { goog.asserts.assert(features.length == 1, 'features array should have 1 item'); return this.writeFeatureText(features[0], opt_options); @@ -391,8 +387,7 @@ ol.format.Polyline.prototype.writeGeometry; /** * @inheritDoc */ -ol.format.Polyline.prototype.writeGeometryText = - function(geometry, opt_options) { +ol.format.Polyline.prototype.writeGeometryText = function(geometry, opt_options) { goog.asserts.assertInstanceof(geometry, ol.geom.LineString, 'geometry should be an ol.geom.LineString'); geometry = /** @type {ol.geom.LineString} */ diff --git a/src/ol/format/readme.md b/src/ol/format/readme.md index 03111b32ec..fedb94fa51 100644 --- a/src/ol/format/readme.md +++ b/src/ol/format/readme.md @@ -132,4 +132,3 @@ If, when reading a value from a child element, you find an invalid value, you sh An `ol.format.Format` should read as many features as it can, skipping features with any errors. - diff --git a/src/ol/format/textfeatureformat.js b/src/ol/format/textfeatureformat.js index bdaeaf7f44..fc1bddc273 100644 --- a/src/ol/format/textfeatureformat.js +++ b/src/ol/format/textfeatureformat.js @@ -5,7 +5,6 @@ goog.require('ol.format.Feature'); goog.require('ol.format.FormatType'); - /** * @classdesc * Abstract base class; normally only used for creating subclasses and not diff --git a/src/ol/format/topojsonformat.js b/src/ol/format/topojsonformat.js index a4c88ed07c..cd63908115 100644 --- a/src/ol/format/topojsonformat.js +++ b/src/ol/format/topojsonformat.js @@ -14,7 +14,6 @@ goog.require('ol.geom.Polygon'); goog.require('ol.proj'); - /** * @classdesc * Feature format for reading data in the TopoJSON format. diff --git a/src/ol/format/wfsformat.js b/src/ol/format/wfsformat.js index 10b463b828..4159a2e56f 100644 --- a/src/ol/format/wfsformat.js +++ b/src/ol/format/wfsformat.js @@ -13,7 +13,6 @@ goog.require('ol.proj'); goog.require('ol.xml'); - /** * @classdesc * Feature format for reading and writing data in the WFS format. @@ -192,8 +191,7 @@ ol.format.WFS.prototype.readFeatureCollectionMetadata = function(source) { * @return {ol.format.WFS.FeatureCollectionMetadata|undefined} * FeatureCollection metadata. */ -ol.format.WFS.prototype.readFeatureCollectionMetadataFromDocument = - function(doc) { +ol.format.WFS.prototype.readFeatureCollectionMetadataFromDocument = function(doc) { goog.asserts.assert(doc.nodeType == goog.dom.NodeType.DOCUMENT, 'doc.nodeType should be DOCUMENT'); for (var n = doc.firstChild; n; n = n.nextSibling) { diff --git a/src/ol/format/wktformat.js b/src/ol/format/wktformat.js index 843c64ea40..cfabf398ab 100644 --- a/src/ol/format/wktformat.js +++ b/src/ol/format/wktformat.js @@ -16,7 +16,6 @@ goog.require('ol.geom.Point'); goog.require('ol.geom.Polygon'); - /** * @classdesc * Geometry format for reading and writing data in the `WellKnownText` (WKT) @@ -387,7 +386,6 @@ ol.format.WKT.TokenType = { }; - /** * Class to tokenize a WKT string. * @param {string} wkt WKT string. @@ -524,10 +522,9 @@ ol.format.WKT.Lexer.prototype.readText_ = function() { }; - /** * Class to parse the tokens from the WKT string. - * @param {ol.format.WKT.Lexer} lexer + * @param {ol.format.WKT.Lexer} lexer The lexer. * @constructor * @protected */ diff --git a/src/ol/format/wmscapabilitiesformat.js b/src/ol/format/wmscapabilitiesformat.js index d5804203a7..0482cf659f 100644 --- a/src/ol/format/wmscapabilitiesformat.js +++ b/src/ol/format/wmscapabilitiesformat.js @@ -10,7 +10,6 @@ goog.require('ol.format.XSD'); goog.require('ol.xml'); - /** * @classdesc * Format for reading WMS capabilities data @@ -131,8 +130,7 @@ ol.format.WMSCapabilities.readBoundingBox_ = function(node, objectStack) { * @param {Array.<*>} objectStack Object stack. * @return {ol.Extent|undefined} Bounding box object. */ -ol.format.WMSCapabilities.readEXGeographicBoundingBox_ = - function(node, objectStack) { +ol.format.WMSCapabilities.readEXGeographicBoundingBox_ = function(node, objectStack) { goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT, 'node.nodeType should be ELEMENT'); goog.asserts.assert(node.localName == 'EX_GeographicBoundingBox', @@ -201,8 +199,7 @@ ol.format.WMSCapabilities.readService_ = function(node, objectStack) { * @private * @return {Object|undefined} Contact information object. */ -ol.format.WMSCapabilities.readContactInformation_ = - function(node, objectStack) { +ol.format.WMSCapabilities.readContactInformation_ = function(node, objectStack) { goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT, 'node.nodeType shpuld be ELEMENT'); goog.asserts.assert(node.localName == 'ContactInformation', @@ -219,8 +216,7 @@ ol.format.WMSCapabilities.readContactInformation_ = * @private * @return {Object|undefined} Contact person object. */ -ol.format.WMSCapabilities.readContactPersonPrimary_ = - function(node, objectStack) { +ol.format.WMSCapabilities.readContactPersonPrimary_ = function(node, objectStack) { goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT, 'node.nodeType should be ELEMENT'); goog.asserts.assert(node.localName == 'ContactPersonPrimary', @@ -237,8 +233,7 @@ ol.format.WMSCapabilities.readContactPersonPrimary_ = * @private * @return {Object|undefined} Contact address object. */ -ol.format.WMSCapabilities.readContactAddress_ = - function(node, objectStack) { +ol.format.WMSCapabilities.readContactAddress_ = function(node, objectStack) { goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT, 'node.nodeType should be ELEMENT'); goog.asserts.assert(node.localName == 'ContactAddress', @@ -396,8 +391,7 @@ ol.format.WMSCapabilities.readDimension_ = function(node, objectStack) { * @param {Array.<*>} objectStack Object stack. * @return {Object|undefined} Online resource object. */ -ol.format.WMSCapabilities.readFormatOnlineresource_ = - function(node, objectStack) { +ol.format.WMSCapabilities.readFormatOnlineresource_ = function(node, objectStack) { goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT, 'node.nodeType should be ELEMENT'); return ol.xml.pushParseAndPop( @@ -473,8 +467,7 @@ ol.format.WMSCapabilities.readOperationType_ = function(node, objectStack) { * @param {Array.<*>} objectStack Object stack. * @return {Object|undefined} Online resource object. */ -ol.format.WMSCapabilities.readSizedFormatOnlineresource_ = - function(node, objectStack) { +ol.format.WMSCapabilities.readSizedFormatOnlineresource_ = function(node, objectStack) { goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT, 'node.nodeType should be ELEMENT'); var formatOnlineresource = diff --git a/src/ol/format/wmsgetfeatureinfoformat.js b/src/ol/format/wmsgetfeatureinfoformat.js index c38b508090..ab5c577d01 100644 --- a/src/ol/format/wmsgetfeatureinfoformat.js +++ b/src/ol/format/wmsgetfeatureinfoformat.js @@ -9,7 +9,6 @@ goog.require('ol.format.XMLFeature'); goog.require('ol.xml'); - /** * @classdesc * Format for reading WMSGetFeatureInfo format. It uses @@ -61,8 +60,7 @@ ol.format.WMSGetFeatureInfo.layerIdentifier_ = '_layer'; * @return {Array.} Features. * @private */ -ol.format.WMSGetFeatureInfo.prototype.readFeatures_ = - function(node, objectStack) { +ol.format.WMSGetFeatureInfo.prototype.readFeatures_ = function(node, objectStack) { node.namespaceURI = this.featureNS_; goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT, @@ -134,8 +132,7 @@ ol.format.WMSGetFeatureInfo.prototype.readFeatures; /** * @inheritDoc */ -ol.format.WMSGetFeatureInfo.prototype.readFeaturesFromNode = - function(node, opt_options) { +ol.format.WMSGetFeatureInfo.prototype.readFeaturesFromNode = function(node, opt_options) { var options = { 'featureType': this.featureType, 'featureNS': this.featureNS diff --git a/src/ol/format/wmtscapabilitiesformat.js b/src/ol/format/wmtscapabilitiesformat.js index 6c6bb4974c..59f98a4397 100644 --- a/src/ol/format/wmtscapabilitiesformat.js +++ b/src/ol/format/wmtscapabilitiesformat.js @@ -10,7 +10,6 @@ goog.require('ol.format.XSD'); goog.require('ol.xml'); - /** * @classdesc * Format for reading WMTS capabilities data. diff --git a/src/ol/format/xmlfeatureformat.js b/src/ol/format/xmlfeatureformat.js index dbc930e6af..76b86baf6b 100644 --- a/src/ol/format/xmlfeatureformat.js +++ b/src/ol/format/xmlfeatureformat.js @@ -10,7 +10,6 @@ goog.require('ol.proj'); goog.require('ol.xml'); - /** * @classdesc * Abstract base class; normally only used for creating subclasses and not diff --git a/src/ol/format/xmlformat.js b/src/ol/format/xmlformat.js index 11d46fbe6a..48b18d9319 100644 --- a/src/ol/format/xmlformat.js +++ b/src/ol/format/xmlformat.js @@ -4,7 +4,6 @@ goog.require('goog.asserts'); goog.require('ol.xml'); - /** * @classdesc * Generic format for reading non-feature XML data @@ -17,7 +16,7 @@ ol.format.XML = function() { /** * @param {Document|Node|string} source Source. - * @return {Object} + * @return {Object} The parsed result. */ ol.format.XML.prototype.read = function(source) { if (ol.xml.isDocument(source)) { diff --git a/src/ol/format/xsdformat.js b/src/ol/format/xsdformat.js index 3257e59ac9..4caa23d029 100644 --- a/src/ol/format/xsdformat.js +++ b/src/ol/format/xsdformat.js @@ -165,8 +165,7 @@ ol.format.XSD.writeDecimalTextNode = function(node, decimal) { * @param {Node} node Node to append a TextNode with the decimal to. * @param {number} nonNegativeInteger Non negative integer. */ -ol.format.XSD.writeNonNegativeIntegerTextNode = - function(node, nonNegativeInteger) { +ol.format.XSD.writeNonNegativeIntegerTextNode = function(node, nonNegativeInteger) { goog.asserts.assert(nonNegativeInteger >= 0, 'value should be more than 0'); goog.asserts.assert(nonNegativeInteger == (nonNegativeInteger | 0), 'value should be an integer value'); diff --git a/src/ol/geolocation.js b/src/ol/geolocation.js index 001dd8c15c..79896c1eae 100644 --- a/src/ol/geolocation.js +++ b/src/ol/geolocation.js @@ -32,7 +32,6 @@ ol.GeolocationProperty = { }; - /** * @classdesc * Helper class for providing HTML5 Geolocation capabilities. diff --git a/src/ol/geom/circle.js b/src/ol/geom/circle.js index fd07b16a3a..91fc52b9a0 100644 --- a/src/ol/geom/circle.js +++ b/src/ol/geom/circle.js @@ -9,7 +9,6 @@ goog.require('ol.geom.flat.deflate'); goog.require('ol.proj'); - /** * @classdesc * Circle geometry. @@ -44,8 +43,7 @@ ol.geom.Circle.prototype.clone = function() { /** * @inheritDoc */ -ol.geom.Circle.prototype.closestPointXY = - function(x, y, closestPoint, minSquaredDistance) { +ol.geom.Circle.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) { var flatCoordinates = this.flatCoordinates; var dx = x - flatCoordinates[0]; var dy = y - flatCoordinates[1]; @@ -187,8 +185,7 @@ ol.geom.Circle.prototype.setCenter = function(center) { * @param {ol.geom.GeometryLayout=} opt_layout Layout. * @api */ -ol.geom.Circle.prototype.setCenterAndRadius = - function(center, radius, opt_layout) { +ol.geom.Circle.prototype.setCenterAndRadius = function(center, radius, opt_layout) { if (!center) { this.setFlatCoordinates(ol.geom.GeometryLayout.XY, null); } else { @@ -215,8 +212,7 @@ ol.geom.Circle.prototype.setCenterAndRadius = * @param {ol.geom.GeometryLayout} layout Layout. * @param {Array.} flatCoordinates Flat coordinates. */ -ol.geom.Circle.prototype.setFlatCoordinates = - function(layout, flatCoordinates) { +ol.geom.Circle.prototype.setFlatCoordinates = function(layout, flatCoordinates) { this.setFlatCoordinatesInternal(layout, flatCoordinates); this.changed(); }; diff --git a/src/ol/geom/flat/areaflatgeom.js b/src/ol/geom/flat/areaflatgeom.js index eb0b1e4275..074f50c25d 100644 --- a/src/ol/geom/flat/areaflatgeom.js +++ b/src/ol/geom/flat/areaflatgeom.js @@ -30,8 +30,7 @@ ol.geom.flat.area.linearRing = function(flatCoordinates, offset, end, stride) { * @param {number} stride Stride. * @return {number} Area. */ -ol.geom.flat.area.linearRings = - function(flatCoordinates, offset, ends, stride) { +ol.geom.flat.area.linearRings = function(flatCoordinates, offset, ends, stride) { var area = 0; var i, ii; for (i = 0, ii = ends.length; i < ii; ++i) { @@ -50,8 +49,7 @@ ol.geom.flat.area.linearRings = * @param {number} stride Stride. * @return {number} Area. */ -ol.geom.flat.area.linearRingss = - function(flatCoordinates, offset, endss, stride) { +ol.geom.flat.area.linearRingss = function(flatCoordinates, offset, endss, stride) { var area = 0; var i, ii; for (i = 0, ii = endss.length; i < ii; ++i) { diff --git a/src/ol/geom/flat/centerflatgeom.js b/src/ol/geom/flat/centerflatgeom.js index 81f24369ff..a308c7e043 100644 --- a/src/ol/geom/flat/centerflatgeom.js +++ b/src/ol/geom/flat/centerflatgeom.js @@ -10,8 +10,7 @@ goog.require('ol.extent'); * @param {number} stride Stride. * @return {Array.} Flat centers. */ -ol.geom.flat.center.linearRingss = - function(flatCoordinates, offset, endss, stride) { +ol.geom.flat.center.linearRingss = function(flatCoordinates, offset, endss, stride) { var flatCenters = []; var i, ii; var extent = ol.extent.createEmpty(); diff --git a/src/ol/geom/flat/closestflatgeom.js b/src/ol/geom/flat/closestflatgeom.js index efe7470629..2acdfdac8e 100644 --- a/src/ol/geom/flat/closestflatgeom.js +++ b/src/ol/geom/flat/closestflatgeom.js @@ -17,8 +17,7 @@ goog.require('ol.math'); * @param {number} y Y. * @param {Array.} closestPoint Closest point. */ -ol.geom.flat.closest.point = - function(flatCoordinates, offset1, offset2, stride, x, y, closestPoint) { +ol.geom.flat.closest.point = function(flatCoordinates, offset1, offset2, stride, x, y, closestPoint) { var x1 = flatCoordinates[offset1]; var y1 = flatCoordinates[offset1 + 1]; var dx = flatCoordinates[offset2] - x1; @@ -58,8 +57,7 @@ ol.geom.flat.closest.point = * @param {number} maxSquaredDelta Max squared delta. * @return {number} Max squared delta. */ -ol.geom.flat.closest.getMaxSquaredDelta = - function(flatCoordinates, offset, end, stride, maxSquaredDelta) { +ol.geom.flat.closest.getMaxSquaredDelta = function(flatCoordinates, offset, end, stride, maxSquaredDelta) { var x1 = flatCoordinates[offset]; var y1 = flatCoordinates[offset + 1]; for (offset += stride; offset < end; offset += stride) { @@ -84,8 +82,7 @@ ol.geom.flat.closest.getMaxSquaredDelta = * @param {number} maxSquaredDelta Max squared delta. * @return {number} Max squared delta. */ -ol.geom.flat.closest.getsMaxSquaredDelta = - function(flatCoordinates, offset, ends, stride, maxSquaredDelta) { +ol.geom.flat.closest.getsMaxSquaredDelta = function(flatCoordinates, offset, ends, stride, maxSquaredDelta) { var i, ii; for (i = 0, ii = ends.length; i < ii; ++i) { var end = ends[i]; @@ -105,8 +102,7 @@ ol.geom.flat.closest.getsMaxSquaredDelta = * @param {number} maxSquaredDelta Max squared delta. * @return {number} Max squared delta. */ -ol.geom.flat.closest.getssMaxSquaredDelta = - function(flatCoordinates, offset, endss, stride, maxSquaredDelta) { +ol.geom.flat.closest.getssMaxSquaredDelta = function(flatCoordinates, offset, endss, stride, maxSquaredDelta) { var i, ii; for (i = 0, ii = endss.length; i < ii; ++i) { var ends = endss[i]; diff --git a/src/ol/geom/flat/containsflatgeom.js b/src/ol/geom/flat/containsflatgeom.js index 01759ff169..cb1f4401f0 100644 --- a/src/ol/geom/flat/containsflatgeom.js +++ b/src/ol/geom/flat/containsflatgeom.js @@ -12,8 +12,7 @@ goog.require('ol.extent'); * @param {ol.Extent} extent Extent. * @return {boolean} Contains extent. */ -ol.geom.flat.contains.linearRingContainsExtent = - function(flatCoordinates, offset, end, stride, extent) { +ol.geom.flat.contains.linearRingContainsExtent = function(flatCoordinates, offset, end, stride, extent) { var outside = ol.extent.forEachCorner(extent, /** * @param {ol.Coordinate} coordinate Coordinate. @@ -35,8 +34,7 @@ ol.geom.flat.contains.linearRingContainsExtent = * @param {number} y Y. * @return {boolean} Contains (x, y). */ -ol.geom.flat.contains.linearRingContainsXY = - function(flatCoordinates, offset, end, stride, x, y) { +ol.geom.flat.contains.linearRingContainsXY = function(flatCoordinates, offset, end, stride, x, y) { // http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html var contains = false; var x1 = flatCoordinates[end - stride]; @@ -65,8 +63,7 @@ ol.geom.flat.contains.linearRingContainsXY = * @param {number} y Y. * @return {boolean} Contains (x, y). */ -ol.geom.flat.contains.linearRingsContainsXY = - function(flatCoordinates, offset, ends, stride, x, y) { +ol.geom.flat.contains.linearRingsContainsXY = function(flatCoordinates, offset, ends, stride, x, y) { goog.asserts.assert(ends.length > 0, 'ends should not be an empty array'); if (ends.length === 0) { return false; @@ -95,8 +92,7 @@ ol.geom.flat.contains.linearRingsContainsXY = * @param {number} y Y. * @return {boolean} Contains (x, y). */ -ol.geom.flat.contains.linearRingssContainsXY = - function(flatCoordinates, offset, endss, stride, x, y) { +ol.geom.flat.contains.linearRingssContainsXY = function(flatCoordinates, offset, endss, stride, x, y) { goog.asserts.assert(endss.length > 0, 'endss should not be an empty array'); if (endss.length === 0) { return false; diff --git a/src/ol/geom/flat/deflateflatgeom.js b/src/ol/geom/flat/deflateflatgeom.js index 08c7fe7b02..afc532de89 100644 --- a/src/ol/geom/flat/deflateflatgeom.js +++ b/src/ol/geom/flat/deflateflatgeom.js @@ -10,8 +10,7 @@ goog.require('goog.asserts'); * @param {number} stride Stride. * @return {number} offset Offset. */ -ol.geom.flat.deflate.coordinate = - function(flatCoordinates, offset, coordinate, stride) { +ol.geom.flat.deflate.coordinate = function(flatCoordinates, offset, coordinate, stride) { goog.asserts.assert(coordinate.length == stride, 'length of the coordinate array should match stride'); var i, ii; @@ -29,8 +28,7 @@ ol.geom.flat.deflate.coordinate = * @param {number} stride Stride. * @return {number} offset Offset. */ -ol.geom.flat.deflate.coordinates = - function(flatCoordinates, offset, coordinates, stride) { +ol.geom.flat.deflate.coordinates = function(flatCoordinates, offset, coordinates, stride) { var i, ii; for (i = 0, ii = coordinates.length; i < ii; ++i) { var coordinate = coordinates[i]; @@ -53,8 +51,7 @@ ol.geom.flat.deflate.coordinates = * @param {Array.=} opt_ends Ends. * @return {Array.} Ends. */ -ol.geom.flat.deflate.coordinatess = - function(flatCoordinates, offset, coordinatess, stride, opt_ends) { +ol.geom.flat.deflate.coordinatess = function(flatCoordinates, offset, coordinatess, stride, opt_ends) { var ends = opt_ends ? opt_ends : []; var i = 0; var j, jj; @@ -77,8 +74,7 @@ ol.geom.flat.deflate.coordinatess = * @param {Array.>=} opt_endss Endss. * @return {Array.>} Endss. */ -ol.geom.flat.deflate.coordinatesss = - function(flatCoordinates, offset, coordinatesss, stride, opt_endss) { +ol.geom.flat.deflate.coordinatesss = function(flatCoordinates, offset, coordinatesss, stride, opt_endss) { var endss = opt_endss ? opt_endss : []; var i = 0; var j, jj; diff --git a/src/ol/geom/flat/flipflatgeom.js b/src/ol/geom/flat/flipflatgeom.js index 5808999797..62eb374c46 100644 --- a/src/ol/geom/flat/flipflatgeom.js +++ b/src/ol/geom/flat/flipflatgeom.js @@ -12,8 +12,7 @@ goog.require('goog.asserts'); * @param {number=} opt_destOffset Destination offset. * @return {Array.} Flat coordinates. */ -ol.geom.flat.flip.flipXY = - function(flatCoordinates, offset, end, stride, opt_dest, opt_destOffset) { +ol.geom.flat.flip.flipXY = function(flatCoordinates, offset, end, stride, opt_dest, opt_destOffset) { var dest, destOffset; if (opt_dest !== undefined) { dest = opt_dest; @@ -24,12 +23,12 @@ ol.geom.flat.flip.flipXY = dest = []; destOffset = 0; } - var j, k; - for (j = offset; j < end; ) { + var j = offset; + while (j < end) { var x = flatCoordinates[j++]; dest[destOffset++] = flatCoordinates[j++]; dest[destOffset++] = x; - for (k = 2; k < stride; ++k) { + for (var k = 2; k < stride; ++k) { dest[destOffset++] = flatCoordinates[j++]; } } diff --git a/src/ol/geom/flat/geodesicflatgeom.js b/src/ol/geom/flat/geodesicflatgeom.js index 6ad3d62881..2f7e7d7d0d 100644 --- a/src/ol/geom/flat/geodesicflatgeom.js +++ b/src/ol/geom/flat/geodesicflatgeom.js @@ -14,8 +14,7 @@ goog.require('ol.proj'); * @param {number} squaredTolerance Squared tolerance. * @return {Array.} Flat coordinates. */ -ol.geom.flat.geodesic.line_ = - function(interpolate, transform, squaredTolerance) { +ol.geom.flat.geodesic.line_ = function(interpolate, transform, squaredTolerance) { // FIXME reduce garbage generation // FIXME optimize stack operations @@ -141,8 +140,7 @@ ol.geom.flat.geodesic.greatCircleArc = function( * @param {number} squaredTolerance Squared tolerance. * @return {Array.} Flat coordinates. */ -ol.geom.flat.geodesic.meridian = - function(lon, lat1, lat2, projection, squaredTolerance) { +ol.geom.flat.geodesic.meridian = function(lon, lat1, lat2, projection, squaredTolerance) { var epsg4326Projection = ol.proj.get('EPSG:4326'); return ol.geom.flat.geodesic.line_( /** @@ -165,8 +163,7 @@ ol.geom.flat.geodesic.meridian = * @param {number} squaredTolerance Squared tolerance. * @return {Array.} Flat coordinates. */ -ol.geom.flat.geodesic.parallel = - function(lat, lon1, lon2, projection, squaredTolerance) { +ol.geom.flat.geodesic.parallel = function(lat, lon1, lon2, projection, squaredTolerance) { var epsg4326Projection = ol.proj.get('EPSG:4326'); return ol.geom.flat.geodesic.line_( /** diff --git a/src/ol/geom/flat/inflateflatgeom.js b/src/ol/geom/flat/inflateflatgeom.js index e61c194f08..30cc11810c 100644 --- a/src/ol/geom/flat/inflateflatgeom.js +++ b/src/ol/geom/flat/inflateflatgeom.js @@ -9,8 +9,7 @@ goog.provide('ol.geom.flat.inflate'); * @param {Array.=} opt_coordinates Coordinates. * @return {Array.} Coordinates. */ -ol.geom.flat.inflate.coordinates = - function(flatCoordinates, offset, end, stride, opt_coordinates) { +ol.geom.flat.inflate.coordinates = function(flatCoordinates, offset, end, stride, opt_coordinates) { var coordinates = opt_coordinates !== undefined ? opt_coordinates : []; var i = 0; var j; @@ -30,8 +29,7 @@ ol.geom.flat.inflate.coordinates = * @param {Array.>=} opt_coordinatess Coordinatess. * @return {Array.>} Coordinatess. */ -ol.geom.flat.inflate.coordinatess = - function(flatCoordinates, offset, ends, stride, opt_coordinatess) { +ol.geom.flat.inflate.coordinatess = function(flatCoordinates, offset, ends, stride, opt_coordinatess) { var coordinatess = opt_coordinatess !== undefined ? opt_coordinatess : []; var i = 0; var j, jj; @@ -55,8 +53,7 @@ ol.geom.flat.inflate.coordinatess = * Coordinatesss. * @return {Array.>>} Coordinatesss. */ -ol.geom.flat.inflate.coordinatesss = - function(flatCoordinates, offset, endss, stride, opt_coordinatesss) { +ol.geom.flat.inflate.coordinatesss = function(flatCoordinates, offset, endss, stride, opt_coordinatesss) { var coordinatesss = opt_coordinatesss !== undefined ? opt_coordinatesss : []; var i = 0; var j, jj; diff --git a/src/ol/geom/flat/interiorpointflatgeom.js b/src/ol/geom/flat/interiorpointflatgeom.js index bffd186d20..15e9b7101f 100644 --- a/src/ol/geom/flat/interiorpointflatgeom.js +++ b/src/ol/geom/flat/interiorpointflatgeom.js @@ -78,8 +78,7 @@ ol.geom.flat.interiorpoint.linearRings = function(flatCoordinates, offset, * @param {Array.} flatCenters Flat centers. * @return {Array.} Interior points. */ -ol.geom.flat.interiorpoint.linearRingss = - function(flatCoordinates, offset, endss, stride, flatCenters) { +ol.geom.flat.interiorpoint.linearRingss = function(flatCoordinates, offset, endss, stride, flatCenters) { goog.asserts.assert(2 * endss.length == flatCenters.length, 'endss.length times 2 should be flatCenters.length'); var interiorPoints = []; diff --git a/src/ol/geom/flat/interpolateflatgeom.js b/src/ol/geom/flat/interpolateflatgeom.js index 3035d0b40e..896b1028bd 100644 --- a/src/ol/geom/flat/interpolateflatgeom.js +++ b/src/ol/geom/flat/interpolateflatgeom.js @@ -14,8 +14,7 @@ goog.require('goog.math'); * @param {Array.=} opt_dest Destination. * @return {Array.} Destination. */ -ol.geom.flat.interpolate.lineString = - function(flatCoordinates, offset, end, stride, fraction, opt_dest) { +ol.geom.flat.interpolate.lineString = function(flatCoordinates, offset, end, stride, fraction, opt_dest) { // FIXME interpolate extra dimensions goog.asserts.assert(0 <= fraction && fraction <= 1, 'fraction should be in between 0 and 1'); @@ -80,8 +79,7 @@ ol.geom.flat.interpolate.lineString = * @param {boolean} extrapolate Extrapolate. * @return {ol.Coordinate} Coordinate. */ -ol.geom.flat.lineStringCoordinateAtM = - function(flatCoordinates, offset, end, stride, m, extrapolate) { +ol.geom.flat.lineStringCoordinateAtM = function(flatCoordinates, offset, end, stride, m, extrapolate) { if (end == offset) { return null; } diff --git a/src/ol/geom/flat/intersectsextent.js b/src/ol/geom/flat/intersectsextent.js index 3cbd0770bd..c520464da3 100644 --- a/src/ol/geom/flat/intersectsextent.js +++ b/src/ol/geom/flat/intersectsextent.js @@ -14,8 +14,7 @@ goog.require('ol.geom.flat.segments'); * @param {ol.Extent} extent Extent. * @return {boolean} True if the geometry and the extent intersect. */ -ol.geom.flat.intersectsextent.lineString = - function(flatCoordinates, offset, end, stride, extent) { +ol.geom.flat.intersectsextent.lineString = function(flatCoordinates, offset, end, stride, extent) { var coordinatesExtent = ol.extent.extendFlatCoordinates( ol.extent.createEmpty(), flatCoordinates, offset, end, stride); if (!ol.extent.intersects(extent, coordinatesExtent)) { @@ -53,8 +52,7 @@ ol.geom.flat.intersectsextent.lineString = * @param {ol.Extent} extent Extent. * @return {boolean} True if the geometry and the extent intersect. */ -ol.geom.flat.intersectsextent.lineStrings = - function(flatCoordinates, offset, ends, stride, extent) { +ol.geom.flat.intersectsextent.lineStrings = function(flatCoordinates, offset, ends, stride, extent) { var i, ii; for (i = 0, ii = ends.length; i < ii; ++i) { if (ol.geom.flat.intersectsextent.lineString( @@ -75,8 +73,7 @@ ol.geom.flat.intersectsextent.lineStrings = * @param {ol.Extent} extent Extent. * @return {boolean} True if the geometry and the extent intersect. */ -ol.geom.flat.intersectsextent.linearRing = - function(flatCoordinates, offset, end, stride, extent) { +ol.geom.flat.intersectsextent.linearRing = function(flatCoordinates, offset, end, stride, extent) { if (ol.geom.flat.intersectsextent.lineString( flatCoordinates, offset, end, stride, extent)) { return true; @@ -109,8 +106,7 @@ ol.geom.flat.intersectsextent.linearRing = * @param {ol.Extent} extent Extent. * @return {boolean} True if the geometry and the extent intersect. */ -ol.geom.flat.intersectsextent.linearRings = - function(flatCoordinates, offset, ends, stride, extent) { +ol.geom.flat.intersectsextent.linearRings = function(flatCoordinates, offset, ends, stride, extent) { goog.asserts.assert(ends.length > 0, 'ends should not be an empty array'); if (!ol.geom.flat.intersectsextent.linearRing( flatCoordinates, offset, ends[0], stride, extent)) { @@ -138,8 +134,7 @@ ol.geom.flat.intersectsextent.linearRings = * @param {ol.Extent} extent Extent. * @return {boolean} True if the geometry and the extent intersect. */ -ol.geom.flat.intersectsextent.linearRingss = - function(flatCoordinates, offset, endss, stride, extent) { +ol.geom.flat.intersectsextent.linearRingss = function(flatCoordinates, offset, endss, stride, extent) { goog.asserts.assert(endss.length > 0, 'endss should not be an empty array'); var i, ii; for (i = 0, ii = endss.length; i < ii; ++i) { diff --git a/src/ol/geom/flat/lengthflatgeom.js b/src/ol/geom/flat/lengthflatgeom.js index ac1c685504..70b7a54d67 100644 --- a/src/ol/geom/flat/lengthflatgeom.js +++ b/src/ol/geom/flat/lengthflatgeom.js @@ -8,8 +8,7 @@ goog.provide('ol.geom.flat.length'); * @param {number} stride Stride. * @return {number} Length. */ -ol.geom.flat.length.lineString = - function(flatCoordinates, offset, end, stride) { +ol.geom.flat.length.lineString = function(flatCoordinates, offset, end, stride) { var x1 = flatCoordinates[offset]; var y1 = flatCoordinates[offset + 1]; var length = 0; @@ -32,8 +31,7 @@ ol.geom.flat.length.lineString = * @param {number} stride Stride. * @return {number} Perimeter. */ -ol.geom.flat.length.linearRing = - function(flatCoordinates, offset, end, stride) { +ol.geom.flat.length.linearRing = function(flatCoordinates, offset, end, stride) { var perimeter = ol.geom.flat.length.lineString(flatCoordinates, offset, end, stride); var dx = flatCoordinates[end - stride] - flatCoordinates[offset]; diff --git a/src/ol/geom/flat/orientflatgeom.js b/src/ol/geom/flat/orientflatgeom.js index 0e177e990d..f8fc0d481b 100644 --- a/src/ol/geom/flat/orientflatgeom.js +++ b/src/ol/geom/flat/orientflatgeom.js @@ -11,8 +11,7 @@ goog.require('ol.geom.flat.reverse'); * @param {number} stride Stride. * @return {boolean} Is clockwise. */ -ol.geom.flat.orient.linearRingIsClockwise = - function(flatCoordinates, offset, end, stride) { +ol.geom.flat.orient.linearRingIsClockwise = function(flatCoordinates, offset, end, stride) { // http://tinyurl.com/clockwise-method // https://github.com/OSGeo/gdal/blob/trunk/gdal/ogr/ogrlinearring.cpp var edge = 0; @@ -42,8 +41,7 @@ ol.geom.flat.orient.linearRingIsClockwise = * (counter-clockwise exterior ring and clockwise interior rings). * @return {boolean} Rings are correctly oriented. */ -ol.geom.flat.orient.linearRingsAreOriented = - function(flatCoordinates, offset, ends, stride, opt_right) { +ol.geom.flat.orient.linearRingsAreOriented = function(flatCoordinates, offset, ends, stride, opt_right) { var right = opt_right !== undefined ? opt_right : false; var i, ii; for (i = 0, ii = ends.length; i < ii; ++i) { @@ -78,8 +76,7 @@ ol.geom.flat.orient.linearRingsAreOriented = * (counter-clockwise exterior ring and clockwise interior rings). * @return {boolean} Rings are correctly oriented. */ -ol.geom.flat.orient.linearRingssAreOriented = - function(flatCoordinates, offset, endss, stride, opt_right) { +ol.geom.flat.orient.linearRingssAreOriented = function(flatCoordinates, offset, endss, stride, opt_right) { var i, ii; for (i = 0, ii = endss.length; i < ii; ++i) { if (!ol.geom.flat.orient.linearRingsAreOriented( @@ -104,8 +101,7 @@ ol.geom.flat.orient.linearRingssAreOriented = * @param {boolean=} opt_right Follow the right-hand rule for orientation. * @return {number} End. */ -ol.geom.flat.orient.orientLinearRings = - function(flatCoordinates, offset, ends, stride, opt_right) { +ol.geom.flat.orient.orientLinearRings = function(flatCoordinates, offset, ends, stride, opt_right) { var right = opt_right !== undefined ? opt_right : false; var i, ii; for (i = 0, ii = ends.length; i < ii; ++i) { @@ -137,8 +133,7 @@ ol.geom.flat.orient.orientLinearRings = * @param {boolean=} opt_right Follow the right-hand rule for orientation. * @return {number} End. */ -ol.geom.flat.orient.orientLinearRingss = - function(flatCoordinates, offset, endss, stride, opt_right) { +ol.geom.flat.orient.orientLinearRingss = function(flatCoordinates, offset, endss, stride, opt_right) { var i, ii; for (i = 0, ii = endss.length; i < ii; ++i) { offset = ol.geom.flat.orient.orientLinearRings( diff --git a/src/ol/geom/flat/reverseflatgeom.js b/src/ol/geom/flat/reverseflatgeom.js index 32ad1dbe01..5202ae1966 100644 --- a/src/ol/geom/flat/reverseflatgeom.js +++ b/src/ol/geom/flat/reverseflatgeom.js @@ -7,8 +7,7 @@ goog.provide('ol.geom.flat.reverse'); * @param {number} end End. * @param {number} stride Stride. */ -ol.geom.flat.reverse.coordinates = - function(flatCoordinates, offset, end, stride) { +ol.geom.flat.reverse.coordinates = function(flatCoordinates, offset, end, stride) { while (offset < end - stride) { var i; for (i = 0; i < stride; ++i) { diff --git a/src/ol/geom/flat/segmentsflatgeom.js b/src/ol/geom/flat/segmentsflatgeom.js index b834eecbdc..21403117ce 100644 --- a/src/ol/geom/flat/segmentsflatgeom.js +++ b/src/ol/geom/flat/segmentsflatgeom.js @@ -16,8 +16,7 @@ goog.provide('ol.geom.flat.segments'); * @return {T|boolean} Value. * @template T,S */ -ol.geom.flat.segments.forEach = - function(flatCoordinates, offset, end, stride, callback, opt_this) { +ol.geom.flat.segments.forEach = function(flatCoordinates, offset, end, stride, callback, opt_this) { var point1 = [flatCoordinates[offset], flatCoordinates[offset + 1]]; var point2 = []; var ret; diff --git a/src/ol/geom/flat/transformflatgeom.js b/src/ol/geom/flat/transformflatgeom.js index 81ecf4a53c..15eec7df0a 100644 --- a/src/ol/geom/flat/transformflatgeom.js +++ b/src/ol/geom/flat/transformflatgeom.js @@ -12,8 +12,7 @@ goog.require('goog.vec.Mat4'); * @param {Array.=} opt_dest Destination. * @return {Array.} Transformed coordinates. */ -ol.geom.flat.transform.transform2D = - function(flatCoordinates, offset, end, stride, transform, opt_dest) { +ol.geom.flat.transform.transform2D = function(flatCoordinates, offset, end, stride, transform, opt_dest) { var m00 = goog.vec.Mat4.getElement(transform, 0, 0); var m10 = goog.vec.Mat4.getElement(transform, 1, 0); var m01 = goog.vec.Mat4.getElement(transform, 0, 1); @@ -46,8 +45,7 @@ ol.geom.flat.transform.transform2D = * @param {Array.=} opt_dest Destination. * @return {Array.} Transformed coordinates. */ -ol.geom.flat.transform.translate = - function(flatCoordinates, offset, end, stride, deltaX, deltaY, opt_dest) { +ol.geom.flat.transform.translate = function(flatCoordinates, offset, end, stride, deltaX, deltaY, opt_dest) { var dest = opt_dest ? opt_dest : []; var i = 0; var j, k; diff --git a/src/ol/geom/geometry.js b/src/ol/geom/geometry.js index a87cb6b853..2e7e98d09b 100644 --- a/src/ol/geom/geometry.js +++ b/src/ol/geom/geometry.js @@ -45,7 +45,6 @@ ol.geom.GeometryLayout = { }; - /** * @classdesc * Abstract base class; normally only used for creating subclasses and not diff --git a/src/ol/geom/geometrycollection.js b/src/ol/geom/geometrycollection.js index d81fd7a867..68a24133a0 100644 --- a/src/ol/geom/geometrycollection.js +++ b/src/ol/geom/geometrycollection.js @@ -8,7 +8,6 @@ goog.require('ol.geom.Geometry'); goog.require('ol.geom.GeometryType'); - /** * @classdesc * An array of {@link ol.geom.Geometry} objects. @@ -95,8 +94,7 @@ ol.geom.GeometryCollection.prototype.clone = function() { /** * @inheritDoc */ -ol.geom.GeometryCollection.prototype.closestPointXY = - function(x, y, closestPoint, minSquaredDistance) { +ol.geom.GeometryCollection.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) { if (minSquaredDistance < ol.extent.closestSquaredDistanceXY(this.getExtent(), x, y)) { return minSquaredDistance; @@ -160,8 +158,7 @@ ol.geom.GeometryCollection.prototype.getGeometriesArray = function() { /** * @inheritDoc */ -ol.geom.GeometryCollection.prototype.getSimplifiedGeometry = - function(squaredTolerance) { +ol.geom.GeometryCollection.prototype.getSimplifiedGeometry = function(squaredTolerance) { if (this.simplifiedGeometryRevision != this.getRevision()) { goog.object.clear(this.simplifiedGeometryCache); this.simplifiedGeometryMaxMinSquaredTolerance = 0; diff --git a/src/ol/geom/linearring.js b/src/ol/geom/linearring.js index a78ad6439b..493de55d90 100644 --- a/src/ol/geom/linearring.js +++ b/src/ol/geom/linearring.js @@ -11,7 +11,6 @@ goog.require('ol.geom.flat.inflate'); goog.require('ol.geom.flat.simplify'); - /** * @classdesc * Linear ring geometry. Only used as part of polygon; cannot be rendered @@ -60,8 +59,7 @@ ol.geom.LinearRing.prototype.clone = function() { /** * @inheritDoc */ -ol.geom.LinearRing.prototype.closestPointXY = - function(x, y, closestPoint, minSquaredDistance) { +ol.geom.LinearRing.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) { if (minSquaredDistance < ol.extent.closestSquaredDistanceXY(this.getExtent(), x, y)) { return minSquaredDistance; @@ -102,8 +100,7 @@ ol.geom.LinearRing.prototype.getCoordinates = function() { /** * @inheritDoc */ -ol.geom.LinearRing.prototype.getSimplifiedGeometryInternal = - function(squaredTolerance) { +ol.geom.LinearRing.prototype.getSimplifiedGeometryInternal = function(squaredTolerance) { var simplifiedFlatCoordinates = []; simplifiedFlatCoordinates.length = ol.geom.flat.simplify.douglasPeucker( this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, @@ -130,8 +127,7 @@ ol.geom.LinearRing.prototype.getType = function() { * @param {ol.geom.GeometryLayout=} opt_layout Layout. * @api stable */ -ol.geom.LinearRing.prototype.setCoordinates = - function(coordinates, opt_layout) { +ol.geom.LinearRing.prototype.setCoordinates = function(coordinates, opt_layout) { if (!coordinates) { this.setFlatCoordinates(ol.geom.GeometryLayout.XY, null); } else { @@ -150,8 +146,7 @@ ol.geom.LinearRing.prototype.setCoordinates = * @param {ol.geom.GeometryLayout} layout Layout. * @param {Array.} flatCoordinates Flat coordinates. */ -ol.geom.LinearRing.prototype.setFlatCoordinates = - function(layout, flatCoordinates) { +ol.geom.LinearRing.prototype.setFlatCoordinates = function(layout, flatCoordinates) { this.setFlatCoordinatesInternal(layout, flatCoordinates); this.changed(); }; diff --git a/src/ol/geom/linestring.js b/src/ol/geom/linestring.js index ad99d257bd..2be2b21b10 100644 --- a/src/ol/geom/linestring.js +++ b/src/ol/geom/linestring.js @@ -17,7 +17,6 @@ goog.require('ol.geom.flat.segments'); goog.require('ol.geom.flat.simplify'); - /** * @classdesc * Linestring geometry. @@ -94,8 +93,7 @@ ol.geom.LineString.prototype.clone = function() { /** * @inheritDoc */ -ol.geom.LineString.prototype.closestPointXY = - function(x, y, closestPoint, minSquaredDistance) { +ol.geom.LineString.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) { if (minSquaredDistance < ol.extent.closestSquaredDistanceXY(this.getExtent(), x, y)) { return minSquaredDistance; @@ -209,8 +207,7 @@ ol.geom.LineString.prototype.getFlatMidpoint = function() { /** * @inheritDoc */ -ol.geom.LineString.prototype.getSimplifiedGeometryInternal = - function(squaredTolerance) { +ol.geom.LineString.prototype.getSimplifiedGeometryInternal = function(squaredTolerance) { var simplifiedFlatCoordinates = []; simplifiedFlatCoordinates.length = ol.geom.flat.simplify.douglasPeucker( this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, @@ -248,8 +245,7 @@ ol.geom.LineString.prototype.intersectsExtent = function(extent) { * @param {ol.geom.GeometryLayout=} opt_layout Layout. * @api stable */ -ol.geom.LineString.prototype.setCoordinates = - function(coordinates, opt_layout) { +ol.geom.LineString.prototype.setCoordinates = function(coordinates, opt_layout) { if (!coordinates) { this.setFlatCoordinates(ol.geom.GeometryLayout.XY, null); } else { @@ -268,8 +264,7 @@ ol.geom.LineString.prototype.setCoordinates = * @param {ol.geom.GeometryLayout} layout Layout. * @param {Array.} flatCoordinates Flat coordinates. */ -ol.geom.LineString.prototype.setFlatCoordinates = - function(layout, flatCoordinates) { +ol.geom.LineString.prototype.setFlatCoordinates = function(layout, flatCoordinates) { this.setFlatCoordinatesInternal(layout, flatCoordinates); this.changed(); }; diff --git a/src/ol/geom/multilinestring.js b/src/ol/geom/multilinestring.js index f227330286..fce9293baf 100644 --- a/src/ol/geom/multilinestring.js +++ b/src/ol/geom/multilinestring.js @@ -16,7 +16,6 @@ goog.require('ol.geom.flat.intersectsextent'); goog.require('ol.geom.flat.simplify'); - /** * @classdesc * Multi-linestring geometry. @@ -90,8 +89,7 @@ ol.geom.MultiLineString.prototype.clone = function() { /** * @inheritDoc */ -ol.geom.MultiLineString.prototype.closestPointXY = - function(x, y, closestPoint, minSquaredDistance) { +ol.geom.MultiLineString.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) { if (minSquaredDistance < ol.extent.closestSquaredDistanceXY(this.getExtent(), x, y)) { return minSquaredDistance; @@ -129,8 +127,7 @@ ol.geom.MultiLineString.prototype.closestPointXY = * @return {ol.Coordinate} Coordinate. * @api stable */ -ol.geom.MultiLineString.prototype.getCoordinateAtM = - function(m, opt_extrapolate, opt_interpolate) { +ol.geom.MultiLineString.prototype.getCoordinateAtM = function(m, opt_extrapolate, opt_interpolate) { if ((this.layout != ol.geom.GeometryLayout.XYM && this.layout != ol.geom.GeometryLayout.XYZM) || this.flatCoordinates.length === 0) { @@ -229,8 +226,7 @@ ol.geom.MultiLineString.prototype.getFlatMidpoints = function() { /** * @inheritDoc */ -ol.geom.MultiLineString.prototype.getSimplifiedGeometryInternal = - function(squaredTolerance) { +ol.geom.MultiLineString.prototype.getSimplifiedGeometryInternal = function(squaredTolerance) { var simplifiedFlatCoordinates = []; var simplifiedEnds = []; simplifiedFlatCoordinates.length = ol.geom.flat.simplify.douglasPeuckers( @@ -268,8 +264,7 @@ ol.geom.MultiLineString.prototype.intersectsExtent = function(extent) { * @param {ol.geom.GeometryLayout=} opt_layout Layout. * @api stable */ -ol.geom.MultiLineString.prototype.setCoordinates = - function(coordinates, opt_layout) { +ol.geom.MultiLineString.prototype.setCoordinates = function(coordinates, opt_layout) { if (!coordinates) { this.setFlatCoordinates(ol.geom.GeometryLayout.XY, null, this.ends_); } else { @@ -290,8 +285,7 @@ ol.geom.MultiLineString.prototype.setCoordinates = * @param {Array.} flatCoordinates Flat coordinates. * @param {Array.} ends Ends. */ -ol.geom.MultiLineString.prototype.setFlatCoordinates = - function(layout, flatCoordinates, ends) { +ol.geom.MultiLineString.prototype.setFlatCoordinates = function(layout, flatCoordinates, ends) { if (!flatCoordinates) { goog.asserts.assert(ends && ends.length === 0, 'ends must be truthy and ends.length should be 0'); diff --git a/src/ol/geom/multipoint.js b/src/ol/geom/multipoint.js index d559c72b4d..5a8d9d1201 100644 --- a/src/ol/geom/multipoint.js +++ b/src/ol/geom/multipoint.js @@ -12,7 +12,6 @@ goog.require('ol.geom.flat.inflate'); goog.require('ol.math'); - /** * @classdesc * Multi-point geometry. @@ -62,8 +61,7 @@ ol.geom.MultiPoint.prototype.clone = function() { /** * @inheritDoc */ -ol.geom.MultiPoint.prototype.closestPointXY = - function(x, y, closestPoint, minSquaredDistance) { +ol.geom.MultiPoint.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) { if (minSquaredDistance < ol.extent.closestSquaredDistanceXY(this.getExtent(), x, y)) { return minSquaredDistance; @@ -173,8 +171,7 @@ ol.geom.MultiPoint.prototype.intersectsExtent = function(extent) { * @param {ol.geom.GeometryLayout=} opt_layout Layout. * @api stable */ -ol.geom.MultiPoint.prototype.setCoordinates = - function(coordinates, opt_layout) { +ol.geom.MultiPoint.prototype.setCoordinates = function(coordinates, opt_layout) { if (!coordinates) { this.setFlatCoordinates(ol.geom.GeometryLayout.XY, null); } else { @@ -193,8 +190,7 @@ ol.geom.MultiPoint.prototype.setCoordinates = * @param {ol.geom.GeometryLayout} layout Layout. * @param {Array.} flatCoordinates Flat coordinates. */ -ol.geom.MultiPoint.prototype.setFlatCoordinates = - function(layout, flatCoordinates) { +ol.geom.MultiPoint.prototype.setFlatCoordinates = function(layout, flatCoordinates) { this.setFlatCoordinatesInternal(layout, flatCoordinates); this.changed(); }; diff --git a/src/ol/geom/multipolygon.js b/src/ol/geom/multipolygon.js index d166402045..0570ebca48 100644 --- a/src/ol/geom/multipolygon.js +++ b/src/ol/geom/multipolygon.js @@ -22,7 +22,6 @@ goog.require('ol.geom.flat.orient'); goog.require('ol.geom.flat.simplify'); - /** * @classdesc * Multi-polygon geometry. @@ -131,8 +130,7 @@ ol.geom.MultiPolygon.prototype.clone = function() { /** * @inheritDoc */ -ol.geom.MultiPolygon.prototype.closestPointXY = - function(x, y, closestPoint, minSquaredDistance) { +ol.geom.MultiPolygon.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) { if (minSquaredDistance < ol.extent.closestSquaredDistanceXY(this.getExtent(), x, y)) { return minSquaredDistance; @@ -257,8 +255,7 @@ ol.geom.MultiPolygon.prototype.getOrientedFlatCoordinates = function() { /** * @inheritDoc */ -ol.geom.MultiPolygon.prototype.getSimplifiedGeometryInternal = - function(squaredTolerance) { +ol.geom.MultiPolygon.prototype.getSimplifiedGeometryInternal = function(squaredTolerance) { var simplifiedFlatCoordinates = []; var simplifiedEndss = []; simplifiedFlatCoordinates.length = ol.geom.flat.simplify.quantizess( @@ -361,8 +358,7 @@ ol.geom.MultiPolygon.prototype.intersectsExtent = function(extent) { * @param {ol.geom.GeometryLayout=} opt_layout Layout. * @api stable */ -ol.geom.MultiPolygon.prototype.setCoordinates = - function(coordinates, opt_layout) { +ol.geom.MultiPolygon.prototype.setCoordinates = function(coordinates, opt_layout) { if (!coordinates) { this.setFlatCoordinates(ol.geom.GeometryLayout.XY, null, this.endss_); } else { @@ -389,8 +385,7 @@ ol.geom.MultiPolygon.prototype.setCoordinates = * @param {Array.} flatCoordinates Flat coordinates. * @param {Array.>} endss Endss. */ -ol.geom.MultiPolygon.prototype.setFlatCoordinates = - function(layout, flatCoordinates, endss) { +ol.geom.MultiPolygon.prototype.setFlatCoordinates = function(layout, flatCoordinates, endss) { goog.asserts.assert(endss, 'endss must be truthy'); if (!flatCoordinates || flatCoordinates.length === 0) { goog.asserts.assert(endss.length === 0, 'the length of endss should be 0'); diff --git a/src/ol/geom/point.js b/src/ol/geom/point.js index 862b5322df..45143cae51 100644 --- a/src/ol/geom/point.js +++ b/src/ol/geom/point.js @@ -8,7 +8,6 @@ goog.require('ol.geom.flat.deflate'); goog.require('ol.math'); - /** * @classdesc * Point geometry. @@ -41,8 +40,7 @@ ol.geom.Point.prototype.clone = function() { /** * @inheritDoc */ -ol.geom.Point.prototype.closestPointXY = - function(x, y, closestPoint, minSquaredDistance) { +ol.geom.Point.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) { var flatCoordinates = this.flatCoordinates; var squaredDistance = ol.math.squaredDistance( x, y, flatCoordinates[0], flatCoordinates[1]); diff --git a/src/ol/geom/polygon.js b/src/ol/geom/polygon.js index 9e7d735465..24fa72c6e9 100644 --- a/src/ol/geom/polygon.js +++ b/src/ol/geom/polygon.js @@ -21,7 +21,6 @@ goog.require('ol.geom.flat.orient'); goog.require('ol.geom.flat.simplify'); - /** * @classdesc * Polygon geometry. @@ -118,8 +117,7 @@ ol.geom.Polygon.prototype.clone = function() { /** * @inheritDoc */ -ol.geom.Polygon.prototype.closestPointXY = - function(x, y, closestPoint, minSquaredDistance) { +ol.geom.Polygon.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) { if (minSquaredDistance < ol.extent.closestSquaredDistanceXY(this.getExtent(), x, y)) { return minSquaredDistance; @@ -298,8 +296,7 @@ ol.geom.Polygon.prototype.getOrientedFlatCoordinates = function() { /** * @inheritDoc */ -ol.geom.Polygon.prototype.getSimplifiedGeometryInternal = - function(squaredTolerance) { +ol.geom.Polygon.prototype.getSimplifiedGeometryInternal = function(squaredTolerance) { var simplifiedFlatCoordinates = []; var simplifiedEnds = []; simplifiedFlatCoordinates.length = ol.geom.flat.simplify.quantizes( @@ -359,8 +356,7 @@ ol.geom.Polygon.prototype.setCoordinates = function(coordinates, opt_layout) { * @param {Array.} flatCoordinates Flat coordinates. * @param {Array.} ends Ends. */ -ol.geom.Polygon.prototype.setFlatCoordinates = - function(layout, flatCoordinates, ends) { +ol.geom.Polygon.prototype.setFlatCoordinates = function(layout, flatCoordinates, ends) { if (!flatCoordinates) { goog.asserts.assert(ends && ends.length === 0, 'ends must be an empty array'); diff --git a/src/ol/geom/simplegeometry.js b/src/ol/geom/simplegeometry.js index 1ddb4e3c12..c1cbd6abf3 100644 --- a/src/ol/geom/simplegeometry.js +++ b/src/ol/geom/simplegeometry.js @@ -9,7 +9,6 @@ goog.require('ol.geom.GeometryLayout'); goog.require('ol.geom.flat.transform'); - /** * @classdesc * Abstract base class; only used for creating subclasses; do not instantiate @@ -145,8 +144,7 @@ ol.geom.SimpleGeometry.prototype.getLayout = function() { /** * @inheritDoc */ -ol.geom.SimpleGeometry.prototype.getSimplifiedGeometry = - function(squaredTolerance) { +ol.geom.SimpleGeometry.prototype.getSimplifiedGeometry = function(squaredTolerance) { if (this.simplifiedGeometryRevision != this.getRevision()) { goog.object.clear(this.simplifiedGeometryCache); this.simplifiedGeometryMaxMinSquaredTolerance = 0; @@ -188,8 +186,7 @@ ol.geom.SimpleGeometry.prototype.getSimplifiedGeometry = * @return {ol.geom.SimpleGeometry} Simplified geometry. * @protected */ -ol.geom.SimpleGeometry.prototype.getSimplifiedGeometryInternal = - function(squaredTolerance) { +ol.geom.SimpleGeometry.prototype.getSimplifiedGeometryInternal = function(squaredTolerance) { return this; }; @@ -207,8 +204,7 @@ ol.geom.SimpleGeometry.prototype.getStride = function() { * @param {Array.} flatCoordinates Flat coordinates. * @protected */ -ol.geom.SimpleGeometry.prototype.setFlatCoordinatesInternal = - function(layout, flatCoordinates) { +ol.geom.SimpleGeometry.prototype.setFlatCoordinatesInternal = function(layout, flatCoordinates) { this.stride = ol.geom.SimpleGeometry.getStrideForLayout(layout); this.layout = layout; this.flatCoordinates = flatCoordinates; @@ -228,8 +224,7 @@ ol.geom.SimpleGeometry.prototype.setCoordinates = goog.abstractMethod; * @param {number} nesting Nesting. * @protected */ -ol.geom.SimpleGeometry.prototype.setLayout = - function(layout, coordinates, nesting) { +ol.geom.SimpleGeometry.prototype.setLayout = function(layout, coordinates, nesting) { /** @type {number} */ var stride; if (layout) { @@ -287,8 +282,7 @@ ol.geom.SimpleGeometry.prototype.translate = function(deltaX, deltaY) { * @param {Array.=} opt_dest Destination. * @return {Array.} Transformed flat coordinates. */ -ol.geom.transformSimpleGeometry2D = - function(simpleGeometry, transform, opt_dest) { +ol.geom.transformSimpleGeometry2D = function(simpleGeometry, transform, opt_dest) { var flatCoordinates = simpleGeometry.getFlatCoordinates(); if (!flatCoordinates) { return null; diff --git a/src/ol/graticule.js b/src/ol/graticule.js index 03ce26d3b2..94732ea570 100644 --- a/src/ol/graticule.js +++ b/src/ol/graticule.js @@ -11,7 +11,6 @@ goog.require('ol.render.EventType'); goog.require('ol.style.Stroke'); - /** * Render a grid for a coordinate system on a map. * @constructor @@ -167,8 +166,7 @@ ol.Graticule.intervals_ = [90, 45, 30, 20, 10, 5, 2, 1, 0.5, 0.2, 0.1, 0.05, * @return {number} Index. * @private */ -ol.Graticule.prototype.addMeridian_ = - function(lon, minLat, maxLat, squaredTolerance, extent, index) { +ol.Graticule.prototype.addMeridian_ = function(lon, minLat, maxLat, squaredTolerance, extent, index) { var lineString = this.getMeridian_(lon, minLat, maxLat, squaredTolerance, index); if (ol.extent.intersects(lineString.getExtent(), extent)) { @@ -188,8 +186,7 @@ ol.Graticule.prototype.addMeridian_ = * @return {number} Index. * @private */ -ol.Graticule.prototype.addParallel_ = - function(lat, minLon, maxLon, squaredTolerance, extent, index) { +ol.Graticule.prototype.addParallel_ = function(lat, minLon, maxLon, squaredTolerance, extent, index) { var lineString = this.getParallel_(lat, minLon, maxLon, squaredTolerance, index); if (ol.extent.intersects(lineString.getExtent(), extent)) { @@ -206,8 +203,7 @@ ol.Graticule.prototype.addParallel_ = * @param {number} squaredTolerance Squared tolerance. * @private */ -ol.Graticule.prototype.createGraticule_ = - function(extent, center, resolution, squaredTolerance) { +ol.Graticule.prototype.createGraticule_ = function(extent, center, resolution, squaredTolerance) { var interval = this.getInterval_(resolution); if (interval == -1) { diff --git a/src/ol/has.js b/src/ol/has.js index 36ea64dc48..91fe1c07b0 100644 --- a/src/ol/has.js +++ b/src/ol/has.js @@ -133,7 +133,9 @@ ol.has.WEBGL; (gl.getParameter(gl.MAX_TEXTURE_SIZE)); extensions = gl.getSupportedExtensions(); } - } catch (e) {} + } catch (e) { + // pass + } } ol.has.WEBGL = hasWebGL; ol.WEBGL_EXTENSIONS = extensions; diff --git a/src/ol/image.js b/src/ol/image.js index 6b426d962c..5dbab13edb 100644 --- a/src/ol/image.js +++ b/src/ol/image.js @@ -9,7 +9,6 @@ goog.require('ol.ImageState'); goog.require('ol.extent'); - /** * @constructor * @extends {ol.ImageBase} diff --git a/src/ol/imagebase.js b/src/ol/imagebase.js index e188221977..25c922b355 100644 --- a/src/ol/imagebase.js +++ b/src/ol/imagebase.js @@ -19,7 +19,6 @@ ol.ImageState = { }; - /** * @constructor * @extends {goog.events.EventTarget} diff --git a/src/ol/imagecanvas.js b/src/ol/imagecanvas.js index 743af73486..d12faf242b 100644 --- a/src/ol/imagecanvas.js +++ b/src/ol/imagecanvas.js @@ -5,7 +5,6 @@ goog.require('ol.ImageBase'); goog.require('ol.ImageState'); - /** * @constructor * @extends {ol.ImageBase} diff --git a/src/ol/imagetile.js b/src/ol/imagetile.js index 74dfaa3953..ed2562ae44 100644 --- a/src/ol/imagetile.js +++ b/src/ol/imagetile.js @@ -10,7 +10,6 @@ goog.require('ol.TileLoadFunctionType'); goog.require('ol.TileState'); - /** * @constructor * @extends {ol.Tile} diff --git a/src/ol/interaction/doubleclickzoominteraction.js b/src/ol/interaction/doubleclickzoominteraction.js index 634b2837d3..2844090ee6 100644 --- a/src/ol/interaction/doubleclickzoominteraction.js +++ b/src/ol/interaction/doubleclickzoominteraction.js @@ -6,7 +6,6 @@ goog.require('ol.MapBrowserEvent.EventType'); goog.require('ol.interaction.Interaction'); - /** * @classdesc * Allows the user to zoom by double-clicking on the map. diff --git a/src/ol/interaction/draganddropinteraction.js b/src/ol/interaction/draganddropinteraction.js index 105461a143..5b2a4f5b60 100644 --- a/src/ol/interaction/draganddropinteraction.js +++ b/src/ol/interaction/draganddropinteraction.js @@ -14,7 +14,6 @@ goog.require('ol.interaction.Interaction'); goog.require('ol.proj'); - /** * @classdesc * Handles input of vector data by drag and drop. @@ -198,7 +197,6 @@ ol.interaction.DragAndDropEventType = { }; - /** * @classdesc * Events emitted by {@link ol.interaction.DragAndDrop} instances are instances @@ -213,8 +211,7 @@ ol.interaction.DragAndDropEventType = { * @param {Array.=} opt_features Features. * @param {ol.proj.Projection=} opt_projection Projection. */ -ol.interaction.DragAndDropEvent = - function(type, target, file, opt_features, opt_projection) { +ol.interaction.DragAndDropEvent = function(type, target, file, opt_features, opt_projection) { goog.base(this, type, target); diff --git a/src/ol/interaction/dragboxinteraction.js b/src/ol/interaction/dragboxinteraction.js index f3531ab18b..f272e0aca4 100644 --- a/src/ol/interaction/dragboxinteraction.js +++ b/src/ol/interaction/dragboxinteraction.js @@ -38,7 +38,6 @@ ol.DragBoxEventType = { }; - /** * @classdesc * Events emitted by {@link ol.interaction.DragBox} instances are instances of @@ -83,7 +82,6 @@ goog.inherits(ol.DragBoxEvent, goog.events.Event); ol.interaction.DragBoxEndConditionType; - /** * @classdesc * Allows the user to draw a vector box by clicking and dragging on the map, diff --git a/src/ol/interaction/dragpaninteraction.js b/src/ol/interaction/dragpaninteraction.js index 39ec107347..f3962b7bc7 100644 --- a/src/ol/interaction/dragpaninteraction.js +++ b/src/ol/interaction/dragpaninteraction.js @@ -10,7 +10,6 @@ goog.require('ol.events.condition'); goog.require('ol.interaction.Pointer'); - /** * @classdesc * Allows the user to pan the map by dragging the map. diff --git a/src/ol/interaction/dragrotateandzoominteraction.js b/src/ol/interaction/dragrotateandzoominteraction.js index a06fd0f683..5e7083f4f7 100644 --- a/src/ol/interaction/dragrotateandzoominteraction.js +++ b/src/ol/interaction/dragrotateandzoominteraction.js @@ -9,7 +9,6 @@ goog.require('ol.interaction.Interaction'); goog.require('ol.interaction.Pointer'); - /** * @classdesc * Allows the user to zoom and rotate the map by clicking and dragging diff --git a/src/ol/interaction/dragrotateinteraction.js b/src/ol/interaction/dragrotateinteraction.js index fca22c0d12..3b6af05b57 100644 --- a/src/ol/interaction/dragrotateinteraction.js +++ b/src/ol/interaction/dragrotateinteraction.js @@ -8,7 +8,6 @@ goog.require('ol.interaction.Interaction'); goog.require('ol.interaction.Pointer'); - /** * @classdesc * Allows the user to rotate the map by clicking and dragging on the map, diff --git a/src/ol/interaction/dragzoominteraction.js b/src/ol/interaction/dragzoominteraction.js index 939dfeb561..ed08e9056c 100644 --- a/src/ol/interaction/dragzoominteraction.js +++ b/src/ol/interaction/dragzoominteraction.js @@ -8,7 +8,6 @@ goog.require('ol.extent'); goog.require('ol.interaction.DragBox'); - /** * @classdesc * Allows the user to zoom the map by clicking and dragging on the map, diff --git a/src/ol/interaction/drawinteraction.js b/src/ol/interaction/drawinteraction.js index aa8ae8b56f..6daeed903c 100644 --- a/src/ol/interaction/drawinteraction.js +++ b/src/ol/interaction/drawinteraction.js @@ -49,7 +49,6 @@ ol.interaction.DrawEventType = { }; - /** * @classdesc * Events emitted by {@link ol.interaction.Draw} instances are instances of @@ -76,7 +75,6 @@ ol.interaction.DrawEvent = function(type, feature) { goog.inherits(ol.interaction.DrawEvent, goog.events.Event); - /** * @classdesc * Interaction for drawing feature geometries. @@ -166,8 +164,9 @@ ol.interaction.Draw = function(options) { if (this.type_ === ol.geom.GeometryType.CIRCLE) { /** * @param {ol.Coordinate|Array.|Array.>} coordinates - * @param {ol.geom.SimpleGeometry=} opt_geometry - * @return {ol.geom.SimpleGeometry} + * The coordinates. + * @param {ol.geom.SimpleGeometry=} opt_geometry Optional geometry. + * @return {ol.geom.SimpleGeometry} A geometry. */ geometryFunction = function(coordinates, opt_geometry) { var circle = opt_geometry ? opt_geometry : @@ -191,8 +190,9 @@ ol.interaction.Draw = function(options) { } /** * @param {ol.Coordinate|Array.|Array.>} coordinates - * @param {ol.geom.SimpleGeometry=} opt_geometry - * @return {ol.geom.SimpleGeometry} + * The coordinates. + * @param {ol.geom.SimpleGeometry=} opt_geometry Optional geometry. + * @return {ol.geom.SimpleGeometry} A geometry. */ geometryFunction = function(coordinates, opt_geometry) { var geometry = opt_geometry; diff --git a/src/ol/interaction/interaction.js b/src/ol/interaction/interaction.js index ee3cd56e2e..8a61e99883 100644 --- a/src/ol/interaction/interaction.js +++ b/src/ol/interaction/interaction.js @@ -18,7 +18,6 @@ ol.interaction.InteractionProperty = { }; - /** * @classdesc * Abstract base class; normally only used for creating subclasses and not @@ -131,8 +130,7 @@ ol.interaction.Interaction.pan = function(map, view, delta, opt_duration) { * @param {ol.Coordinate=} opt_anchor Anchor coordinate. * @param {number=} opt_duration Duration. */ -ol.interaction.Interaction.rotate = - function(map, view, rotation, opt_anchor, opt_duration) { +ol.interaction.Interaction.rotate = function(map, view, rotation, opt_anchor, opt_duration) { rotation = view.constrainRotation(rotation, 0); ol.interaction.Interaction.rotateWithoutConstraints( map, view, rotation, opt_anchor, opt_duration); @@ -146,8 +144,7 @@ ol.interaction.Interaction.rotate = * @param {ol.Coordinate=} opt_anchor Anchor coordinate. * @param {number=} opt_duration Duration. */ -ol.interaction.Interaction.rotateWithoutConstraints = - function(map, view, rotation, opt_anchor, opt_duration) { +ol.interaction.Interaction.rotateWithoutConstraints = function(map, view, rotation, opt_anchor, opt_duration) { if (rotation !== undefined) { var currentRotation = view.getRotation(); var currentCenter = view.getCenter(); @@ -186,8 +183,7 @@ ol.interaction.Interaction.rotateWithoutConstraints = * will select the nearest resolution. If not defined 0 is * assumed. */ -ol.interaction.Interaction.zoom = - function(map, view, resolution, opt_anchor, opt_duration, opt_direction) { +ol.interaction.Interaction.zoom = function(map, view, resolution, opt_anchor, opt_duration, opt_direction) { resolution = view.constrainResolution(resolution, 0, opt_direction); ol.interaction.Interaction.zoomWithoutConstraints( map, view, resolution, opt_anchor, opt_duration); @@ -201,8 +197,7 @@ ol.interaction.Interaction.zoom = * @param {ol.Coordinate=} opt_anchor Anchor coordinate. * @param {number=} opt_duration Duration. */ -ol.interaction.Interaction.zoomByDelta = - function(map, view, delta, opt_anchor, opt_duration) { +ol.interaction.Interaction.zoomByDelta = function(map, view, delta, opt_anchor, opt_duration) { var currentResolution = view.getResolution(); var resolution = view.constrainResolution(currentResolution, delta, 0); ol.interaction.Interaction.zoomWithoutConstraints( @@ -217,8 +212,7 @@ ol.interaction.Interaction.zoomByDelta = * @param {ol.Coordinate=} opt_anchor Anchor coordinate. * @param {number=} opt_duration Duration. */ -ol.interaction.Interaction.zoomWithoutConstraints = - function(map, view, resolution, opt_anchor, opt_duration) { +ol.interaction.Interaction.zoomWithoutConstraints = function(map, view, resolution, opt_anchor, opt_duration) { if (resolution) { var currentResolution = view.getResolution(); var currentCenter = view.getCenter(); diff --git a/src/ol/interaction/keyboardpaninteraction.js b/src/ol/interaction/keyboardpaninteraction.js index 0caeb267ba..9a2df3beba 100644 --- a/src/ol/interaction/keyboardpaninteraction.js +++ b/src/ol/interaction/keyboardpaninteraction.js @@ -11,7 +11,6 @@ goog.require('ol.events.condition'); goog.require('ol.interaction.Interaction'); - /** * @classdesc * Allows the user to pan the map using keyboard arrows. diff --git a/src/ol/interaction/keyboardzoominteraction.js b/src/ol/interaction/keyboardzoominteraction.js index 9e422c896c..6892ed9af3 100644 --- a/src/ol/interaction/keyboardzoominteraction.js +++ b/src/ol/interaction/keyboardzoominteraction.js @@ -7,7 +7,6 @@ goog.require('ol.events.condition'); goog.require('ol.interaction.Interaction'); - /** * @classdesc * Allows the user to zoom the map using keyboard + and -. diff --git a/src/ol/interaction/modifyinteraction.js b/src/ol/interaction/modifyinteraction.js index 24d5a55000..e840dedcea 100644 --- a/src/ol/interaction/modifyinteraction.js +++ b/src/ol/interaction/modifyinteraction.js @@ -49,7 +49,6 @@ ol.ModifyEventType = { }; - /** * @classdesc * Events emitted by {@link ol.interaction.Modify} instances are instances of @@ -94,7 +93,6 @@ goog.inherits(ol.interaction.ModifyEvent, goog.events.Event); ol.interaction.SegmentDataType; - /** * @classdesc * Interaction for modifying feature geometries. @@ -359,8 +357,7 @@ ol.interaction.Modify.prototype.handleFeatureRemove_ = function(evt) { * @param {ol.geom.Point} geometry Geometry. * @private */ -ol.interaction.Modify.prototype.writePointGeometry_ = - function(feature, geometry) { +ol.interaction.Modify.prototype.writePointGeometry_ = function(feature, geometry) { var coordinates = geometry.getCoordinates(); var segmentData = /** @type {ol.interaction.SegmentDataType} */ ({ feature: feature, @@ -376,8 +373,7 @@ ol.interaction.Modify.prototype.writePointGeometry_ = * @param {ol.geom.MultiPoint} geometry Geometry. * @private */ -ol.interaction.Modify.prototype.writeMultiPointGeometry_ = - function(feature, geometry) { +ol.interaction.Modify.prototype.writeMultiPointGeometry_ = function(feature, geometry) { var points = geometry.getCoordinates(); var coordinates, i, ii, segmentData; for (i = 0, ii = points.length; i < ii; ++i) { @@ -399,8 +395,7 @@ ol.interaction.Modify.prototype.writeMultiPointGeometry_ = * @param {ol.geom.LineString} geometry Geometry. * @private */ -ol.interaction.Modify.prototype.writeLineStringGeometry_ = - function(feature, geometry) { +ol.interaction.Modify.prototype.writeLineStringGeometry_ = function(feature, geometry) { var coordinates = geometry.getCoordinates(); var i, ii, segment, segmentData; for (i = 0, ii = coordinates.length - 1; i < ii; ++i) { @@ -421,8 +416,7 @@ ol.interaction.Modify.prototype.writeLineStringGeometry_ = * @param {ol.geom.MultiLineString} geometry Geometry. * @private */ -ol.interaction.Modify.prototype.writeMultiLineStringGeometry_ = - function(feature, geometry) { +ol.interaction.Modify.prototype.writeMultiLineStringGeometry_ = function(feature, geometry) { var lines = geometry.getCoordinates(); var coordinates, i, ii, j, jj, segment, segmentData; for (j = 0, jj = lines.length; j < jj; ++j) { @@ -447,8 +441,7 @@ ol.interaction.Modify.prototype.writeMultiLineStringGeometry_ = * @param {ol.geom.Polygon} geometry Geometry. * @private */ -ol.interaction.Modify.prototype.writePolygonGeometry_ = - function(feature, geometry) { +ol.interaction.Modify.prototype.writePolygonGeometry_ = function(feature, geometry) { var rings = geometry.getCoordinates(); var coordinates, i, ii, j, jj, segment, segmentData; for (j = 0, jj = rings.length; j < jj; ++j) { @@ -473,8 +466,7 @@ ol.interaction.Modify.prototype.writePolygonGeometry_ = * @param {ol.geom.MultiPolygon} geometry Geometry. * @private */ -ol.interaction.Modify.prototype.writeMultiPolygonGeometry_ = - function(feature, geometry) { +ol.interaction.Modify.prototype.writeMultiPolygonGeometry_ = function(feature, geometry) { var polygons = geometry.getCoordinates(); var coordinates, i, ii, j, jj, k, kk, rings, segment, segmentData; for (k = 0, kk = polygons.length; k < kk; ++k) { @@ -502,8 +494,7 @@ ol.interaction.Modify.prototype.writeMultiPolygonGeometry_ = * @param {ol.geom.GeometryCollection} geometry Geometry. * @private */ -ol.interaction.Modify.prototype.writeGeometryCollectionGeometry_ = - function(feature, geometry) { +ol.interaction.Modify.prototype.writeGeometryCollectionGeometry_ = function(feature, geometry) { var i, geometries = geometry.getGeometriesArray(); for (i = 0; i < geometries.length; ++i) { this.SEGMENT_WRITERS_[geometries[i].getType()].call( @@ -517,8 +508,7 @@ ol.interaction.Modify.prototype.writeGeometryCollectionGeometry_ = * @return {ol.Feature} Vertex feature. * @private */ -ol.interaction.Modify.prototype.createOrUpdateVertexFeature_ = - function(coordinates) { +ol.interaction.Modify.prototype.createOrUpdateVertexFeature_ = function(coordinates) { var vertexFeature = this.vertexFeature_; if (!vertexFeature) { vertexFeature = new ol.Feature(new ol.geom.Point(coordinates)); @@ -533,9 +523,9 @@ ol.interaction.Modify.prototype.createOrUpdateVertexFeature_ = /** - * @param {ol.interaction.SegmentDataType} a - * @param {ol.interaction.SegmentDataType} b - * @return {number} + * @param {ol.interaction.SegmentDataType} a The first segment data. + * @param {ol.interaction.SegmentDataType} b The second segment data. + * @return {number} The difference in indexes. * @private */ ol.interaction.Modify.compareIndexes_ = function(a, b) { @@ -600,8 +590,8 @@ ol.interaction.Modify.handleDownEvent_ = function(evt) { if (insertVertices.length) { this.willModifyFeatures_(evt); } - for (i = insertVertices.length - 1; i >= 0; --i) { - this.insertVertex_.apply(this, insertVertices[i]); + for (var j = insertVertices.length - 1; j >= 0; --j) { + this.insertVertex_.apply(this, insertVertices[j]); } } return !!this.vertexFeature_; @@ -656,6 +646,8 @@ ol.interaction.Modify.handleDragEvent_ = function(evt) { coordinates[depth[1]][depth[0]][segmentData.index + index] = vertex; segment[index] = vertex; break; + default: + // pass } this.setGeometryCoordinates_(geometry, coordinates); @@ -952,6 +944,8 @@ ol.interaction.Modify.prototype.removeVertex_ = function() { } } break; + default: + // pass } if (deleted) { @@ -986,8 +980,7 @@ ol.interaction.Modify.prototype.removeVertex_ = function() { * @param {Array} coordinates Coordinates. * @private */ -ol.interaction.Modify.prototype.setGeometryCoordinates_ = - function(geometry, coordinates) { +ol.interaction.Modify.prototype.setGeometryCoordinates_ = function(geometry, coordinates) { this.changingFeature_ = true; geometry.setCoordinates(coordinates); this.changingFeature_ = false; diff --git a/src/ol/interaction/mousewheelzoominteraction.js b/src/ol/interaction/mousewheelzoominteraction.js index b564551106..d6106b90e4 100644 --- a/src/ol/interaction/mousewheelzoominteraction.js +++ b/src/ol/interaction/mousewheelzoominteraction.js @@ -9,7 +9,6 @@ goog.require('ol.interaction.Interaction'); goog.require('ol.math'); - /** * @classdesc * Allows the user to zoom the map by scrolling the mouse wheel. diff --git a/src/ol/interaction/pinchrotateinteraction.js b/src/ol/interaction/pinchrotateinteraction.js index fbb986f0d0..7fb4daaa97 100644 --- a/src/ol/interaction/pinchrotateinteraction.js +++ b/src/ol/interaction/pinchrotateinteraction.js @@ -10,7 +10,6 @@ goog.require('ol.interaction.Interaction'); goog.require('ol.interaction.Pointer'); - /** * @classdesc * Allows the user to rotate the map by twisting with two fingers diff --git a/src/ol/interaction/pinchzoominteraction.js b/src/ol/interaction/pinchzoominteraction.js index 6a26116165..29d481816c 100644 --- a/src/ol/interaction/pinchzoominteraction.js +++ b/src/ol/interaction/pinchzoominteraction.js @@ -10,7 +10,6 @@ goog.require('ol.interaction.Interaction'); goog.require('ol.interaction.Pointer'); - /** * @classdesc * Allows the user to zoom the map by pinching with two fingers diff --git a/src/ol/interaction/pointerinteraction.js b/src/ol/interaction/pointerinteraction.js index f9af8002dc..ceeede2a59 100644 --- a/src/ol/interaction/pointerinteraction.js +++ b/src/ol/interaction/pointerinteraction.js @@ -9,7 +9,6 @@ goog.require('ol.Pixel'); goog.require('ol.interaction.Interaction'); - /** * @classdesc * Base class that calls user-defined functions on `down`, `move` and `up` @@ -87,7 +86,7 @@ goog.inherits(ol.interaction.Pointer, ol.interaction.Interaction); /** - * @param {Array.} pointerEvents + * @param {Array.} pointerEvents List of events. * @return {ol.Pixel} Centroid pixel. */ ol.interaction.Pointer.centroid = function(pointerEvents) { @@ -108,8 +107,7 @@ ol.interaction.Pointer.centroid = function(pointerEvents) { * or pointerup event. * @private */ -ol.interaction.Pointer.prototype.isPointerDraggingEvent_ = - function(mapBrowserEvent) { +ol.interaction.Pointer.prototype.isPointerDraggingEvent_ = function(mapBrowserEvent) { var type = mapBrowserEvent.type; return ( type === ol.MapBrowserEvent.EventType.POINTERDOWN || @@ -122,8 +120,7 @@ ol.interaction.Pointer.prototype.isPointerDraggingEvent_ = * @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event. * @private */ -ol.interaction.Pointer.prototype.updateTrackedPointers_ = - function(mapBrowserEvent) { +ol.interaction.Pointer.prototype.updateTrackedPointers_ = function(mapBrowserEvent) { if (this.isPointerDraggingEvent_(mapBrowserEvent)) { var event = mapBrowserEvent.pointerEvent; diff --git a/src/ol/interaction/selectinteraction.js b/src/ol/interaction/selectinteraction.js index 872dc7f23b..628a6c1c80 100644 --- a/src/ol/interaction/selectinteraction.js +++ b/src/ol/interaction/selectinteraction.js @@ -43,7 +43,6 @@ ol.interaction.SelectEventType = { ol.interaction.SelectFilterFunction; - /** * @classdesc * Events emitted by {@link ol.interaction.Select} instances are instances of @@ -58,8 +57,7 @@ ol.interaction.SelectFilterFunction; * @extends {goog.events.Event} * @constructor */ -ol.interaction.SelectEvent = - function(type, selected, deselected, mapBrowserEvent) { +ol.interaction.SelectEvent = function(type, selected, deselected, mapBrowserEvent) { goog.base(this, type); /** @@ -86,7 +84,6 @@ ol.interaction.SelectEvent = goog.inherits(ol.interaction.SelectEvent, goog.events.Event); - /** * @classdesc * Interaction for selecting vector features. By default, selected features are @@ -175,23 +172,21 @@ ol.interaction.Select = function(opt_options) { var layerFilter; if (options.layers) { if (goog.isFunction(options.layers)) { - layerFilter = - /** - * @param {ol.layer.Layer} layer Layer. - * @return {boolean} Include. - */ - function(layer) { + /** + * @param {ol.layer.Layer} layer Layer. + * @return {boolean} Include. + */ + layerFilter = function(layer) { goog.asserts.assertFunction(options.layers); return layer === featureOverlay || options.layers(layer); }; } else { var layers = options.layers; - layerFilter = - /** - * @param {ol.layer.Layer} layer Layer. - * @return {boolean} Include. - */ - function(layer) { + /** + * @param {ol.layer.Layer} layer Layer. + * @return {boolean} Include. + */ + layerFilter = function(layer) { return layer === featureOverlay || ol.array.includes(layers, layer); }; } @@ -228,8 +223,7 @@ goog.inherits(ol.interaction.Select, ol.interaction.Interaction); * @param {ol.layer.Layer} layer Layer. * @private */ -ol.interaction.Select.prototype.addFeatureLayerAssociation_ = - function(feature, layer) { +ol.interaction.Select.prototype.addFeatureLayerAssociation_ = function(feature, layer) { var key = goog.getUid(feature); this.featureLayerAssociation_[key] = layer; }; @@ -433,8 +427,7 @@ ol.interaction.Select.prototype.removeFeature_ = function(evt) { * @param {ol.Feature|ol.render.Feature} feature Feature. * @private */ -ol.interaction.Select.prototype.removeFeatureLayerAssociation_ = - function(feature) { +ol.interaction.Select.prototype.removeFeatureLayerAssociation_ = function(feature) { var key = goog.getUid(feature); delete this.featureLayerAssociation_[key]; }; diff --git a/src/ol/interaction/snapinteraction.js b/src/ol/interaction/snapinteraction.js index 670315f2c4..f2d7d9af33 100644 --- a/src/ol/interaction/snapinteraction.js +++ b/src/ol/interaction/snapinteraction.js @@ -23,7 +23,6 @@ goog.require('ol.source.VectorEventType'); goog.require('ol.structs.RBush'); - /** * @classdesc * Handles snapping of vector features while modifying or drawing them. The @@ -200,7 +199,7 @@ ol.interaction.Snap.prototype.forEachFeatureRemove_ = function(feature) { /** - * @return {ol.Collection.|Array.} + * @return {ol.Collection.|Array.} Features. * @private */ ol.interaction.Snap.prototype.getFeatures_ = function() { @@ -416,8 +415,7 @@ ol.interaction.Snap.prototype.updateFeature_ = function(feature) { * @param {ol.geom.GeometryCollection} geometry Geometry. * @private */ -ol.interaction.Snap.prototype.writeGeometryCollectionGeometry_ = - function(feature, geometry) { +ol.interaction.Snap.prototype.writeGeometryCollectionGeometry_ = function(feature, geometry) { var i, geometries = geometry.getGeometriesArray(); for (i = 0; i < geometries.length; ++i) { this.SEGMENT_WRITERS_[geometries[i].getType()].call( @@ -431,8 +429,7 @@ ol.interaction.Snap.prototype.writeGeometryCollectionGeometry_ = * @param {ol.geom.LineString} geometry Geometry. * @private */ -ol.interaction.Snap.prototype.writeLineStringGeometry_ = - function(feature, geometry) { +ol.interaction.Snap.prototype.writeLineStringGeometry_ = function(feature, geometry) { var coordinates = geometry.getCoordinates(); var i, ii, segment, segmentData; for (i = 0, ii = coordinates.length - 1; i < ii; ++i) { @@ -451,8 +448,7 @@ ol.interaction.Snap.prototype.writeLineStringGeometry_ = * @param {ol.geom.MultiLineString} geometry Geometry. * @private */ -ol.interaction.Snap.prototype.writeMultiLineStringGeometry_ = - function(feature, geometry) { +ol.interaction.Snap.prototype.writeMultiLineStringGeometry_ = function(feature, geometry) { var lines = geometry.getCoordinates(); var coordinates, i, ii, j, jj, segment, segmentData; for (j = 0, jj = lines.length; j < jj; ++j) { @@ -474,8 +470,7 @@ ol.interaction.Snap.prototype.writeMultiLineStringGeometry_ = * @param {ol.geom.MultiPoint} geometry Geometry. * @private */ -ol.interaction.Snap.prototype.writeMultiPointGeometry_ = - function(feature, geometry) { +ol.interaction.Snap.prototype.writeMultiPointGeometry_ = function(feature, geometry) { var points = geometry.getCoordinates(); var coordinates, i, ii, segmentData; for (i = 0, ii = points.length; i < ii; ++i) { @@ -494,8 +489,7 @@ ol.interaction.Snap.prototype.writeMultiPointGeometry_ = * @param {ol.geom.MultiPolygon} geometry Geometry. * @private */ -ol.interaction.Snap.prototype.writeMultiPolygonGeometry_ = - function(feature, geometry) { +ol.interaction.Snap.prototype.writeMultiPolygonGeometry_ = function(feature, geometry) { var polygons = geometry.getCoordinates(); var coordinates, i, ii, j, jj, k, kk, rings, segment, segmentData; for (k = 0, kk = polygons.length; k < kk; ++k) { @@ -520,8 +514,7 @@ ol.interaction.Snap.prototype.writeMultiPolygonGeometry_ = * @param {ol.geom.Point} geometry Geometry. * @private */ -ol.interaction.Snap.prototype.writePointGeometry_ = - function(feature, geometry) { +ol.interaction.Snap.prototype.writePointGeometry_ = function(feature, geometry) { var coordinates = geometry.getCoordinates(); var segmentData = /** @type {ol.interaction.Snap.SegmentDataType} */ ({ feature: feature, @@ -536,8 +529,7 @@ ol.interaction.Snap.prototype.writePointGeometry_ = * @param {ol.geom.Polygon} geometry Geometry. * @private */ -ol.interaction.Snap.prototype.writePolygonGeometry_ = - function(feature, geometry) { +ol.interaction.Snap.prototype.writePolygonGeometry_ = function(feature, geometry) { var rings = geometry.getCoordinates(); var coordinates, i, ii, j, jj, segment, segmentData; for (j = 0, jj = rings.length; j < jj; ++j) { @@ -608,9 +600,9 @@ ol.interaction.Snap.handleUpEvent_ = function(evt) { /** * Sort segments by distance, helper function - * @param {ol.interaction.Snap.SegmentDataType} a - * @param {ol.interaction.Snap.SegmentDataType} b - * @return {number} + * @param {ol.interaction.Snap.SegmentDataType} a The first segment data. + * @param {ol.interaction.Snap.SegmentDataType} b The second segment data. + * @return {number} The difference in distance. * @this {ol.interaction.Snap} */ ol.interaction.Snap.sortByDistance = function(a, b) { diff --git a/src/ol/interaction/translateinteraction.js b/src/ol/interaction/translateinteraction.js index 3e9a38f0dd..9c7a0843b4 100644 --- a/src/ol/interaction/translateinteraction.js +++ b/src/ol/interaction/translateinteraction.js @@ -32,7 +32,6 @@ ol.interaction.TranslateEventType = { }; - /** * @classdesc * Events emitted by {@link ol.interaction.Translate} instances are instances of @@ -67,7 +66,6 @@ ol.interaction.TranslateEvent = function(type, features, coordinate) { goog.inherits(ol.interaction.TranslateEvent, goog.events.Event); - /** * @classdesc * Interaction for translating (moving) features. @@ -195,8 +193,7 @@ ol.interaction.Translate.handleDragEvent_ = function(event) { * @this {ol.interaction.Translate} * @private */ -ol.interaction.Translate.handleMoveEvent_ = function(event) - { +ol.interaction.Translate.handleMoveEvent_ = function(event) { var elem = event.map.getTargetElement(); var intersectingFeature = event.map.forEachFeatureAtPixel(event.pixel, function(feature) { diff --git a/src/ol/kinetic.js b/src/ol/kinetic.js index 492f1df049..27ed53bfc1 100644 --- a/src/ol/kinetic.js +++ b/src/ol/kinetic.js @@ -5,7 +5,6 @@ goog.require('ol.PreRenderFunction'); goog.require('ol.animation'); - /** * @classdesc * Implementation of inertial deceleration for map movement. diff --git a/src/ol/layer/heatmaplayer.js b/src/ol/layer/heatmaplayer.js index 5c9bfeb428..35875a1898 100644 --- a/src/ol/layer/heatmaplayer.js +++ b/src/ol/layer/heatmaplayer.js @@ -23,7 +23,6 @@ ol.layer.HeatmapLayerProperty = { }; - /** * @classdesc * Layer for rendering vector data as a heatmap. @@ -145,8 +144,8 @@ ol.layer.Heatmap.DEFAULT_GRADIENT = ['#00f', '#0ff', '#0f0', '#ff0', '#f00']; /** - * @param {Array.} colors - * @return {Uint8ClampedArray} + * @param {Array.} colors A list of colored. + * @return {Uint8ClampedArray} An array. * @private */ ol.layer.Heatmap.createGradient_ = function(colors) { @@ -168,7 +167,7 @@ ol.layer.Heatmap.createGradient_ = function(colors) { /** - * @return {string} + * @return {string} Data URL for a circle. * @private */ ol.layer.Heatmap.prototype.createCircle_ = function() { diff --git a/src/ol/layer/imagelayer.js b/src/ol/layer/imagelayer.js index 6e41c8b733..f0523c76fa 100644 --- a/src/ol/layer/imagelayer.js +++ b/src/ol/layer/imagelayer.js @@ -3,7 +3,6 @@ goog.provide('ol.layer.Image'); goog.require('ol.layer.Layer'); - /** * @classdesc * Server-rendered images that are available for arbitrary extents and diff --git a/src/ol/layer/layer.js b/src/ol/layer/layer.js index 5e12ceb4d0..2d5c2c256c 100644 --- a/src/ol/layer/layer.js +++ b/src/ol/layer/layer.js @@ -11,7 +11,6 @@ goog.require('ol.render.EventType'); goog.require('ol.source.State'); - /** * @classdesc * Abstract base class; normally only used for creating subclasses and not diff --git a/src/ol/layer/layerbase.js b/src/ol/layer/layerbase.js index 610111f2d8..6d4dfef89b 100644 --- a/src/ol/layer/layerbase.js +++ b/src/ol/layer/layerbase.js @@ -37,7 +37,6 @@ ol.layer.LayerProperty = { ol.layer.LayerState; - /** * @classdesc * Abstract base class; normally only used for creating subclasses and not diff --git a/src/ol/layer/layergroup.js b/src/ol/layer/layergroup.js index acc254c24e..e942e6d34f 100644 --- a/src/ol/layer/layergroup.js +++ b/src/ol/layer/layergroup.js @@ -22,7 +22,6 @@ ol.layer.GroupProperty = { }; - /** * @classdesc * A {@link ol.Collection} of layers that are handled together. diff --git a/src/ol/layer/tilelayer.js b/src/ol/layer/tilelayer.js index e1e0894423..0430749ffb 100644 --- a/src/ol/layer/tilelayer.js +++ b/src/ol/layer/tilelayer.js @@ -14,7 +14,6 @@ ol.layer.TileProperty = { }; - /** * @classdesc * For layer sources that provide pre-rendered, tiled images in grids that are @@ -94,8 +93,7 @@ ol.layer.Tile.prototype.getUseInterimTilesOnError = function() { * @observable * @api */ -ol.layer.Tile.prototype.setUseInterimTilesOnError = - function(useInterimTilesOnError) { +ol.layer.Tile.prototype.setUseInterimTilesOnError = function(useInterimTilesOnError) { this.set( ol.layer.TileProperty.USE_INTERIM_TILES_ON_ERROR, useInterimTilesOnError); }; diff --git a/src/ol/layer/vectorlayer.js b/src/ol/layer/vectorlayer.js index 10f2a1e3b3..f2f30d7ab5 100644 --- a/src/ol/layer/vectorlayer.js +++ b/src/ol/layer/vectorlayer.js @@ -15,7 +15,6 @@ ol.layer.VectorProperty = { }; - /** * @classdesc * Vector data that is rendered client-side. diff --git a/src/ol/layer/vectortilelayer.js b/src/ol/layer/vectortilelayer.js index fb158e6133..b6dfe9b5a9 100644 --- a/src/ol/layer/vectortilelayer.js +++ b/src/ol/layer/vectortilelayer.js @@ -13,7 +13,6 @@ ol.layer.VectorTileProperty = { }; - /** * @classdesc * Layer for vector tile data that is rendered client-side. @@ -92,8 +91,7 @@ ol.layer.VectorTile.prototype.setPreload = function(preload) { * @observable * @api */ -ol.layer.VectorTile.prototype.setUseInterimTilesOnError = - function(useInterimTilesOnError) { +ol.layer.VectorTile.prototype.setUseInterimTilesOnError = function(useInterimTilesOnError) { this.set( ol.layer.TileProperty.USE_INTERIM_TILES_ON_ERROR, useInterimTilesOnError); }; diff --git a/src/ol/map.js b/src/ol/map.js index 5b5047c45d..6ee7cc9583 100644 --- a/src/ol/map.js +++ b/src/ol/map.js @@ -119,7 +119,6 @@ ol.MapProperty = { }; - /** * @classdesc * The map is the core component of OpenLayers. For a map to render, a view, @@ -615,8 +614,7 @@ ol.Map.prototype.disposeInternal = function() { * @template S,T,U * @api stable */ -ol.Map.prototype.forEachFeatureAtPixel = - function(pixel, callback, opt_this, opt_layerFilter, opt_this2) { +ol.Map.prototype.forEachFeatureAtPixel = function(pixel, callback, opt_this, opt_layerFilter, opt_this2) { if (!this.frameState_) { return; } @@ -653,8 +651,7 @@ ol.Map.prototype.forEachFeatureAtPixel = * @template S,T,U * @api stable */ -ol.Map.prototype.forEachLayerAtPixel = - function(pixel, callback, opt_this, opt_layerFilter, opt_this2) { +ol.Map.prototype.forEachLayerAtPixel = function(pixel, callback, opt_this, opt_layerFilter, opt_this2) { if (!this.frameState_) { return; } @@ -683,8 +680,7 @@ ol.Map.prototype.forEachLayerAtPixel = * @template U * @api */ -ol.Map.prototype.hasFeatureAtPixel = - function(pixel, opt_layerFilter, opt_this) { +ol.Map.prototype.hasFeatureAtPixel = function(pixel, opt_layerFilter, opt_this) { if (!this.frameState_) { return false; } @@ -928,8 +924,7 @@ ol.Map.prototype.getOverlayContainerStopEvent = function() { * @param {number} tileResolution Tile resolution. * @return {number} Tile priority. */ -ol.Map.prototype.getTilePriority = - function(tile, tileSourceKey, tileCenter, tileResolution) { +ol.Map.prototype.getTilePriority = function(tile, tileSourceKey, tileCenter, tileResolution) { // Filter out tiles at higher zoom levels than the current zoom level, or that // are outside the visible extent. var frameState = this.frameState_; diff --git a/src/ol/mapbrowserevent.js b/src/ol/mapbrowserevent.js index bc1ff6594f..73432c38d8 100644 --- a/src/ol/mapbrowserevent.js +++ b/src/ol/mapbrowserevent.js @@ -17,7 +17,6 @@ goog.require('ol.pointer.PointerEvent'); goog.require('ol.pointer.PointerEventHandler'); - /** * @classdesc * Events emitted as map browser events are instances of this type. @@ -102,7 +101,6 @@ ol.MapBrowserEvent.prototype.stopPropagation = function() { }; - /** * @constructor * @extends {ol.MapBrowserEvent} @@ -128,7 +126,6 @@ ol.MapBrowserPointerEvent = function(type, map, pointerEvent, opt_dragging, goog.inherits(ol.MapBrowserPointerEvent, ol.MapBrowserEvent); - /** * @param {ol.Map} map The map with the viewport to listen to events on. * @constructor @@ -255,8 +252,7 @@ ol.MapBrowserEventHandler.prototype.emulateClick_ = function(pointerEvent) { * @param {ol.pointer.PointerEvent} pointerEvent Pointer event. * @private */ -ol.MapBrowserEventHandler.prototype.updateActivePointers_ = - function(pointerEvent) { +ol.MapBrowserEventHandler.prototype.updateActivePointers_ = function(pointerEvent) { var event = pointerEvent; if (event.type == ol.MapBrowserEvent.EventType.POINTERUP || @@ -306,8 +302,7 @@ ol.MapBrowserEventHandler.prototype.handlePointerUp_ = function(pointerEvent) { * @return {boolean} If the left mouse button was pressed. * @private */ -ol.MapBrowserEventHandler.prototype.isMouseActionButton_ = - function(pointerEvent) { +ol.MapBrowserEventHandler.prototype.isMouseActionButton_ = function(pointerEvent) { return pointerEvent.button === 0; }; @@ -316,8 +311,7 @@ ol.MapBrowserEventHandler.prototype.isMouseActionButton_ = * @param {ol.pointer.PointerEvent} pointerEvent Pointer event. * @private */ -ol.MapBrowserEventHandler.prototype.handlePointerDown_ = - function(pointerEvent) { +ol.MapBrowserEventHandler.prototype.handlePointerDown_ = function(pointerEvent) { this.updateActivePointers_(pointerEvent); var newEvent = new ol.MapBrowserPointerEvent( ol.MapBrowserEvent.EventType.POINTERDOWN, this.map_, pointerEvent); @@ -365,8 +359,7 @@ ol.MapBrowserEventHandler.prototype.handlePointerDown_ = * @param {ol.pointer.PointerEvent} pointerEvent Pointer event. * @private */ -ol.MapBrowserEventHandler.prototype.handlePointerMove_ = - function(pointerEvent) { +ol.MapBrowserEventHandler.prototype.handlePointerMove_ = function(pointerEvent) { // Fix IE10 on windows Surface : When you tap the tablet, it triggers // multiple pointermove events between pointerdown and pointerup with // the exact same coordinates of the pointerdown event. To avoid a @@ -403,7 +396,7 @@ ol.MapBrowserEventHandler.prototype.relayEvent_ = function(pointerEvent) { /** * @param {ol.pointer.PointerEvent} pointerEvent Pointer event. - * @return {boolean} + * @return {boolean} Is moving. * @private */ ol.MapBrowserEventHandler.prototype.isMoving_ = function(pointerEvent) { diff --git a/src/ol/mapevent.js b/src/ol/mapevent.js index dd37dc2505..5e7931acae 100644 --- a/src/ol/mapevent.js +++ b/src/ol/mapevent.js @@ -26,7 +26,6 @@ ol.MapEventType = { }; - /** * @classdesc * Events emitted as map events are instances of this type. diff --git a/src/ol/object.js b/src/ol/object.js index 1687d19ba5..ae5b7ca72f 100644 --- a/src/ol/object.js +++ b/src/ol/object.js @@ -20,7 +20,6 @@ ol.ObjectEventType = { }; - /** * @classdesc * Events emitted by {@link ol.Object} instances are instances of this type. @@ -54,7 +53,6 @@ ol.ObjectEvent = function(type, key, oldValue) { goog.inherits(ol.ObjectEvent, goog.events.Event); - /** * @classdesc * Abstract base class; normally only used for creating subclasses and not diff --git a/src/ol/observable.js b/src/ol/observable.js index f27b917006..fec983f2d6 100644 --- a/src/ol/observable.js +++ b/src/ol/observable.js @@ -5,7 +5,6 @@ goog.require('goog.events.EventTarget'); goog.require('goog.events.EventType'); - /** * @classdesc * Abstract base class; normally only used for creating subclasses and not diff --git a/src/ol/overlay.js b/src/ol/overlay.js index 9c0ad495c0..c0e0f8c9d0 100644 --- a/src/ol/overlay.js +++ b/src/ol/overlay.js @@ -47,7 +47,6 @@ ol.OverlayPositioning = { }; - /** * @classdesc * An element to be displayed over the map and attached to a single map @@ -437,7 +436,7 @@ ol.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} + * @return {ol.Extent} The extent. * @private */ ol.Overlay.prototype.getRect_ = function(element, size) { @@ -468,7 +467,7 @@ ol.Overlay.prototype.setPositioning = function(positioning) { /** * Modify the visibility of the element. - * @param {boolean} visible + * @param {boolean} visible Element visibility. * @protected */ ol.Overlay.prototype.setVisible = function(visible) { @@ -498,8 +497,8 @@ ol.Overlay.prototype.updatePixelPosition = function() { /** - * @param {ol.Pixel} pixel - * @param {ol.Size|undefined} mapSize + * @param {ol.Pixel} pixel The pixel location. + * @param {ol.Size|undefined} mapSize The map size. * @protected */ ol.Overlay.prototype.updateRenderedPosition = function(pixel, mapSize) { diff --git a/src/ol/pointer/eventsource.js b/src/ol/pointer/eventsource.js index 4afe449c51..96282b7712 100644 --- a/src/ol/pointer/eventsource.js +++ b/src/ol/pointer/eventsource.js @@ -3,10 +3,10 @@ goog.provide('ol.pointer.EventSource'); goog.require('goog.events.BrowserEvent'); - /** - * @param {ol.pointer.PointerEventHandler} dispatcher - * @param {!Object.} mapping + * @param {ol.pointer.PointerEventHandler} dispatcher Event handler. + * @param {!Object.} mapping Event + * mapping. * @constructor */ ol.pointer.EventSource = function(dispatcher, mapping) { @@ -46,7 +46,7 @@ ol.pointer.EventSource.prototype.getMapping = function() { /** * Returns the handler that should handle a given event type. - * @param {string} eventType + * @param {string} eventType The event type. * @return {function(goog.events.BrowserEvent)} Handler */ ol.pointer.EventSource.prototype.getHandlerForEvent = function(eventType) { diff --git a/src/ol/pointer/mousesource.js b/src/ol/pointer/mousesource.js index 618541604e..6bfa58e834 100644 --- a/src/ol/pointer/mousesource.js +++ b/src/ol/pointer/mousesource.js @@ -33,9 +33,8 @@ goog.provide('ol.pointer.MouseSource'); goog.require('ol.pointer.EventSource'); - /** - * @param {ol.pointer.PointerEventHandler} dispatcher + * @param {ol.pointer.PointerEventHandler} dispatcher Event handler. * @constructor * @extends {ol.pointer.EventSource} */ @@ -108,11 +107,10 @@ ol.pointer.MouseSource.DEDUP_DIST = 25; * or detect that the positions are invalid. * * @private - * @param {goog.events.BrowserEvent} inEvent + * @param {goog.events.BrowserEvent} inEvent The in event. * @return {boolean} True, if the event was generated by a touch. */ -ol.pointer.MouseSource.prototype.isEventSimulatedFromTouch_ = - function(inEvent) { +ol.pointer.MouseSource.prototype.isEventSimulatedFromTouch_ = function(inEvent) { var lts = this.lastTouches; var x = inEvent.clientX, y = inEvent.clientY; for (var i = 0, l = lts.length, t; i < l && (t = lts[i]); i++) { @@ -131,9 +129,9 @@ ol.pointer.MouseSource.prototype.isEventSimulatedFromTouch_ = * Creates a copy of the original event that will be used * for the fake pointer event. * - * @param {goog.events.BrowserEvent} inEvent - * @param {ol.pointer.PointerEventHandler} dispatcher - * @return {Object} + * @param {goog.events.BrowserEvent} inEvent The in event. + * @param {ol.pointer.PointerEventHandler} dispatcher Event handler. + * @return {Object} The copied event. */ ol.pointer.MouseSource.prepareEvent = function(inEvent, dispatcher) { var e = dispatcher.cloneEvent(inEvent, inEvent.getBrowserEvent()); @@ -156,7 +154,7 @@ ol.pointer.MouseSource.prepareEvent = function(inEvent, dispatcher) { /** * Handler for `mousedown`. * - * @param {goog.events.BrowserEvent} inEvent + * @param {goog.events.BrowserEvent} inEvent The in event. */ ol.pointer.MouseSource.prototype.mousedown = function(inEvent) { if (!this.isEventSimulatedFromTouch_(inEvent)) { @@ -175,7 +173,7 @@ ol.pointer.MouseSource.prototype.mousedown = function(inEvent) { /** * Handler for `mousemove`. * - * @param {goog.events.BrowserEvent} inEvent + * @param {goog.events.BrowserEvent} inEvent The in event. */ ol.pointer.MouseSource.prototype.mousemove = function(inEvent) { if (!this.isEventSimulatedFromTouch_(inEvent)) { @@ -188,7 +186,7 @@ ol.pointer.MouseSource.prototype.mousemove = function(inEvent) { /** * Handler for `mouseup`. * - * @param {goog.events.BrowserEvent} inEvent + * @param {goog.events.BrowserEvent} inEvent The in event. */ ol.pointer.MouseSource.prototype.mouseup = function(inEvent) { if (!this.isEventSimulatedFromTouch_(inEvent)) { @@ -206,7 +204,7 @@ ol.pointer.MouseSource.prototype.mouseup = function(inEvent) { /** * Handler for `mouseover`. * - * @param {goog.events.BrowserEvent} inEvent + * @param {goog.events.BrowserEvent} inEvent The in event. */ ol.pointer.MouseSource.prototype.mouseover = function(inEvent) { if (!this.isEventSimulatedFromTouch_(inEvent)) { @@ -219,7 +217,7 @@ ol.pointer.MouseSource.prototype.mouseover = function(inEvent) { /** * Handler for `mouseout`. * - * @param {goog.events.BrowserEvent} inEvent + * @param {goog.events.BrowserEvent} inEvent The in event. */ ol.pointer.MouseSource.prototype.mouseout = function(inEvent) { if (!this.isEventSimulatedFromTouch_(inEvent)) { @@ -232,7 +230,7 @@ ol.pointer.MouseSource.prototype.mouseout = function(inEvent) { /** * Dispatches a `pointercancel` event. * - * @param {goog.events.BrowserEvent} inEvent + * @param {goog.events.BrowserEvent} inEvent The in event. */ ol.pointer.MouseSource.prototype.cancel = function(inEvent) { var e = ol.pointer.MouseSource.prepareEvent(inEvent, this.dispatcher); diff --git a/src/ol/pointer/mssource.js b/src/ol/pointer/mssource.js index 5855758f12..379af662e7 100644 --- a/src/ol/pointer/mssource.js +++ b/src/ol/pointer/mssource.js @@ -33,9 +33,8 @@ goog.provide('ol.pointer.MsSource'); goog.require('ol.pointer.EventSource'); - /** - * @param {ol.pointer.PointerEventHandler} dispatcher + * @param {ol.pointer.PointerEventHandler} dispatcher Event handler. * @constructor * @extends {ol.pointer.EventSource} */ @@ -78,8 +77,8 @@ goog.inherits(ol.pointer.MsSource, ol.pointer.EventSource); * for the fake pointer event. * * @private - * @param {goog.events.BrowserEvent} inEvent - * @return {Object} + * @param {goog.events.BrowserEvent} inEvent The in event. + * @return {Object} The copied event. */ ol.pointer.MsSource.prototype.prepareEvent_ = function(inEvent) { var e = inEvent; @@ -94,7 +93,7 @@ ol.pointer.MsSource.prototype.prepareEvent_ = function(inEvent) { /** * Remove this pointer from the list of active pointers. - * @param {number} pointerId + * @param {number} pointerId Pointer identifier. */ ol.pointer.MsSource.prototype.cleanup = function(pointerId) { delete this.pointerMap[pointerId.toString()]; @@ -104,7 +103,7 @@ ol.pointer.MsSource.prototype.cleanup = function(pointerId) { /** * Handler for `msPointerDown`. * - * @param {goog.events.BrowserEvent} inEvent + * @param {goog.events.BrowserEvent} inEvent The in event. */ ol.pointer.MsSource.prototype.msPointerDown = function(inEvent) { this.pointerMap[inEvent.getBrowserEvent().pointerId.toString()] = inEvent; @@ -116,7 +115,7 @@ ol.pointer.MsSource.prototype.msPointerDown = function(inEvent) { /** * Handler for `msPointerMove`. * - * @param {goog.events.BrowserEvent} inEvent + * @param {goog.events.BrowserEvent} inEvent The in event. */ ol.pointer.MsSource.prototype.msPointerMove = function(inEvent) { var e = this.prepareEvent_(inEvent); @@ -127,7 +126,7 @@ ol.pointer.MsSource.prototype.msPointerMove = function(inEvent) { /** * Handler for `msPointerUp`. * - * @param {goog.events.BrowserEvent} inEvent + * @param {goog.events.BrowserEvent} inEvent The in event. */ ol.pointer.MsSource.prototype.msPointerUp = function(inEvent) { var e = this.prepareEvent_(inEvent); @@ -139,7 +138,7 @@ ol.pointer.MsSource.prototype.msPointerUp = function(inEvent) { /** * Handler for `msPointerOut`. * - * @param {goog.events.BrowserEvent} inEvent + * @param {goog.events.BrowserEvent} inEvent The in event. */ ol.pointer.MsSource.prototype.msPointerOut = function(inEvent) { var e = this.prepareEvent_(inEvent); @@ -150,7 +149,7 @@ ol.pointer.MsSource.prototype.msPointerOut = function(inEvent) { /** * Handler for `msPointerOver`. * - * @param {goog.events.BrowserEvent} inEvent + * @param {goog.events.BrowserEvent} inEvent The in event. */ ol.pointer.MsSource.prototype.msPointerOver = function(inEvent) { var e = this.prepareEvent_(inEvent); @@ -161,7 +160,7 @@ ol.pointer.MsSource.prototype.msPointerOver = function(inEvent) { /** * Handler for `msPointerCancel`. * - * @param {goog.events.BrowserEvent} inEvent + * @param {goog.events.BrowserEvent} inEvent The in event. */ ol.pointer.MsSource.prototype.msPointerCancel = function(inEvent) { var e = this.prepareEvent_(inEvent); @@ -173,7 +172,7 @@ ol.pointer.MsSource.prototype.msPointerCancel = function(inEvent) { /** * Handler for `msLostPointerCapture`. * - * @param {goog.events.BrowserEvent} inEvent + * @param {goog.events.BrowserEvent} inEvent The in event. */ ol.pointer.MsSource.prototype.msLostPointerCapture = function(inEvent) { var e = this.dispatcher.makeEvent('lostpointercapture', @@ -185,7 +184,7 @@ ol.pointer.MsSource.prototype.msLostPointerCapture = function(inEvent) { /** * Handler for `msGotPointerCapture`. * - * @param {goog.events.BrowserEvent} inEvent + * @param {goog.events.BrowserEvent} inEvent The in event. */ ol.pointer.MsSource.prototype.msGotPointerCapture = function(inEvent) { var e = this.dispatcher.makeEvent('gotpointercapture', diff --git a/src/ol/pointer/nativesource.js b/src/ol/pointer/nativesource.js index 8fa61c118e..a453eb3840 100644 --- a/src/ol/pointer/nativesource.js +++ b/src/ol/pointer/nativesource.js @@ -33,9 +33,8 @@ goog.provide('ol.pointer.NativeSource'); goog.require('ol.pointer.EventSource'); - /** - * @param {ol.pointer.PointerEventHandler} dispatcher + * @param {ol.pointer.PointerEventHandler} dispatcher Event handler. * @constructor * @extends {ol.pointer.EventSource} */ @@ -58,7 +57,7 @@ goog.inherits(ol.pointer.NativeSource, ol.pointer.EventSource); /** * Handler for `pointerdown`. * - * @param {goog.events.BrowserEvent} inEvent + * @param {goog.events.BrowserEvent} inEvent The in event. */ ol.pointer.NativeSource.prototype.pointerDown = function(inEvent) { this.dispatcher.fireNativeEvent(inEvent); @@ -68,7 +67,7 @@ ol.pointer.NativeSource.prototype.pointerDown = function(inEvent) { /** * Handler for `pointermove`. * - * @param {goog.events.BrowserEvent} inEvent + * @param {goog.events.BrowserEvent} inEvent The in event. */ ol.pointer.NativeSource.prototype.pointerMove = function(inEvent) { this.dispatcher.fireNativeEvent(inEvent); @@ -78,7 +77,7 @@ ol.pointer.NativeSource.prototype.pointerMove = function(inEvent) { /** * Handler for `pointerup`. * - * @param {goog.events.BrowserEvent} inEvent + * @param {goog.events.BrowserEvent} inEvent The in event. */ ol.pointer.NativeSource.prototype.pointerUp = function(inEvent) { this.dispatcher.fireNativeEvent(inEvent); @@ -88,7 +87,7 @@ ol.pointer.NativeSource.prototype.pointerUp = function(inEvent) { /** * Handler for `pointerout`. * - * @param {goog.events.BrowserEvent} inEvent + * @param {goog.events.BrowserEvent} inEvent The in event. */ ol.pointer.NativeSource.prototype.pointerOut = function(inEvent) { this.dispatcher.fireNativeEvent(inEvent); @@ -98,7 +97,7 @@ ol.pointer.NativeSource.prototype.pointerOut = function(inEvent) { /** * Handler for `pointerover`. * - * @param {goog.events.BrowserEvent} inEvent + * @param {goog.events.BrowserEvent} inEvent The in event. */ ol.pointer.NativeSource.prototype.pointerOver = function(inEvent) { this.dispatcher.fireNativeEvent(inEvent); @@ -108,7 +107,7 @@ ol.pointer.NativeSource.prototype.pointerOver = function(inEvent) { /** * Handler for `pointercancel`. * - * @param {goog.events.BrowserEvent} inEvent + * @param {goog.events.BrowserEvent} inEvent The in event. */ ol.pointer.NativeSource.prototype.pointerCancel = function(inEvent) { this.dispatcher.fireNativeEvent(inEvent); @@ -118,7 +117,7 @@ ol.pointer.NativeSource.prototype.pointerCancel = function(inEvent) { /** * Handler for `lostpointercapture`. * - * @param {goog.events.BrowserEvent} inEvent + * @param {goog.events.BrowserEvent} inEvent The in event. */ ol.pointer.NativeSource.prototype.lostPointerCapture = function(inEvent) { this.dispatcher.fireNativeEvent(inEvent); @@ -128,7 +127,7 @@ ol.pointer.NativeSource.prototype.lostPointerCapture = function(inEvent) { /** * Handler for `gotpointercapture`. * - * @param {goog.events.BrowserEvent} inEvent + * @param {goog.events.BrowserEvent} inEvent The in event. */ ol.pointer.NativeSource.prototype.gotPointerCapture = function(inEvent) { this.dispatcher.fireNativeEvent(inEvent); diff --git a/src/ol/pointer/pointerevent.js b/src/ol/pointer/pointerevent.js index 1905250ea0..767e25af9c 100644 --- a/src/ol/pointer/pointerevent.js +++ b/src/ol/pointer/pointerevent.js @@ -35,7 +35,6 @@ goog.require('goog.events'); goog.require('goog.events.Event'); - /** * A class for pointer events. * @@ -45,7 +44,7 @@ goog.require('goog.events.Event'); * @constructor * @extends {goog.events.Event} * @param {string} type The type of the event to create. - * @param {goog.events.BrowserEvent} browserEvent + * @param {goog.events.BrowserEvent} browserEvent The event. * @param {Object.=} opt_eventDict An optional dictionary of * initial event properties. */ @@ -198,8 +197,8 @@ goog.inherits(ol.pointer.PointerEvent, goog.events.Event); /** * @private - * @param {Object.} eventDict - * @return {number} + * @param {Object.} eventDict The event dictionary. + * @return {number} Button indicator. */ ol.pointer.PointerEvent.prototype.getButtons_ = function(eventDict) { // According to the w3c spec, @@ -240,9 +239,9 @@ ol.pointer.PointerEvent.prototype.getButtons_ = function(eventDict) { /** * @private - * @param {Object.} eventDict - * @param {number} buttons - * @return {number} + * @param {Object.} eventDict The event dictionary. + * @param {number} buttons Button indicator. + * @return {number} The pressure. */ ol.pointer.PointerEvent.prototype.getPressure_ = function(eventDict, buttons) { // Spec requires that pointers without pressure specified use 0.5 for down @@ -272,5 +271,6 @@ ol.pointer.PointerEvent.HAS_BUTTONS = false; var ev = new MouseEvent('click', {buttons: 1}); ol.pointer.PointerEvent.HAS_BUTTONS = ev.buttons === 1; } catch (e) { + // pass } })(); diff --git a/src/ol/pointer/pointereventhandler.js b/src/ol/pointer/pointereventhandler.js index 2b4d299138..b86c27a180 100644 --- a/src/ol/pointer/pointereventhandler.js +++ b/src/ol/pointer/pointereventhandler.js @@ -43,7 +43,6 @@ goog.require('ol.pointer.PointerEvent'); goog.require('ol.pointer.TouchSource'); - /** * @constructor * @extends {goog.events.EventTarget} @@ -110,10 +109,9 @@ ol.pointer.PointerEventHandler.prototype.registerSources = function() { * Add a new event source that will generate pointer events. * * @param {string} name A name for the event source - * @param {ol.pointer.EventSource} source + * @param {ol.pointer.EventSource} source The source event. */ -ol.pointer.PointerEventHandler.prototype.registerSource = - function(name, source) { +ol.pointer.PointerEventHandler.prototype.registerSource = function(name, source) { var s = source; var newEvents = s.getEvents(); @@ -207,8 +205,7 @@ ol.pointer.PointerEventHandler.prototype.removeEvents_ = function(events) { * @return {Object} An object containing shallow copies of * `inEvent`'s properties. */ -ol.pointer.PointerEventHandler.prototype.cloneEvent = - function(browserEvent, inEvent) { +ol.pointer.PointerEventHandler.prototype.cloneEvent = function(browserEvent, inEvent) { var eventCopy = {}, p; for (var i = 0, ii = ol.pointer.CLONE_PROPS.length; i < ii; i++) { p = ol.pointer.CLONE_PROPS[i][0]; @@ -227,11 +224,10 @@ ol.pointer.PointerEventHandler.prototype.cloneEvent = /** * Triggers a 'pointerdown' event. - * @param {Object} pointerEventData - * @param {goog.events.BrowserEvent} browserEvent + * @param {Object} pointerEventData Pointer event data. + * @param {goog.events.BrowserEvent} browserEvent The event. */ -ol.pointer.PointerEventHandler.prototype.down = - function(pointerEventData, browserEvent) { +ol.pointer.PointerEventHandler.prototype.down = function(pointerEventData, browserEvent) { this.fireEvent(ol.pointer.EventType.POINTERDOWN, pointerEventData, browserEvent); }; @@ -239,11 +235,10 @@ ol.pointer.PointerEventHandler.prototype.down = /** * Triggers a 'pointermove' event. - * @param {Object} pointerEventData - * @param {goog.events.BrowserEvent} browserEvent + * @param {Object} pointerEventData Pointer event data. + * @param {goog.events.BrowserEvent} browserEvent The event. */ -ol.pointer.PointerEventHandler.prototype.move = - function(pointerEventData, browserEvent) { +ol.pointer.PointerEventHandler.prototype.move = function(pointerEventData, browserEvent) { this.fireEvent(ol.pointer.EventType.POINTERMOVE, pointerEventData, browserEvent); }; @@ -251,11 +246,10 @@ ol.pointer.PointerEventHandler.prototype.move = /** * Triggers a 'pointerup' event. - * @param {Object} pointerEventData - * @param {goog.events.BrowserEvent} browserEvent + * @param {Object} pointerEventData Pointer event data. + * @param {goog.events.BrowserEvent} browserEvent The event. */ -ol.pointer.PointerEventHandler.prototype.up = - function(pointerEventData, browserEvent) { +ol.pointer.PointerEventHandler.prototype.up = function(pointerEventData, browserEvent) { this.fireEvent(ol.pointer.EventType.POINTERUP, pointerEventData, browserEvent); }; @@ -263,11 +257,10 @@ ol.pointer.PointerEventHandler.prototype.up = /** * Triggers a 'pointerenter' event. - * @param {Object} pointerEventData - * @param {goog.events.BrowserEvent} browserEvent + * @param {Object} pointerEventData Pointer event data. + * @param {goog.events.BrowserEvent} browserEvent The event. */ -ol.pointer.PointerEventHandler.prototype.enter = - function(pointerEventData, browserEvent) { +ol.pointer.PointerEventHandler.prototype.enter = function(pointerEventData, browserEvent) { pointerEventData.bubbles = false; this.fireEvent(ol.pointer.EventType.POINTERENTER, pointerEventData, browserEvent); @@ -276,11 +269,10 @@ ol.pointer.PointerEventHandler.prototype.enter = /** * Triggers a 'pointerleave' event. - * @param {Object} pointerEventData - * @param {goog.events.BrowserEvent} browserEvent + * @param {Object} pointerEventData Pointer event data. + * @param {goog.events.BrowserEvent} browserEvent The event. */ -ol.pointer.PointerEventHandler.prototype.leave = - function(pointerEventData, browserEvent) { +ol.pointer.PointerEventHandler.prototype.leave = function(pointerEventData, browserEvent) { pointerEventData.bubbles = false; this.fireEvent(ol.pointer.EventType.POINTERLEAVE, pointerEventData, browserEvent); @@ -289,11 +281,10 @@ ol.pointer.PointerEventHandler.prototype.leave = /** * Triggers a 'pointerover' event. - * @param {Object} pointerEventData - * @param {goog.events.BrowserEvent} browserEvent + * @param {Object} pointerEventData Pointer event data. + * @param {goog.events.BrowserEvent} browserEvent The event. */ -ol.pointer.PointerEventHandler.prototype.over = - function(pointerEventData, browserEvent) { +ol.pointer.PointerEventHandler.prototype.over = function(pointerEventData, browserEvent) { pointerEventData.bubbles = true; this.fireEvent(ol.pointer.EventType.POINTEROVER, pointerEventData, browserEvent); @@ -302,11 +293,10 @@ ol.pointer.PointerEventHandler.prototype.over = /** * Triggers a 'pointerout' event. - * @param {Object} pointerEventData - * @param {goog.events.BrowserEvent} browserEvent + * @param {Object} pointerEventData Pointer event data. + * @param {goog.events.BrowserEvent} browserEvent The event. */ -ol.pointer.PointerEventHandler.prototype.out = - function(pointerEventData, browserEvent) { +ol.pointer.PointerEventHandler.prototype.out = function(pointerEventData, browserEvent) { pointerEventData.bubbles = true; this.fireEvent(ol.pointer.EventType.POINTEROUT, pointerEventData, browserEvent); @@ -315,11 +305,10 @@ ol.pointer.PointerEventHandler.prototype.out = /** * Triggers a 'pointercancel' event. - * @param {Object} pointerEventData - * @param {goog.events.BrowserEvent} browserEvent + * @param {Object} pointerEventData Pointer event data. + * @param {goog.events.BrowserEvent} browserEvent The event. */ -ol.pointer.PointerEventHandler.prototype.cancel = - function(pointerEventData, browserEvent) { +ol.pointer.PointerEventHandler.prototype.cancel = function(pointerEventData, browserEvent) { this.fireEvent(ol.pointer.EventType.POINTERCANCEL, pointerEventData, browserEvent); }; @@ -327,11 +316,10 @@ ol.pointer.PointerEventHandler.prototype.cancel = /** * Triggers a combination of 'pointerout' and 'pointerleave' events. - * @param {Object} pointerEventData - * @param {goog.events.BrowserEvent} browserEvent + * @param {Object} pointerEventData Pointer event data. + * @param {goog.events.BrowserEvent} browserEvent The event. */ -ol.pointer.PointerEventHandler.prototype.leaveOut = - function(pointerEventData, browserEvent) { +ol.pointer.PointerEventHandler.prototype.leaveOut = function(pointerEventData, browserEvent) { this.out(pointerEventData, browserEvent); if (!this.contains_( pointerEventData.target, @@ -343,11 +331,10 @@ ol.pointer.PointerEventHandler.prototype.leaveOut = /** * Triggers a combination of 'pointerover' and 'pointerevents' events. - * @param {Object} pointerEventData - * @param {goog.events.BrowserEvent} browserEvent + * @param {Object} pointerEventData Pointer event data. + * @param {goog.events.BrowserEvent} browserEvent The event. */ -ol.pointer.PointerEventHandler.prototype.enterOver = - function(pointerEventData, browserEvent) { +ol.pointer.PointerEventHandler.prototype.enterOver = function(pointerEventData, browserEvent) { this.over(pointerEventData, browserEvent); if (!this.contains_( pointerEventData.target, @@ -359,13 +346,12 @@ ol.pointer.PointerEventHandler.prototype.enterOver = /** * @private - * @param {Element} container - * @param {Element} contained + * @param {Element} container The container element. + * @param {Element} contained The contained element. * @return {boolean} Returns true if the container element * contains the other element. */ -ol.pointer.PointerEventHandler.prototype.contains_ = - function(container, contained) { +ol.pointer.PointerEventHandler.prototype.contains_ = function(container, contained) { if (!contained) { return false; } @@ -379,12 +365,11 @@ ol.pointer.PointerEventHandler.prototype.contains_ = * `pointerEventData`. * * @param {string} inType A string representing the type of event to create. - * @param {Object} pointerEventData - * @param {goog.events.BrowserEvent} browserEvent + * @param {Object} pointerEventData Pointer event data. + * @param {goog.events.BrowserEvent} browserEvent The event. * @return {ol.pointer.PointerEvent} A PointerEvent of type `inType`. */ -ol.pointer.PointerEventHandler.prototype.makeEvent = - function(inType, pointerEventData, browserEvent) { +ol.pointer.PointerEventHandler.prototype.makeEvent = function(inType, pointerEventData, browserEvent) { return new ol.pointer.PointerEvent(inType, browserEvent, pointerEventData); }; @@ -392,11 +377,10 @@ ol.pointer.PointerEventHandler.prototype.makeEvent = /** * Make and dispatch an event in one call. * @param {string} inType A string representing the type of event. - * @param {Object} pointerEventData - * @param {goog.events.BrowserEvent} browserEvent + * @param {Object} pointerEventData Pointer event data. + * @param {goog.events.BrowserEvent} browserEvent The event. */ -ol.pointer.PointerEventHandler.prototype.fireEvent = - function(inType, pointerEventData, browserEvent) { +ol.pointer.PointerEventHandler.prototype.fireEvent = function(inType, pointerEventData, browserEvent) { var e = this.makeEvent(inType, pointerEventData, browserEvent); this.dispatchEvent(e); }; @@ -407,8 +391,7 @@ ol.pointer.PointerEventHandler.prototype.fireEvent = * and dispatches this event. * @param {goog.events.BrowserEvent} nativeEvent A platform event with a target. */ -ol.pointer.PointerEventHandler.prototype.fireNativeEvent = - function(nativeEvent) { +ol.pointer.PointerEventHandler.prototype.fireNativeEvent = function(nativeEvent) { var e = this.makeEvent(nativeEvent.type, nativeEvent.getBrowserEvent(), nativeEvent); this.dispatchEvent(e); @@ -419,11 +402,10 @@ ol.pointer.PointerEventHandler.prototype.fireNativeEvent = * Wrap a native mouse event into a pointer event. * This proxy method is required for the legacy IE support. * @param {string} eventType The pointer event type. - * @param {goog.events.BrowserEvent} browserEvent - * @return {ol.pointer.PointerEvent} + * @param {goog.events.BrowserEvent} browserEvent The event. + * @return {ol.pointer.PointerEvent} The wrapped event. */ -ol.pointer.PointerEventHandler.prototype.wrapMouseEvent = - function(eventType, browserEvent) { +ol.pointer.PointerEventHandler.prototype.wrapMouseEvent = function(eventType, browserEvent) { var pointerEvent = this.makeEvent( eventType, ol.pointer.MouseSource.prepareEvent(browserEvent, this), diff --git a/src/ol/pointer/touchsource.js b/src/ol/pointer/touchsource.js index 33a62bca4f..5eb165dac9 100644 --- a/src/ol/pointer/touchsource.js +++ b/src/ol/pointer/touchsource.js @@ -37,11 +37,10 @@ goog.require('ol.pointer.EventSource'); goog.require('ol.pointer.MouseSource'); - /** * @constructor - * @param {ol.pointer.PointerEventHandler} dispatcher - * @param {ol.pointer.MouseSource} mouseSource + * @param {ol.pointer.PointerEventHandler} dispatcher The event handler. + * @param {ol.pointer.MouseSource} mouseSource Mouse source. * @extends {ol.pointer.EventSource} */ ol.pointer.TouchSource = function(dispatcher, mouseSource) { @@ -111,7 +110,7 @@ ol.pointer.TouchSource.POINTER_TYPE = 'touch'; /** * @private - * @param {Touch} inTouch + * @param {Touch} inTouch The in touch. * @return {boolean} True, if this is the primary touch. */ ol.pointer.TouchSource.prototype.isPrimaryTouch_ = function(inTouch) { @@ -121,7 +120,7 @@ ol.pointer.TouchSource.prototype.isPrimaryTouch_ = function(inTouch) { /** * Set primary touch if there are no pointers, or the only pointer is the mouse. - * @param {Touch} inTouch + * @param {Touch} inTouch The in touch. * @private */ ol.pointer.TouchSource.prototype.setPrimaryTouch_ = function(inTouch) { @@ -136,7 +135,7 @@ ol.pointer.TouchSource.prototype.setPrimaryTouch_ = function(inTouch) { /** * @private - * @param {Object} inPointer + * @param {Object} inPointer The in pointer object. */ ol.pointer.TouchSource.prototype.removePrimaryPointer_ = function(inPointer) { if (inPointer.isPrimary) { @@ -179,10 +178,9 @@ ol.pointer.TouchSource.prototype.cancelResetClickCount_ = function() { * @private * @param {goog.events.BrowserEvent} browserEvent Browser event * @param {Touch} inTouch Touch event - * @return {Object} + * @return {Object} A pointer object. */ -ol.pointer.TouchSource.prototype.touchToPointer_ = - function(browserEvent, inTouch) { +ol.pointer.TouchSource.prototype.touchToPointer_ = function(browserEvent, inTouch) { var e = this.dispatcher.cloneEvent(browserEvent, inTouch); // Spec specifies that pointerId 1 is reserved for Mouse. // Touch identifiers can start at 0. @@ -215,10 +213,9 @@ ol.pointer.TouchSource.prototype.touchToPointer_ = /** * @private * @param {goog.events.BrowserEvent} inEvent Touch event - * @param {function(goog.events.BrowserEvent, Object)} inFunction + * @param {function(goog.events.BrowserEvent, Object)} inFunction In function. */ -ol.pointer.TouchSource.prototype.processTouches_ = - function(inEvent, inFunction) { +ol.pointer.TouchSource.prototype.processTouches_ = function(inEvent, inFunction) { var touches = Array.prototype.slice.call( inEvent.getBrowserEvent().changedTouches); var count = touches.length; @@ -237,8 +234,8 @@ ol.pointer.TouchSource.prototype.processTouches_ = /** * @private - * @param {TouchList} touchList - * @param {number} searchId + * @param {TouchList} touchList The touch list. + * @param {number} searchId Search identifier. * @return {boolean} True, if the `Touch` with the given id is in the list. */ ol.pointer.TouchSource.prototype.findTouch_ = function(touchList, searchId) { @@ -263,7 +260,7 @@ ol.pointer.TouchSource.prototype.findTouch_ = function(touchList, searchId) { * this "abandoned" touch * * @private - * @param {goog.events.BrowserEvent} inEvent + * @param {goog.events.BrowserEvent} inEvent The in event. */ ol.pointer.TouchSource.prototype.vacuumTouches_ = function(inEvent) { var touchList = inEvent.getBrowserEvent().touches; @@ -296,7 +293,7 @@ ol.pointer.TouchSource.prototype.vacuumTouches_ = function(inEvent) { * Handler for `touchstart`, triggers `pointerover`, * `pointerenter` and `pointerdown` events. * - * @param {goog.events.BrowserEvent} inEvent + * @param {goog.events.BrowserEvent} inEvent The in event. */ ol.pointer.TouchSource.prototype.touchstart = function(inEvent) { this.vacuumTouches_(inEvent); @@ -309,8 +306,8 @@ ol.pointer.TouchSource.prototype.touchstart = function(inEvent) { /** * @private - * @param {goog.events.BrowserEvent} browserEvent - * @param {Object} inPointer + * @param {goog.events.BrowserEvent} browserEvent The event. + * @param {Object} inPointer The in pointer object. */ ol.pointer.TouchSource.prototype.overDown_ = function(browserEvent, inPointer) { this.pointerMap[inPointer.pointerId] = { @@ -327,7 +324,7 @@ ol.pointer.TouchSource.prototype.overDown_ = function(browserEvent, inPointer) { /** * Handler for `touchmove`. * - * @param {goog.events.BrowserEvent} inEvent + * @param {goog.events.BrowserEvent} inEvent The in event. */ ol.pointer.TouchSource.prototype.touchmove = function(inEvent) { inEvent.preventDefault(); @@ -337,11 +334,10 @@ ol.pointer.TouchSource.prototype.touchmove = function(inEvent) { /** * @private - * @param {goog.events.BrowserEvent} browserEvent - * @param {Object} inPointer + * @param {goog.events.BrowserEvent} browserEvent The event. + * @param {Object} inPointer The in pointer. */ -ol.pointer.TouchSource.prototype.moveOverOut_ = - function(browserEvent, inPointer) { +ol.pointer.TouchSource.prototype.moveOverOut_ = function(browserEvent, inPointer) { var event = inPointer; var pointer = this.pointerMap[event.pointerId]; // a finger drifted off the screen, ignore it @@ -375,7 +371,7 @@ ol.pointer.TouchSource.prototype.moveOverOut_ = * Handler for `touchend`, triggers `pointerup`, * `pointerout` and `pointerleave` events. * - * @param {goog.events.BrowserEvent} inEvent + * @param {goog.events.BrowserEvent} inEvent The event. */ ol.pointer.TouchSource.prototype.touchend = function(inEvent) { this.dedupSynthMouse_(inEvent); @@ -385,8 +381,8 @@ ol.pointer.TouchSource.prototype.touchend = function(inEvent) { /** * @private - * @param {goog.events.BrowserEvent} browserEvent - * @param {Object} inPointer + * @param {goog.events.BrowserEvent} browserEvent An event. + * @param {Object} inPointer The inPointer object. */ ol.pointer.TouchSource.prototype.upOut_ = function(browserEvent, inPointer) { this.dispatcher.up(inPointer, browserEvent); @@ -400,7 +396,7 @@ ol.pointer.TouchSource.prototype.upOut_ = function(browserEvent, inPointer) { * Handler for `touchcancel`, triggers `pointercancel`, * `pointerout` and `pointerleave` events. * - * @param {goog.events.BrowserEvent} inEvent + * @param {goog.events.BrowserEvent} inEvent The in event. */ ol.pointer.TouchSource.prototype.touchcancel = function(inEvent) { this.processTouches_(inEvent, this.cancelOut_); @@ -409,11 +405,10 @@ ol.pointer.TouchSource.prototype.touchcancel = function(inEvent) { /** * @private - * @param {goog.events.BrowserEvent} browserEvent - * @param {Object} inPointer + * @param {goog.events.BrowserEvent} browserEvent The event. + * @param {Object} inPointer The in pointer. */ -ol.pointer.TouchSource.prototype.cancelOut_ = - function(browserEvent, inPointer) { +ol.pointer.TouchSource.prototype.cancelOut_ = function(browserEvent, inPointer) { this.dispatcher.cancel(inPointer, browserEvent); this.dispatcher.out(inPointer, browserEvent); this.dispatcher.leave(inPointer, browserEvent); @@ -423,7 +418,7 @@ ol.pointer.TouchSource.prototype.cancelOut_ = /** * @private - * @param {Object} inPointer + * @param {Object} inPointer The inPointer object. */ ol.pointer.TouchSource.prototype.cleanUpPointer_ = function(inPointer) { delete this.pointerMap[inPointer.pointerId]; @@ -435,7 +430,7 @@ ol.pointer.TouchSource.prototype.cleanUpPointer_ = function(inPointer) { * Prevent synth mouse events from creating pointer events. * * @private - * @param {goog.events.BrowserEvent} inEvent + * @param {goog.events.BrowserEvent} inEvent The in event. */ ol.pointer.TouchSource.prototype.dedupSynthMouse_ = function(inEvent) { var lts = this.mouseSource.lastTouches; diff --git a/src/ol/proj/epsg3857projection.js b/src/ol/proj/epsg3857projection.js index e98fb48d34..341bcaaa0b 100644 --- a/src/ol/proj/epsg3857projection.js +++ b/src/ol/proj/epsg3857projection.js @@ -7,7 +7,6 @@ goog.require('ol.proj.Projection'); goog.require('ol.proj.Units'); - /** * @classdesc * Projection object for web/spherical Mercator (EPSG:3857). diff --git a/src/ol/proj/epsg4326projection.js b/src/ol/proj/epsg4326projection.js index 336f1edb4c..7e58e055f9 100644 --- a/src/ol/proj/epsg4326projection.js +++ b/src/ol/proj/epsg4326projection.js @@ -6,7 +6,6 @@ goog.require('ol.proj.Units'); goog.require('ol.sphere.WGS84'); - /** * @classdesc * Projection object for WGS84 geographic coordinates (EPSG:4326). diff --git a/src/ol/proj/proj.js b/src/ol/proj/proj.js index 15bf89ee9f..e4f0d13ce2 100644 --- a/src/ol/proj/proj.js +++ b/src/ol/proj/proj.js @@ -52,7 +52,6 @@ ol.proj.METERS_PER_UNIT[ol.proj.Units.METERS] = 1; ol.proj.METERS_PER_UNIT[ol.proj.Units.USFEET] = 1200 / 3937; - /** * @classdesc * Projection definition class. One of these is created for each projection @@ -470,8 +469,7 @@ ol.proj.addEquivalentProjections = function(projections) { * @param {ol.TransformFunction} inverseTransform Transform from any projection * in projection2 to any projection in projection1.. */ -ol.proj.addEquivalentTransforms = - function(projections1, projections2, forwardTransform, inverseTransform) { +ol.proj.addEquivalentTransforms = function(projections1, projections2, forwardTransform, inverseTransform) { projections1.forEach(function(projection1) { projections2.forEach(function(projection2) { ol.proj.addTransform(projection1, projection2, forwardTransform); @@ -570,8 +568,7 @@ ol.proj.addTransform = function(source, destination, transformFn) { * the transformed {@link ol.Coordinate}. * @api stable */ -ol.proj.addCoordinateTransforms = - function(source, destination, forward, inverse) { +ol.proj.addCoordinateTransforms = function(source, destination, forward, inverse) { var sourceProj = ol.proj.get(source); var destProj = ol.proj.get(destination); ol.proj.addTransform(sourceProj, destProj, @@ -752,8 +749,7 @@ ol.proj.getTransform = function(source, destination) { * object. * @return {ol.TransformFunction} Transform function. */ -ol.proj.getTransformFromProjections = - function(sourceProjection, destinationProjection) { +ol.proj.getTransformFromProjections = function(sourceProjection, destinationProjection) { var transforms = ol.proj.transforms_; var sourceCode = sourceProjection.getCode(); var destinationCode = destinationProjection.getCode(); @@ -853,8 +849,7 @@ ol.proj.transformExtent = function(extent, source, destination) { * @param {ol.proj.Projection} destinationProjection Destination projection. * @return {ol.Coordinate} Point. */ -ol.proj.transformWithProjections = - function(point, sourceProjection, destinationProjection) { +ol.proj.transformWithProjections = function(point, sourceProjection, destinationProjection) { var transformFn = ol.proj.getTransformFromProjections( sourceProjection, destinationProjection); return transformFn(point); diff --git a/src/ol/render/box.js b/src/ol/render/box.js index 48b34fa5cf..cc2c534b97 100644 --- a/src/ol/render/box.js +++ b/src/ol/render/box.js @@ -7,7 +7,6 @@ goog.require('goog.asserts'); goog.require('ol.geom.Polygon'); - /** * @constructor * @extends {goog.Disposable} diff --git a/src/ol/render/canvas/canvasimmediate.js b/src/ol/render/canvas/canvasimmediate.js index b9b4346b31..9003160ae6 100644 --- a/src/ol/render/canvas/canvasimmediate.js +++ b/src/ol/render/canvas/canvasimmediate.js @@ -17,7 +17,6 @@ goog.require('ol.render.canvas'); goog.require('ol.vec.Mat4'); - /** * @classdesc * A concrete subclass of {@link ol.render.VectorContext} that implements @@ -36,8 +35,7 @@ goog.require('ol.vec.Mat4'); * @param {number} viewRotation View rotation. * @struct */ -ol.render.canvas.Immediate = - function(context, pixelRatio, extent, transform, viewRotation) { +ol.render.canvas.Immediate = function(context, pixelRatio, extent, transform, viewRotation) { /** * @private @@ -248,8 +246,7 @@ ol.render.canvas.Immediate = * @param {number} stride Stride. * @private */ -ol.render.canvas.Immediate.prototype.drawImages_ = - function(flatCoordinates, offset, end, stride) { +ol.render.canvas.Immediate.prototype.drawImages_ = function(flatCoordinates, offset, end, stride) { if (!this.image_) { return; } @@ -311,8 +308,7 @@ ol.render.canvas.Immediate.prototype.drawImages_ = * @param {number} stride Stride. * @private */ -ol.render.canvas.Immediate.prototype.drawText_ = - function(flatCoordinates, offset, end, stride) { +ol.render.canvas.Immediate.prototype.drawText_ = function(flatCoordinates, offset, end, stride) { if (!this.textState_ || this.text_ === '') { return; } @@ -366,8 +362,7 @@ ol.render.canvas.Immediate.prototype.drawText_ = * @private * @return {number} end End. */ -ol.render.canvas.Immediate.prototype.moveToLineTo_ = - function(flatCoordinates, offset, end, stride, close) { +ol.render.canvas.Immediate.prototype.moveToLineTo_ = function(flatCoordinates, offset, end, stride, close) { var context = this.context_; var pixelCoordinates = ol.geom.flat.transform.transform2D( flatCoordinates, offset, end, stride, this.transform_, @@ -392,8 +387,7 @@ ol.render.canvas.Immediate.prototype.moveToLineTo_ = * @private * @return {number} End. */ -ol.render.canvas.Immediate.prototype.drawRings_ = - function(flatCoordinates, offset, ends, stride) { +ol.render.canvas.Immediate.prototype.drawRings_ = function(flatCoordinates, offset, ends, stride) { var context = this.context_; var i, ii; for (i = 0, ii = ends.length; i < ii; ++i) { @@ -432,8 +426,7 @@ ol.render.canvas.Immediate.prototype.drawAsync = function(zIndex, callback) { * @param {ol.geom.Circle} circleGeometry Circle geometry. * @api */ -ol.render.canvas.Immediate.prototype.drawCircleGeometry = - function(circleGeometry) { +ol.render.canvas.Immediate.prototype.drawCircleGeometry = function(circleGeometry) { if (!ol.extent.intersects(this.extent_, circleGeometry.getExtent())) { return; } @@ -508,8 +501,7 @@ ol.render.canvas.Immediate.prototype.drawFeature = function(feature, style) { * collection. * @param {ol.Feature} feature Feature. */ -ol.render.canvas.Immediate.prototype.drawGeometryCollectionGeometry = - function(geometryCollectionGeometry, feature) { +ol.render.canvas.Immediate.prototype.drawGeometryCollectionGeometry = function(geometryCollectionGeometry, feature) { var geometries = geometryCollectionGeometry.getGeometriesArray(); var i, ii; for (i = 0, ii = geometries.length; i < ii; ++i) { @@ -530,8 +522,7 @@ ol.render.canvas.Immediate.prototype.drawGeometryCollectionGeometry = * @param {ol.geom.Point|ol.render.Feature} pointGeometry Point geometry. * @api */ -ol.render.canvas.Immediate.prototype.drawPointGeometry = - function(pointGeometry) { +ol.render.canvas.Immediate.prototype.drawPointGeometry = function(pointGeometry) { var flatCoordinates = pointGeometry.getFlatCoordinates(); var stride = pointGeometry.getStride(); if (this.image_) { @@ -551,8 +542,7 @@ ol.render.canvas.Immediate.prototype.drawPointGeometry = * geometry. * @api */ -ol.render.canvas.Immediate.prototype.drawMultiPointGeometry = - function(multiPointGeometry) { +ol.render.canvas.Immediate.prototype.drawMultiPointGeometry = function(multiPointGeometry) { var flatCoordinates = multiPointGeometry.getFlatCoordinates(); var stride = multiPointGeometry.getStride(); if (this.image_) { @@ -572,8 +562,7 @@ ol.render.canvas.Immediate.prototype.drawMultiPointGeometry = * string geometry. * @api */ -ol.render.canvas.Immediate.prototype.drawLineStringGeometry = - function(lineStringGeometry) { +ol.render.canvas.Immediate.prototype.drawLineStringGeometry = function(lineStringGeometry) { if (!ol.extent.intersects(this.extent_, lineStringGeometry.getExtent())) { return; } @@ -601,8 +590,7 @@ ol.render.canvas.Immediate.prototype.drawLineStringGeometry = * MultiLineString geometry. * @api */ -ol.render.canvas.Immediate.prototype.drawMultiLineStringGeometry = - function(multiLineStringGeometry) { +ol.render.canvas.Immediate.prototype.drawMultiLineStringGeometry = function(multiLineStringGeometry) { var geometryExtent = multiLineStringGeometry.getExtent(); if (!ol.extent.intersects(this.extent_, geometryExtent)) { return; @@ -637,8 +625,7 @@ ol.render.canvas.Immediate.prototype.drawMultiLineStringGeometry = * geometry. * @api */ -ol.render.canvas.Immediate.prototype.drawPolygonGeometry = - function(polygonGeometry) { +ol.render.canvas.Immediate.prototype.drawPolygonGeometry = function(polygonGeometry) { if (!ol.extent.intersects(this.extent_, polygonGeometry.getExtent())) { return; } @@ -673,8 +660,7 @@ ol.render.canvas.Immediate.prototype.drawPolygonGeometry = * @param {ol.geom.MultiPolygon} multiPolygonGeometry MultiPolygon geometry. * @api */ -ol.render.canvas.Immediate.prototype.drawMultiPolygonGeometry = - function(multiPolygonGeometry) { +ol.render.canvas.Immediate.prototype.drawMultiPolygonGeometry = function(multiPolygonGeometry) { if (!ol.extent.intersects(this.extent_, multiPolygonGeometry.getExtent())) { return; } @@ -737,8 +723,7 @@ ol.render.canvas.Immediate.prototype.flush = function() { * @param {ol.render.canvas.FillState} fillState Fill state. * @private */ -ol.render.canvas.Immediate.prototype.setContextFillState_ = - function(fillState) { +ol.render.canvas.Immediate.prototype.setContextFillState_ = function(fillState) { var context = this.context_; var contextFillState = this.contextFillState_; if (!contextFillState) { @@ -758,8 +743,7 @@ ol.render.canvas.Immediate.prototype.setContextFillState_ = * @param {ol.render.canvas.StrokeState} strokeState Stroke state. * @private */ -ol.render.canvas.Immediate.prototype.setContextStrokeState_ = - function(strokeState) { +ol.render.canvas.Immediate.prototype.setContextStrokeState_ = function(strokeState) { var context = this.context_; var contextStrokeState = this.contextStrokeState_; if (!contextStrokeState) { @@ -811,8 +795,7 @@ ol.render.canvas.Immediate.prototype.setContextStrokeState_ = * @param {ol.render.canvas.TextState} textState Text state. * @private */ -ol.render.canvas.Immediate.prototype.setContextTextState_ = - function(textState) { +ol.render.canvas.Immediate.prototype.setContextTextState_ = function(textState) { var context = this.context_; var contextTextState = this.contextTextState_; if (!contextTextState) { @@ -847,8 +830,7 @@ ol.render.canvas.Immediate.prototype.setContextTextState_ = * @param {ol.style.Stroke} strokeStyle Stroke style. * @api */ -ol.render.canvas.Immediate.prototype.setFillStrokeStyle = - function(fillStyle, strokeStyle) { +ol.render.canvas.Immediate.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) { if (!fillStyle) { this.fillState_ = null; } else { diff --git a/src/ol/render/canvas/canvasreplay.js b/src/ol/render/canvas/canvasreplay.js index 1bfcbd47b7..4b55813774 100644 --- a/src/ol/render/canvas/canvasreplay.js +++ b/src/ol/render/canvas/canvasreplay.js @@ -47,7 +47,6 @@ ol.render.canvas.Instruction = { }; - /** * @constructor * @extends {ol.render.VectorContext} @@ -158,8 +157,7 @@ goog.inherits(ol.render.canvas.Replay, ol.render.VectorContext); * @protected * @return {number} My end. */ -ol.render.canvas.Replay.prototype.appendFlatCoordinates = - function(flatCoordinates, offset, end, stride, close) { +ol.render.canvas.Replay.prototype.appendFlatCoordinates = function(flatCoordinates, offset, end, stride, close) { var myEnd = this.coordinates.length; var extent = this.getBufferedMaxExtent(); @@ -601,8 +599,7 @@ ol.render.canvas.Replay.prototype.replayHitDetection = function( /** * @private */ -ol.render.canvas.Replay.prototype.reverseHitDetectionInstructions_ = - function() { +ol.render.canvas.Replay.prototype.reverseHitDetectionInstructions_ = function() { var hitDetectionInstructions = this.hitDetectionInstructions; // step 1 - reverse array hitDetectionInstructions.reverse(); @@ -667,7 +664,6 @@ ol.render.canvas.Replay.prototype.getBufferedMaxExtent = function() { }; - /** * @constructor * @extends {ol.render.canvas.Replay} @@ -770,8 +766,7 @@ goog.inherits(ol.render.canvas.ImageReplay, ol.render.canvas.Replay); * @private * @return {number} My end. */ -ol.render.canvas.ImageReplay.prototype.drawCoordinates_ = - function(flatCoordinates, offset, end, stride) { +ol.render.canvas.ImageReplay.prototype.drawCoordinates_ = function(flatCoordinates, offset, end, stride) { return this.appendFlatCoordinates( flatCoordinates, offset, end, stride, false); }; @@ -780,8 +775,7 @@ ol.render.canvas.ImageReplay.prototype.drawCoordinates_ = /** * @inheritDoc */ -ol.render.canvas.ImageReplay.prototype.drawPointGeometry = - function(pointGeometry, feature) { +ol.render.canvas.ImageReplay.prototype.drawPointGeometry = function(pointGeometry, feature) { if (!this.image_) { return; } @@ -833,8 +827,7 @@ ol.render.canvas.ImageReplay.prototype.drawPointGeometry = /** * @inheritDoc */ -ol.render.canvas.ImageReplay.prototype.drawMultiPointGeometry = - function(multiPointGeometry, feature) { +ol.render.canvas.ImageReplay.prototype.drawMultiPointGeometry = function(multiPointGeometry, feature) { if (!this.image_) { return; } @@ -937,7 +930,6 @@ ol.render.canvas.ImageReplay.prototype.setImageStyle = function(imageStyle) { }; - /** * @constructor * @extends {ol.render.canvas.Replay} @@ -995,8 +987,7 @@ goog.inherits(ol.render.canvas.LineStringReplay, ol.render.canvas.Replay); * @private * @return {number} end. */ -ol.render.canvas.LineStringReplay.prototype.drawFlatCoordinates_ = - function(flatCoordinates, offset, end, stride) { +ol.render.canvas.LineStringReplay.prototype.drawFlatCoordinates_ = function(flatCoordinates, offset, end, stride) { var myBegin = this.coordinates.length; var myEnd = this.appendFlatCoordinates( flatCoordinates, offset, end, stride, false); @@ -1069,8 +1060,7 @@ ol.render.canvas.LineStringReplay.prototype.setStrokeStyle_ = function() { /** * @inheritDoc */ -ol.render.canvas.LineStringReplay.prototype.drawLineStringGeometry = - function(lineStringGeometry, feature) { +ol.render.canvas.LineStringReplay.prototype.drawLineStringGeometry = function(lineStringGeometry, feature) { var state = this.state_; goog.asserts.assert(state, 'state should not be null'); var strokeStyle = state.strokeStyle; @@ -1097,8 +1087,7 @@ ol.render.canvas.LineStringReplay.prototype.drawLineStringGeometry = /** * @inheritDoc */ -ol.render.canvas.LineStringReplay.prototype.drawMultiLineStringGeometry = - function(multiLineStringGeometry, feature) { +ol.render.canvas.LineStringReplay.prototype.drawMultiLineStringGeometry = function(multiLineStringGeometry, feature) { var state = this.state_; goog.asserts.assert(state, 'state should not be null'); var strokeStyle = state.strokeStyle; @@ -1144,8 +1133,7 @@ ol.render.canvas.LineStringReplay.prototype.finish = function() { /** * @inheritDoc */ -ol.render.canvas.LineStringReplay.prototype.setFillStrokeStyle = - function(fillStyle, strokeStyle) { +ol.render.canvas.LineStringReplay.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) { goog.asserts.assert(this.state_, 'this.state_ should not be null'); goog.asserts.assert(!fillStyle, 'fillStyle should be null'); goog.asserts.assert(strokeStyle, 'strokeStyle should not be null'); @@ -1176,7 +1164,6 @@ ol.render.canvas.LineStringReplay.prototype.setFillStrokeStyle = }; - /** * @constructor * @extends {ol.render.canvas.Replay} @@ -1236,8 +1223,7 @@ goog.inherits(ol.render.canvas.PolygonReplay, ol.render.canvas.Replay); * @private * @return {number} End. */ -ol.render.canvas.PolygonReplay.prototype.drawFlatCoordinatess_ = - function(flatCoordinates, offset, ends, stride) { +ol.render.canvas.PolygonReplay.prototype.drawFlatCoordinatess_ = function(flatCoordinates, offset, ends, stride) { var state = this.state_; var beginPathInstruction = [ol.render.canvas.Instruction.BEGIN_PATH]; this.instructions.push(beginPathInstruction); @@ -1277,8 +1263,7 @@ ol.render.canvas.PolygonReplay.prototype.drawFlatCoordinatess_ = /** * @inheritDoc */ -ol.render.canvas.PolygonReplay.prototype.drawCircleGeometry = - function(circleGeometry, feature) { +ol.render.canvas.PolygonReplay.prototype.drawCircleGeometry = function(circleGeometry, feature) { var state = this.state_; goog.asserts.assert(state, 'state should not be null'); var fillStyle = state.fillStyle; @@ -1330,8 +1315,7 @@ ol.render.canvas.PolygonReplay.prototype.drawCircleGeometry = /** * @inheritDoc */ -ol.render.canvas.PolygonReplay.prototype.drawPolygonGeometry = - function(polygonGeometry, feature) { +ol.render.canvas.PolygonReplay.prototype.drawPolygonGeometry = function(polygonGeometry, feature) { var state = this.state_; goog.asserts.assert(state, 'state should not be null'); var fillStyle = state.fillStyle; @@ -1366,8 +1350,7 @@ ol.render.canvas.PolygonReplay.prototype.drawPolygonGeometry = /** * @inheritDoc */ -ol.render.canvas.PolygonReplay.prototype.drawMultiPolygonGeometry = - function(multiPolygonGeometry, feature) { +ol.render.canvas.PolygonReplay.prototype.drawMultiPolygonGeometry = function(multiPolygonGeometry, feature) { var state = this.state_; goog.asserts.assert(state, 'state should not be null'); var fillStyle = state.fillStyle; @@ -1444,8 +1427,7 @@ ol.render.canvas.PolygonReplay.prototype.getBufferedMaxExtent = function() { /** * @inheritDoc */ -ol.render.canvas.PolygonReplay.prototype.setFillStrokeStyle = - function(fillStyle, strokeStyle) { +ol.render.canvas.PolygonReplay.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) { goog.asserts.assert(this.state_, 'this.state_ should not be null'); goog.asserts.assert(fillStyle || strokeStyle, 'fillStyle or strokeStyle should not be null'); @@ -1537,7 +1519,6 @@ ol.render.canvas.PolygonReplay.prototype.setFillStrokeStyles_ = function() { }; - /** * @constructor * @extends {ol.render.canvas.Replay} @@ -1624,8 +1605,7 @@ goog.inherits(ol.render.canvas.TextReplay, ol.render.canvas.Replay); /** * @inheritDoc */ -ol.render.canvas.TextReplay.prototype.drawText = - function(flatCoordinates, offset, end, stride, geometry, feature) { +ol.render.canvas.TextReplay.prototype.drawText = function(flatCoordinates, offset, end, stride, geometry, feature) { if (this.text_ === '' || !this.textState_ || (!this.textFillState_ && !this.textStrokeState_)) { return; @@ -1657,8 +1637,7 @@ ol.render.canvas.TextReplay.prototype.drawText = * @param {ol.render.canvas.FillState} fillState Fill state. * @private */ -ol.render.canvas.TextReplay.prototype.setReplayFillState_ = - function(fillState) { +ol.render.canvas.TextReplay.prototype.setReplayFillState_ = function(fillState) { var replayFillState = this.replayFillState_; if (replayFillState && replayFillState.fillStyle == fillState.fillStyle) { @@ -1682,8 +1661,7 @@ ol.render.canvas.TextReplay.prototype.setReplayFillState_ = * @param {ol.render.canvas.StrokeState} strokeState Stroke state. * @private */ -ol.render.canvas.TextReplay.prototype.setReplayStrokeState_ = - function(strokeState) { +ol.render.canvas.TextReplay.prototype.setReplayStrokeState_ = function(strokeState) { var replayStrokeState = this.replayStrokeState_; if (replayStrokeState && replayStrokeState.lineCap == strokeState.lineCap && @@ -1725,8 +1703,7 @@ ol.render.canvas.TextReplay.prototype.setReplayStrokeState_ = * @param {ol.render.canvas.TextState} textState Text state. * @private */ -ol.render.canvas.TextReplay.prototype.setReplayTextState_ = - function(textState) { +ol.render.canvas.TextReplay.prototype.setReplayTextState_ = function(textState) { var replayTextState = this.replayTextState_; if (replayTextState && replayTextState.font == textState.font && @@ -1851,7 +1828,6 @@ ol.render.canvas.TextReplay.prototype.setTextStyle = function(textStyle) { }; - /** * @constructor * @implements {ol.render.IReplayGroup} @@ -1979,8 +1955,7 @@ ol.render.canvas.ReplayGroup.prototype.forEachFeatureAtCoordinate = function( /** * @inheritDoc */ -ol.render.canvas.ReplayGroup.prototype.getReplay = - function(zIndex, replayType) { +ol.render.canvas.ReplayGroup.prototype.getReplay = function(zIndex, replayType) { var zIndexKey = zIndex !== undefined ? zIndex.toString() : '0'; var replays = this.replaysByZIndex_[zIndexKey]; if (replays === undefined) { @@ -2081,7 +2056,9 @@ ol.render.canvas.ReplayGroup.prototype.replayHitDetection_ = function( featureCallback, opt_hitExtent) { /** @type {Array.} */ var zs = Object.keys(this.replaysByZIndex_).map(Number); - zs.sort(function(a, b) { return b - a; }); + zs.sort(function(a, b) { + return b - a; + }); var i, ii, j, replays, replay, result; for (i = 0, ii = zs.length; i < ii; ++i) { diff --git a/src/ol/render/ireplay.js b/src/ol/render/ireplay.js index 6d1048a043..24c37c7ead 100644 --- a/src/ol/render/ireplay.js +++ b/src/ol/render/ireplay.js @@ -26,7 +26,6 @@ ol.render.REPLAY_ORDER = [ ]; - /** * @interface */ @@ -34,6 +33,11 @@ ol.render.IReplayGroup = function() { }; +/* eslint-disable valid-jsdoc */ +// TODO: enable valid-jsdoc for @interface methods when this issue is resolved +// https://github.com/eslint/eslint/issues/4887 + + /** * @param {number|undefined} zIndex Z index. * @param {ol.render.ReplayType} replayType Replay type. diff --git a/src/ol/render/renderevent.js b/src/ol/render/renderevent.js index 9a0e647c2c..d569982986 100644 --- a/src/ol/render/renderevent.js +++ b/src/ol/render/renderevent.js @@ -27,7 +27,6 @@ ol.render.EventType = { }; - /** * @constructor * @extends {goog.events.Event} diff --git a/src/ol/render/renderfeature.js b/src/ol/render/renderfeature.js index a05c7bcb44..7e16495772 100644 --- a/src/ol/render/renderfeature.js +++ b/src/ol/render/renderfeature.js @@ -6,7 +6,6 @@ goog.require('ol.extent'); goog.require('ol.geom.GeometryType'); - /** * Lightweight, read-only, {@link ol.Feature} and {@link ol.geom.Geometry} like * structure, optimized for rendering and styling. Geometry access through the @@ -100,12 +99,18 @@ ol.render.Feature.prototype.getExtent = function() { /** * @return {Array.} Flat coordinates. */ -ol.render.Feature.prototype.getFlatCoordinates = - ol.render.Feature.prototype.getOrientedFlatCoordinates = function() { +ol.render.Feature.prototype.getOrientedFlatCoordinates = function() { return this.flatCoordinates_; }; +/** + * @return {Array.} Flat coordinates. + */ +ol.render.Feature.prototype.getFlatCoordinates = + ol.render.Feature.prototype.getOrientedFlatCoordinates; + + /** * Get the feature for working with its geometry. * @return {ol.render.Feature} Feature. diff --git a/src/ol/render/vector.js b/src/ol/render/vector.js index 504ed3d583..ea983b7023 100644 --- a/src/ol/render/vector.js +++ b/src/ol/render/vector.js @@ -45,8 +45,7 @@ ol.renderer.vector.getTolerance = function(resolution, pixelRatio) { * @param {ol.Feature} feature Feature. * @private */ -ol.renderer.vector.renderCircleGeometry_ = - function(replayGroup, geometry, style, feature) { +ol.renderer.vector.renderCircleGeometry_ = function(replayGroup, geometry, style, feature) { var fillStyle = style.getFill(); var strokeStyle = style.getStroke(); if (fillStyle || strokeStyle) { @@ -131,8 +130,7 @@ ol.renderer.vector.renderFeature_ = function( * @param {ol.Feature} feature Feature. * @private */ -ol.renderer.vector.renderGeometryCollectionGeometry_ = - function(replayGroup, geometry, style, feature) { +ol.renderer.vector.renderGeometryCollectionGeometry_ = function(replayGroup, geometry, style, feature) { var geometries = geometry.getGeometriesArray(); var i, ii; for (i = 0, ii = geometries.length; i < ii; ++i) { @@ -152,8 +150,7 @@ ol.renderer.vector.renderGeometryCollectionGeometry_ = * @param {ol.Feature|ol.render.Feature} feature Feature. * @private */ -ol.renderer.vector.renderLineStringGeometry_ = - function(replayGroup, geometry, style, feature) { +ol.renderer.vector.renderLineStringGeometry_ = function(replayGroup, geometry, style, feature) { var strokeStyle = style.getStroke(); if (strokeStyle) { var lineStringReplay = replayGroup.getReplay( @@ -178,8 +175,7 @@ ol.renderer.vector.renderLineStringGeometry_ = * @param {ol.Feature|ol.render.Feature} feature Feature. * @private */ -ol.renderer.vector.renderMultiLineStringGeometry_ = - function(replayGroup, geometry, style, feature) { +ol.renderer.vector.renderMultiLineStringGeometry_ = function(replayGroup, geometry, style, feature) { var strokeStyle = style.getStroke(); if (strokeStyle) { var lineStringReplay = replayGroup.getReplay( @@ -206,8 +202,7 @@ ol.renderer.vector.renderMultiLineStringGeometry_ = * @param {ol.Feature} feature Feature. * @private */ -ol.renderer.vector.renderMultiPolygonGeometry_ = - function(replayGroup, geometry, style, feature) { +ol.renderer.vector.renderMultiPolygonGeometry_ = function(replayGroup, geometry, style, feature) { var fillStyle = style.getFill(); var strokeStyle = style.getStroke(); if (strokeStyle || fillStyle) { @@ -235,8 +230,7 @@ ol.renderer.vector.renderMultiPolygonGeometry_ = * @param {ol.Feature|ol.render.Feature} feature Feature. * @private */ -ol.renderer.vector.renderPointGeometry_ = - function(replayGroup, geometry, style, feature) { +ol.renderer.vector.renderPointGeometry_ = function(replayGroup, geometry, style, feature) { var imageStyle = style.getImage(); if (imageStyle) { if (imageStyle.getImageState() != ol.style.ImageState.LOADED) { @@ -265,8 +259,7 @@ ol.renderer.vector.renderPointGeometry_ = * @param {ol.Feature|ol.render.Feature} feature Feature. * @private */ -ol.renderer.vector.renderMultiPointGeometry_ = - function(replayGroup, geometry, style, feature) { +ol.renderer.vector.renderMultiPointGeometry_ = function(replayGroup, geometry, style, feature) { var imageStyle = style.getImage(); if (imageStyle) { if (imageStyle.getImageState() != ol.style.ImageState.LOADED) { @@ -296,8 +289,7 @@ ol.renderer.vector.renderMultiPointGeometry_ = * @param {ol.Feature|ol.render.Feature} feature Feature. * @private */ -ol.renderer.vector.renderPolygonGeometry_ = - function(replayGroup, geometry, style, feature) { +ol.renderer.vector.renderPolygonGeometry_ = function(replayGroup, geometry, style, feature) { var fillStyle = style.getFill(); var strokeStyle = style.getStroke(); if (fillStyle || strokeStyle) { diff --git a/src/ol/render/vectorcontext.js b/src/ol/render/vectorcontext.js index f643c56d5a..5329ad7630 100644 --- a/src/ol/render/vectorcontext.js +++ b/src/ol/render/vectorcontext.js @@ -1,7 +1,6 @@ goog.provide('ol.render.VectorContext'); - /** * Context for drawing geometries. A vector context is available on render * events and does not need to be constructed directly. diff --git a/src/ol/render/webgl/webglimagedefaultshader.js b/src/ol/render/webgl/webglimagedefaultshader.js index 5142595984..b93096d06a 100644 --- a/src/ol/render/webgl/webglimagedefaultshader.js +++ b/src/ol/render/webgl/webglimagedefaultshader.js @@ -7,7 +7,6 @@ goog.provide('ol.render.webgl.imagereplay.shader.DefaultVertex'); goog.require('ol.webgl.shader'); - /** * @constructor * @extends {ol.webgl.shader.Fragment} @@ -43,7 +42,6 @@ ol.render.webgl.imagereplay.shader.DefaultFragment.SOURCE = goog.DEBUG ? ol.render.webgl.imagereplay.shader.DefaultFragment.OPTIMIZED_SOURCE; - /** * @constructor * @extends {ol.webgl.shader.Vertex} @@ -79,7 +77,6 @@ ol.render.webgl.imagereplay.shader.DefaultVertex.SOURCE = goog.DEBUG ? ol.render.webgl.imagereplay.shader.DefaultVertex.OPTIMIZED_SOURCE; - /** * @constructor * @param {WebGLRenderingContext} gl GL. diff --git a/src/ol/render/webgl/webglimmediate.js b/src/ol/render/webgl/webglimmediate.js index d6590cea31..ddde7db05a 100644 --- a/src/ol/render/webgl/webglimmediate.js +++ b/src/ol/render/webgl/webglimmediate.js @@ -6,7 +6,6 @@ goog.require('ol.render.webgl.ImageReplay'); goog.require('ol.render.webgl.ReplayGroup'); - /** * @constructor * @extends {ol.render.VectorContext} @@ -114,8 +113,7 @@ ol.render.webgl.Immediate.prototype.drawAsync = function(zIndex, callback) { * @inheritDoc * @api */ -ol.render.webgl.Immediate.prototype.drawCircleGeometry = - function(circleGeometry, data) { +ol.render.webgl.Immediate.prototype.drawCircleGeometry = function(circleGeometry, data) { }; @@ -152,8 +150,7 @@ ol.render.webgl.Immediate.prototype.drawFeature = function(feature, style) { * @inheritDoc * @api */ -ol.render.webgl.Immediate.prototype.drawGeometryCollectionGeometry = - function(geometryCollectionGeometry, data) { +ol.render.webgl.Immediate.prototype.drawGeometryCollectionGeometry = function(geometryCollectionGeometry, data) { var geometries = geometryCollectionGeometry.getGeometriesArray(); var renderers = ol.render.webgl.Immediate.GEOMETRY_RENDERERS_; var i, ii; @@ -174,8 +171,7 @@ ol.render.webgl.Immediate.prototype.drawGeometryCollectionGeometry = * @inheritDoc * @api */ -ol.render.webgl.Immediate.prototype.drawPointGeometry = - function(pointGeometry, data) { +ol.render.webgl.Immediate.prototype.drawPointGeometry = function(pointGeometry, data) { var context = this.context_; var replayGroup = new ol.render.webgl.ReplayGroup(1, this.extent_); var replay = /** @type {ol.render.webgl.ImageReplay} */ ( @@ -199,8 +195,7 @@ ol.render.webgl.Immediate.prototype.drawPointGeometry = * @inheritDoc * @api */ -ol.render.webgl.Immediate.prototype.drawLineStringGeometry = - function(lineStringGeometry, data) { +ol.render.webgl.Immediate.prototype.drawLineStringGeometry = function(lineStringGeometry, data) { }; @@ -208,8 +203,7 @@ ol.render.webgl.Immediate.prototype.drawLineStringGeometry = * @inheritDoc * @api */ -ol.render.webgl.Immediate.prototype.drawMultiLineStringGeometry = - function(multiLineStringGeometry, data) { +ol.render.webgl.Immediate.prototype.drawMultiLineStringGeometry = function(multiLineStringGeometry, data) { }; @@ -217,8 +211,7 @@ ol.render.webgl.Immediate.prototype.drawMultiLineStringGeometry = * @inheritDoc * @api */ -ol.render.webgl.Immediate.prototype.drawMultiPointGeometry = - function(multiPointGeometry, data) { +ol.render.webgl.Immediate.prototype.drawMultiPointGeometry = function(multiPointGeometry, data) { var context = this.context_; var replayGroup = new ol.render.webgl.ReplayGroup(1, this.extent_); var replay = /** @type {ol.render.webgl.ImageReplay} */ ( @@ -241,8 +234,7 @@ ol.render.webgl.Immediate.prototype.drawMultiPointGeometry = * @inheritDoc * @api */ -ol.render.webgl.Immediate.prototype.drawMultiPolygonGeometry = - function(multiPolygonGeometry, data) { +ol.render.webgl.Immediate.prototype.drawMultiPolygonGeometry = function(multiPolygonGeometry, data) { }; @@ -250,8 +242,7 @@ ol.render.webgl.Immediate.prototype.drawMultiPolygonGeometry = * @inheritDoc * @api */ -ol.render.webgl.Immediate.prototype.drawPolygonGeometry = - function(polygonGeometry, data) { +ol.render.webgl.Immediate.prototype.drawPolygonGeometry = function(polygonGeometry, data) { }; @@ -259,8 +250,7 @@ ol.render.webgl.Immediate.prototype.drawPolygonGeometry = * @inheritDoc * @api */ -ol.render.webgl.Immediate.prototype.drawText = - function(flatCoordinates, offset, end, stride, geometry, data) { +ol.render.webgl.Immediate.prototype.drawText = function(flatCoordinates, offset, end, stride, geometry, data) { }; @@ -268,8 +258,7 @@ ol.render.webgl.Immediate.prototype.drawText = * @inheritDoc * @api */ -ol.render.webgl.Immediate.prototype.setFillStrokeStyle = - function(fillStyle, strokeStyle) { +ol.render.webgl.Immediate.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) { }; diff --git a/src/ol/render/webgl/webglreplay.js b/src/ol/render/webgl/webglreplay.js index d20ca89279..fcccf2e457 100644 --- a/src/ol/render/webgl/webglreplay.js +++ b/src/ol/render/webgl/webglreplay.js @@ -17,7 +17,6 @@ goog.require('ol.webgl.Buffer'); goog.require('ol.webgl.Context'); - /** * @constructor * @extends {ol.render.VectorContext} @@ -216,8 +215,7 @@ goog.inherits(ol.render.webgl.ImageReplay, ol.render.VectorContext); * @param {ol.webgl.Context} context WebGL context. * @return {function()} Delete resources function. */ -ol.render.webgl.ImageReplay.prototype.getDeleteResourcesFunction = - function(context) { +ol.render.webgl.ImageReplay.prototype.getDeleteResourcesFunction = function(context) { // We only delete our stuff here. The shaders and the program may // be used by other ImageReplay instances (for other layers). And // they will be deleted when disposing of the ol.webgl.Context @@ -261,8 +259,7 @@ ol.render.webgl.ImageReplay.prototype.drawAsync = goog.abstractMethod; * @return {number} My end. * @private */ -ol.render.webgl.ImageReplay.prototype.drawCoordinates_ = - function(flatCoordinates, offset, end, stride) { +ol.render.webgl.ImageReplay.prototype.drawCoordinates_ = function(flatCoordinates, offset, end, stride) { goog.asserts.assert(this.anchorX_ !== undefined, 'anchorX is defined'); goog.asserts.assert(this.anchorY_ !== undefined, 'anchorY is defined'); goog.asserts.assert(this.height_ !== undefined, 'height is defined'); @@ -373,8 +370,7 @@ ol.render.webgl.ImageReplay.prototype.drawCoordinates_ = /** * @inheritDoc */ -ol.render.webgl.ImageReplay.prototype.drawMultiPointGeometry = - function(multiPointGeometry, feature) { +ol.render.webgl.ImageReplay.prototype.drawMultiPointGeometry = function(multiPointGeometry, feature) { this.startIndices_.push(this.indices_.length); this.startIndicesFeature_.push(feature); var flatCoordinates = multiPointGeometry.getFlatCoordinates(); @@ -387,8 +383,7 @@ ol.render.webgl.ImageReplay.prototype.drawMultiPointGeometry = /** * @inheritDoc */ -ol.render.webgl.ImageReplay.prototype.drawPointGeometry = - function(pointGeometry, feature) { +ol.render.webgl.ImageReplay.prototype.drawPointGeometry = function(pointGeometry, feature) { this.startIndices_.push(this.indices_.length); this.startIndicesFeature_.push(feature); var flatCoordinates = pointGeometry.getFlatCoordinates(); @@ -467,8 +462,7 @@ ol.render.webgl.ImageReplay.prototype.finish = function(context) { * @param {Object.} texturePerImage Texture cache. * @param {WebGLRenderingContext} gl Gl. */ -ol.render.webgl.ImageReplay.prototype.createTextures_ = - function(textures, images, texturePerImage, gl) { +ol.render.webgl.ImageReplay.prototype.createTextures_ = function(textures, images, texturePerImage, gl) { goog.asserts.assert(textures.length === 0, 'upon creation, textures is empty'); @@ -619,8 +613,7 @@ ol.render.webgl.ImageReplay.prototype.replay = function(context, * @param {Array.} textures Textures. * @param {Array.} groupIndices Texture group indices. */ -ol.render.webgl.ImageReplay.prototype.drawReplay_ = - function(gl, context, skippedFeaturesHash, textures, groupIndices) { +ol.render.webgl.ImageReplay.prototype.drawReplay_ = function(gl, context, skippedFeaturesHash, textures, groupIndices) { goog.asserts.assert(textures.length === groupIndices.length, 'number of textures and groupIndeces match'); var elementType = context.hasOESElementIndexUint ? @@ -670,8 +663,7 @@ ol.render.webgl.ImageReplay.prototype.drawReplay_ = * @param {number} elementType Element type. * @param {number} elementSize Element Size. */ -ol.render.webgl.ImageReplay.prototype.drawReplaySkipping_ = - function(gl, skippedFeaturesHash, textures, groupIndices, +ol.render.webgl.ImageReplay.prototype.drawReplaySkipping_ = function(gl, skippedFeaturesHash, textures, groupIndices, elementType, elementSize) { var featureIndex = 0; @@ -744,8 +736,7 @@ ol.render.webgl.ImageReplay.prototype.drawElements_ = function( * @return {T|undefined} Callback result. * @template T */ -ol.render.webgl.ImageReplay.prototype.drawHitDetectionReplay_ = - function(gl, context, skippedFeaturesHash, featureCallback, oneByOne, +ol.render.webgl.ImageReplay.prototype.drawHitDetectionReplay_ = function(gl, context, skippedFeaturesHash, featureCallback, oneByOne, opt_hitExtent) { if (!oneByOne) { // draw all hit-detection features in "once" (by texture group) @@ -769,8 +760,7 @@ ol.render.webgl.ImageReplay.prototype.drawHitDetectionReplay_ = * @return {T|undefined} Callback result. * @template T */ -ol.render.webgl.ImageReplay.prototype.drawHitDetectionReplayAll_ = - function(gl, context, skippedFeaturesHash, featureCallback) { +ol.render.webgl.ImageReplay.prototype.drawHitDetectionReplayAll_ = function(gl, context, skippedFeaturesHash, featureCallback) { gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); this.drawReplay_(gl, context, skippedFeaturesHash, this.hitDetectionTextures_, this.hitDetectionGroupIndices_); @@ -796,8 +786,7 @@ ol.render.webgl.ImageReplay.prototype.drawHitDetectionReplayAll_ = * @return {T|undefined} Callback result. * @template T */ -ol.render.webgl.ImageReplay.prototype.drawHitDetectionReplayOneByOne_ = - function(gl, context, skippedFeaturesHash, featureCallback, +ol.render.webgl.ImageReplay.prototype.drawHitDetectionReplayOneByOne_ = function(gl, context, skippedFeaturesHash, featureCallback, opt_hitExtent) { goog.asserts.assert(this.hitDetectionTextures_.length === this.hitDetectionGroupIndices_.length, @@ -921,7 +910,6 @@ ol.render.webgl.ImageReplay.prototype.setImageStyle = function(imageStyle) { }; - /** * @constructor * @implements {ol.render.IReplayGroup} @@ -965,8 +953,7 @@ ol.render.webgl.ReplayGroup = function( * @param {ol.webgl.Context} context WebGL context. * @return {function()} Delete resources function. */ -ol.render.webgl.ReplayGroup.prototype.getDeleteResourcesFunction = - function(context) { +ol.render.webgl.ReplayGroup.prototype.getDeleteResourcesFunction = function(context) { var functions = []; var replayKey; for (replayKey in this.replays_) { @@ -991,8 +978,7 @@ ol.render.webgl.ReplayGroup.prototype.finish = function(context) { /** * @inheritDoc */ -ol.render.webgl.ReplayGroup.prototype.getReplay = - function(zIndex, replayType) { +ol.render.webgl.ReplayGroup.prototype.getReplay = function(zIndex, replayType) { var replay = this.replays_[replayType]; if (replay === undefined) { var constructor = ol.render.webgl.BATCH_CONSTRUCTORS_[replayType]; diff --git a/src/ol/renderer/canvas/canvasimagelayerrenderer.js b/src/ol/renderer/canvas/canvasimagelayerrenderer.js index 9346fbc8f2..4598502dc6 100644 --- a/src/ol/renderer/canvas/canvasimagelayerrenderer.js +++ b/src/ol/renderer/canvas/canvasimagelayerrenderer.js @@ -14,7 +14,6 @@ goog.require('ol.source.ImageVector'); goog.require('ol.vec.Mat4'); - /** * @constructor * @extends {ol.renderer.canvas.Layer} @@ -55,8 +54,7 @@ goog.inherits(ol.renderer.canvas.ImageLayer, ol.renderer.canvas.Layer); /** * @inheritDoc */ -ol.renderer.canvas.ImageLayer.prototype.forEachFeatureAtCoordinate = - function(coordinate, frameState, callback, thisArg) { +ol.renderer.canvas.ImageLayer.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, callback, thisArg) { var layer = this.getLayer(); var source = layer.getSource(); var resolution = frameState.viewState.resolution; @@ -77,8 +75,7 @@ ol.renderer.canvas.ImageLayer.prototype.forEachFeatureAtCoordinate = /** * @inheritDoc */ -ol.renderer.canvas.ImageLayer.prototype.forEachLayerAtPixel = - function(pixel, frameState, callback, thisArg) { +ol.renderer.canvas.ImageLayer.prototype.forEachLayerAtPixel = function(pixel, frameState, callback, thisArg) { if (!this.getImage()) { return undefined; } @@ -144,8 +141,7 @@ ol.renderer.canvas.ImageLayer.prototype.getImageTransform = function() { /** * @inheritDoc */ -ol.renderer.canvas.ImageLayer.prototype.prepareFrame = - function(frameState, layerState) { +ol.renderer.canvas.ImageLayer.prototype.prepareFrame = function(frameState, layerState) { var pixelRatio = frameState.pixelRatio; var viewState = frameState.viewState; diff --git a/src/ol/renderer/canvas/canvaslayerrenderer.js b/src/ol/renderer/canvas/canvaslayerrenderer.js index 749297a6ca..b556e91fff 100644 --- a/src/ol/renderer/canvas/canvaslayerrenderer.js +++ b/src/ol/renderer/canvas/canvaslayerrenderer.js @@ -13,7 +13,6 @@ goog.require('ol.renderer.Layer'); goog.require('ol.vec.Mat4'); - /** * @constructor * @extends {ol.renderer.Layer} @@ -38,8 +37,7 @@ goog.inherits(ol.renderer.canvas.Layer, ol.renderer.Layer); * @param {ol.layer.LayerState} layerState Layer state. * @param {CanvasRenderingContext2D} context Context. */ -ol.renderer.canvas.Layer.prototype.composeFrame = - function(frameState, layerState, context) { +ol.renderer.canvas.Layer.prototype.composeFrame = function(frameState, layerState, context) { this.dispatchPreComposeEvent(context, frameState); @@ -122,8 +120,7 @@ ol.renderer.canvas.Layer.prototype.composeFrame = * @param {goog.vec.Mat4.Number=} opt_transform Transform. * @private */ -ol.renderer.canvas.Layer.prototype.dispatchComposeEvent_ = - function(type, context, frameState, opt_transform) { +ol.renderer.canvas.Layer.prototype.dispatchComposeEvent_ = function(type, context, frameState, opt_transform) { var layer = this.getLayer(); if (layer.hasListener(type)) { var transform = opt_transform !== undefined ? @@ -145,8 +142,7 @@ ol.renderer.canvas.Layer.prototype.dispatchComposeEvent_ = * @param {goog.vec.Mat4.Number=} opt_transform Transform. * @protected */ -ol.renderer.canvas.Layer.prototype.dispatchPostComposeEvent = - function(context, frameState, opt_transform) { +ol.renderer.canvas.Layer.prototype.dispatchPostComposeEvent = function(context, frameState, opt_transform) { this.dispatchComposeEvent_(ol.render.EventType.POSTCOMPOSE, context, frameState, opt_transform); }; @@ -158,8 +154,7 @@ ol.renderer.canvas.Layer.prototype.dispatchPostComposeEvent = * @param {goog.vec.Mat4.Number=} opt_transform Transform. * @protected */ -ol.renderer.canvas.Layer.prototype.dispatchPreComposeEvent = - function(context, frameState, opt_transform) { +ol.renderer.canvas.Layer.prototype.dispatchPreComposeEvent = function(context, frameState, opt_transform) { this.dispatchComposeEvent_(ol.render.EventType.PRECOMPOSE, context, frameState, opt_transform); }; @@ -171,8 +166,7 @@ ol.renderer.canvas.Layer.prototype.dispatchPreComposeEvent = * @param {goog.vec.Mat4.Number=} opt_transform Transform. * @protected */ -ol.renderer.canvas.Layer.prototype.dispatchRenderEvent = - function(context, frameState, opt_transform) { +ol.renderer.canvas.Layer.prototype.dispatchRenderEvent = function(context, frameState, opt_transform) { this.dispatchComposeEvent_(ol.render.EventType.RENDER, context, frameState, opt_transform); }; @@ -196,8 +190,7 @@ ol.renderer.canvas.Layer.prototype.getImageTransform = goog.abstractMethod; * @protected * @return {!goog.vec.Mat4.Number} Transform. */ -ol.renderer.canvas.Layer.prototype.getTransform = - function(frameState, offsetX) { +ol.renderer.canvas.Layer.prototype.getTransform = function(frameState, offsetX) { var viewState = frameState.viewState; var pixelRatio = frameState.pixelRatio; return ol.vec.Mat4.makeTransform2D(this.transform_, @@ -223,11 +216,10 @@ ol.renderer.canvas.Layer.prototype.prepareFrame = goog.abstractMethod; * @param {ol.Pixel} pixelOnMap Pixel. * @param {goog.vec.Mat4.Number} imageTransformInv The transformation matrix * to convert from a map pixel to a canvas pixel. - * @return {ol.Pixel} + * @return {ol.Pixel} The pixel. * @protected */ -ol.renderer.canvas.Layer.prototype.getPixelOnCanvas = - function(pixelOnMap, imageTransformInv) { +ol.renderer.canvas.Layer.prototype.getPixelOnCanvas = function(pixelOnMap, imageTransformInv) { var pixelOnCanvas = [0, 0]; ol.vec.Mat4.multVec2(imageTransformInv, pixelOnMap, pixelOnCanvas); return pixelOnCanvas; diff --git a/src/ol/renderer/canvas/canvasmaprenderer.js b/src/ol/renderer/canvas/canvasmaprenderer.js index 447bb44bd8..88f2ed55b7 100644 --- a/src/ol/renderer/canvas/canvasmaprenderer.js +++ b/src/ol/renderer/canvas/canvasmaprenderer.js @@ -29,7 +29,6 @@ goog.require('ol.source.State'); goog.require('ol.vec.Mat4'); - /** * @constructor * @extends {ol.renderer.Map} @@ -97,8 +96,7 @@ ol.renderer.canvas.Map.prototype.createLayerRenderer = function(layer) { * @param {olx.FrameState} frameState Frame state. * @private */ -ol.renderer.canvas.Map.prototype.dispatchComposeEvent_ = - function(type, frameState) { +ol.renderer.canvas.Map.prototype.dispatchComposeEvent_ = function(type, frameState) { var map = this.getMap(); var context = this.context_; if (map.hasListener(type)) { diff --git a/src/ol/renderer/canvas/canvastilelayerrenderer.js b/src/ol/renderer/canvas/canvastilelayerrenderer.js index 9c0c168e59..5ebb1b17e4 100644 --- a/src/ol/renderer/canvas/canvastilelayerrenderer.js +++ b/src/ol/renderer/canvas/canvastilelayerrenderer.js @@ -17,7 +17,6 @@ goog.require('ol.size'); goog.require('ol.vec.Mat4'); - /** * @constructor * @extends {ol.renderer.canvas.Layer} @@ -122,8 +121,7 @@ ol.renderer.canvas.TileLayer.prototype.getImageTransform = function() { /** * @inheritDoc */ -ol.renderer.canvas.TileLayer.prototype.prepareFrame = - function(frameState, layerState) { +ol.renderer.canvas.TileLayer.prototype.prepareFrame = function(frameState, layerState) { // // Warning! You're entering a dangerous zone! @@ -458,8 +456,7 @@ ol.renderer.canvas.TileLayer.prototype.prepareFrame = /** * @inheritDoc */ -ol.renderer.canvas.TileLayer.prototype.forEachLayerAtPixel = - function(pixel, frameState, callback, thisArg) { +ol.renderer.canvas.TileLayer.prototype.forEachLayerAtPixel = function(pixel, frameState, callback, thisArg) { if (!this.context_) { return undefined; } diff --git a/src/ol/renderer/canvas/canvasvectorlayerrenderer.js b/src/ol/renderer/canvas/canvasvectorlayerrenderer.js index a6b1e4ab2e..424bf867b4 100644 --- a/src/ol/renderer/canvas/canvasvectorlayerrenderer.js +++ b/src/ol/renderer/canvas/canvasvectorlayerrenderer.js @@ -13,7 +13,6 @@ goog.require('ol.renderer.vector'); goog.require('ol.source.Vector'); - /** * @constructor * @extends {ol.renderer.canvas.Layer} @@ -72,8 +71,7 @@ goog.inherits(ol.renderer.canvas.VectorLayer, ol.renderer.canvas.Layer); /** * @inheritDoc */ -ol.renderer.canvas.VectorLayer.prototype.composeFrame = - function(frameState, layerState, context) { +ol.renderer.canvas.VectorLayer.prototype.composeFrame = function(frameState, layerState, context) { var extent = frameState.extent; var pixelRatio = frameState.pixelRatio; @@ -153,8 +151,7 @@ ol.renderer.canvas.VectorLayer.prototype.composeFrame = /** * @inheritDoc */ -ol.renderer.canvas.VectorLayer.prototype.forEachFeatureAtCoordinate = - function(coordinate, frameState, callback, thisArg) { +ol.renderer.canvas.VectorLayer.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, callback, thisArg) { if (!this.replayGroup_) { return undefined; } else { @@ -187,8 +184,7 @@ ol.renderer.canvas.VectorLayer.prototype.forEachFeatureAtCoordinate = * @param {goog.events.Event} event Image style change event. * @private */ -ol.renderer.canvas.VectorLayer.prototype.handleStyleImageChange_ = - function(event) { +ol.renderer.canvas.VectorLayer.prototype.handleStyleImageChange_ = function(event) { this.renderIfReadyAndVisible(); }; @@ -196,8 +192,7 @@ ol.renderer.canvas.VectorLayer.prototype.handleStyleImageChange_ = /** * @inheritDoc */ -ol.renderer.canvas.VectorLayer.prototype.prepareFrame = - function(frameState, layerState) { +ol.renderer.canvas.VectorLayer.prototype.prepareFrame = function(frameState, layerState) { var vectorLayer = /** @type {ol.layer.Vector} */ (this.getLayer()); goog.asserts.assertInstanceof(vectorLayer, ol.layer.Vector, @@ -267,12 +262,11 @@ ol.renderer.canvas.VectorLayer.prototype.prepareFrame = ol.renderer.vector.getTolerance(resolution, pixelRatio), extent, resolution, vectorLayer.getRenderBuffer()); vectorSource.loadFeatures(extent, resolution, projection); - var renderFeature = - /** - * @param {ol.Feature} feature Feature. - * @this {ol.renderer.canvas.VectorLayer} - */ - function(feature) { + /** + * @param {ol.Feature} feature Feature. + * @this {ol.renderer.canvas.VectorLayer} + */ + var renderFeature = function(feature) { var styles; var styleFunction = feature.getStyleFunction(); if (styleFunction) { @@ -325,8 +319,7 @@ ol.renderer.canvas.VectorLayer.prototype.prepareFrame = * @param {ol.render.canvas.ReplayGroup} replayGroup Replay group. * @return {boolean} `true` if an image is loading. */ -ol.renderer.canvas.VectorLayer.prototype.renderFeature = - function(feature, resolution, pixelRatio, styles, replayGroup) { +ol.renderer.canvas.VectorLayer.prototype.renderFeature = function(feature, resolution, pixelRatio, styles, replayGroup) { if (!styles) { return false; } diff --git a/src/ol/renderer/canvas/canvasvectortilelayerrenderer.js b/src/ol/renderer/canvas/canvasvectortilelayerrenderer.js index 21ad759429..66ab25d9f4 100644 --- a/src/ol/renderer/canvas/canvasvectortilelayerrenderer.js +++ b/src/ol/renderer/canvas/canvasvectortilelayerrenderer.js @@ -23,7 +23,6 @@ goog.require('ol.source.VectorTile'); goog.require('ol.vec.Mat4'); - /** * @constructor * @extends {ol.renderer.canvas.Layer} @@ -76,8 +75,7 @@ goog.inherits(ol.renderer.canvas.VectorTileLayer, ol.renderer.canvas.Layer); /** * @inheritDoc */ -ol.renderer.canvas.VectorTileLayer.prototype.composeFrame = - function(frameState, layerState, context) { +ol.renderer.canvas.VectorTileLayer.prototype.composeFrame = function(frameState, layerState, context) { var pixelRatio = frameState.pixelRatio; var skippedFeatureUids = layerState.managed ? @@ -292,8 +290,7 @@ ol.renderer.canvas.VectorTileLayer.prototype.createReplayGroup = function(tile, /** * @inheritDoc */ -ol.renderer.canvas.VectorTileLayer.prototype.forEachFeatureAtCoordinate = - function(coordinate, frameState, callback, thisArg) { +ol.renderer.canvas.VectorTileLayer.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, callback, thisArg) { var pixelRatio = frameState.pixelRatio; var resolution = frameState.viewState.resolution; var rotation = frameState.viewState.rotation; @@ -356,8 +353,7 @@ ol.renderer.canvas.VectorTileLayer.prototype.forEachFeatureAtCoordinate = * @param {goog.events.Event} event Image style change event. * @private */ -ol.renderer.canvas.VectorTileLayer.prototype.handleStyleImageChange_ = - function(event) { +ol.renderer.canvas.VectorTileLayer.prototype.handleStyleImageChange_ = function(event) { this.renderIfReadyAndVisible(); }; @@ -365,8 +361,7 @@ ol.renderer.canvas.VectorTileLayer.prototype.handleStyleImageChange_ = /** * @inheritDoc */ -ol.renderer.canvas.VectorTileLayer.prototype.prepareFrame = - function(frameState, layerState) { +ol.renderer.canvas.VectorTileLayer.prototype.prepareFrame = function(frameState, layerState) { var layer = /** @type {ol.layer.Vector} */ (this.getLayer()); goog.asserts.assertInstanceof(layer, ol.layer.VectorTile, 'layer is an instance of ol.layer.VectorTile'); @@ -488,8 +483,7 @@ ol.renderer.canvas.VectorTileLayer.prototype.prepareFrame = * @param {ol.render.canvas.ReplayGroup} replayGroup Replay group. * @return {boolean} `true` if an image is loading. */ -ol.renderer.canvas.VectorTileLayer.prototype.renderFeature = - function(feature, squaredTolerance, styles, replayGroup) { +ol.renderer.canvas.VectorTileLayer.prototype.renderFeature = function(feature, squaredTolerance, styles, replayGroup) { if (!styles) { return false; } diff --git a/src/ol/renderer/dom/domimagelayerrenderer.js b/src/ol/renderer/dom/domimagelayerrenderer.js index e0e85fc0c0..63850f6670 100644 --- a/src/ol/renderer/dom/domimagelayerrenderer.js +++ b/src/ol/renderer/dom/domimagelayerrenderer.js @@ -13,7 +13,6 @@ goog.require('ol.renderer.dom.Layer'); goog.require('ol.vec.Mat4'); - /** * @constructor * @extends {ol.renderer.dom.Layer} @@ -45,8 +44,7 @@ goog.inherits(ol.renderer.dom.ImageLayer, ol.renderer.dom.Layer); /** * @inheritDoc */ -ol.renderer.dom.ImageLayer.prototype.forEachFeatureAtCoordinate = - function(coordinate, frameState, callback, thisArg) { +ol.renderer.dom.ImageLayer.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, callback, thisArg) { var layer = this.getLayer(); var source = layer.getSource(); var resolution = frameState.viewState.resolution; @@ -76,8 +74,7 @@ ol.renderer.dom.ImageLayer.prototype.clearFrame = function() { /** * @inheritDoc */ -ol.renderer.dom.ImageLayer.prototype.prepareFrame = - function(frameState, layerState) { +ol.renderer.dom.ImageLayer.prototype.prepareFrame = function(frameState, layerState) { var viewState = frameState.viewState; var viewCenter = viewState.center; diff --git a/src/ol/renderer/dom/domlayerrenderer.js b/src/ol/renderer/dom/domlayerrenderer.js index f269acd53c..785a038bc2 100644 --- a/src/ol/renderer/dom/domlayerrenderer.js +++ b/src/ol/renderer/dom/domlayerrenderer.js @@ -5,7 +5,6 @@ goog.require('ol.layer.Layer'); goog.require('ol.renderer.Layer'); - /** * @constructor * @extends {ol.renderer.Layer} diff --git a/src/ol/renderer/dom/dommaprenderer.js b/src/ol/renderer/dom/dommaprenderer.js index c36d876e1e..1f701ee79c 100644 --- a/src/ol/renderer/dom/dommaprenderer.js +++ b/src/ol/renderer/dom/dommaprenderer.js @@ -28,7 +28,6 @@ goog.require('ol.source.State'); goog.require('ol.vec.Mat4'); - /** * @constructor * @extends {ol.renderer.Map} @@ -117,8 +116,7 @@ ol.renderer.dom.Map.prototype.createLayerRenderer = function(layer) { * @param {olx.FrameState} frameState Frame state. * @private */ -ol.renderer.dom.Map.prototype.dispatchComposeEvent_ = - function(type, frameState) { +ol.renderer.dom.Map.prototype.dispatchComposeEvent_ = function(type, frameState) { var map = this.getMap(); if (map.hasListener(type)) { var extent = frameState.extent; diff --git a/src/ol/renderer/dom/domtilelayerrenderer.js b/src/ol/renderer/dom/domtilelayerrenderer.js index 1ed26c5bab..3b61b771b3 100644 --- a/src/ol/renderer/dom/domtilelayerrenderer.js +++ b/src/ol/renderer/dom/domtilelayerrenderer.js @@ -23,7 +23,6 @@ goog.require('ol.tilegrid.TileGrid'); goog.require('ol.vec.Mat4'); - /** * @constructor * @extends {ol.renderer.dom.Layer} @@ -76,8 +75,7 @@ ol.renderer.dom.TileLayer.prototype.clearFrame = function() { /** * @inheritDoc */ -ol.renderer.dom.TileLayer.prototype.prepareFrame = - function(frameState, layerState) { +ol.renderer.dom.TileLayer.prototype.prepareFrame = function(frameState, layerState) { if (!layerState.visible) { if (this.renderedVisible_) { @@ -264,7 +262,6 @@ ol.renderer.dom.TileLayer.prototype.prepareFrame = }; - /** * @constructor * @private @@ -420,8 +417,7 @@ ol.renderer.dom.TileLayerZ_.prototype.getResolution = function() { * @param {ol.Extent} extent Extent. * @param {ol.TileRange=} opt_tileRange Temporary ol.TileRange object. */ -ol.renderer.dom.TileLayerZ_.prototype.removeTilesOutsideExtent = - function(extent, opt_tileRange) { +ol.renderer.dom.TileLayerZ_.prototype.removeTilesOutsideExtent = function(extent, opt_tileRange) { var tileRange = this.tileGrid_.getTileRangeForExtentAndZ( extent, this.tileCoordOrigin_[0], opt_tileRange); /** @type {Array.} */ diff --git a/src/ol/renderer/dom/domvectorlayerrenderer.js b/src/ol/renderer/dom/domvectorlayerrenderer.js index 2352bcd516..2691550b1b 100644 --- a/src/ol/renderer/dom/domvectorlayerrenderer.js +++ b/src/ol/renderer/dom/domvectorlayerrenderer.js @@ -16,7 +16,6 @@ goog.require('ol.renderer.vector'); goog.require('ol.vec.Mat4'); - /** * @constructor * @extends {ol.renderer.dom.Layer} @@ -94,8 +93,7 @@ goog.inherits(ol.renderer.dom.VectorLayer, ol.renderer.dom.Layer); /** * @inheritDoc */ -ol.renderer.dom.VectorLayer.prototype.composeFrame = - function(frameState, layerState) { +ol.renderer.dom.VectorLayer.prototype.composeFrame = function(frameState, layerState) { var vectorLayer = /** @type {ol.layer.Vector} */ (this.getLayer()); goog.asserts.assertInstanceof(vectorLayer, ol.layer.Vector, @@ -156,8 +154,7 @@ ol.renderer.dom.VectorLayer.prototype.composeFrame = * @param {goog.vec.Mat4.Number} transform Transform. * @private */ -ol.renderer.dom.VectorLayer.prototype.dispatchEvent_ = - function(type, frameState, transform) { +ol.renderer.dom.VectorLayer.prototype.dispatchEvent_ = function(type, frameState, transform) { var context = this.context_; var layer = this.getLayer(); if (layer.hasListener(type)) { @@ -175,8 +172,7 @@ ol.renderer.dom.VectorLayer.prototype.dispatchEvent_ = /** * @inheritDoc */ -ol.renderer.dom.VectorLayer.prototype.forEachFeatureAtCoordinate = - function(coordinate, frameState, callback, thisArg) { +ol.renderer.dom.VectorLayer.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, callback, thisArg) { if (!this.replayGroup_) { return undefined; } else { @@ -209,8 +205,7 @@ ol.renderer.dom.VectorLayer.prototype.forEachFeatureAtCoordinate = * @param {goog.events.Event} event Image style change event. * @private */ -ol.renderer.dom.VectorLayer.prototype.handleStyleImageChange_ = - function(event) { +ol.renderer.dom.VectorLayer.prototype.handleStyleImageChange_ = function(event) { this.renderIfReadyAndVisible(); }; @@ -218,8 +213,7 @@ ol.renderer.dom.VectorLayer.prototype.handleStyleImageChange_ = /** * @inheritDoc */ -ol.renderer.dom.VectorLayer.prototype.prepareFrame = - function(frameState, layerState) { +ol.renderer.dom.VectorLayer.prototype.prepareFrame = function(frameState, layerState) { var vectorLayer = /** @type {ol.layer.Vector} */ (this.getLayer()); goog.asserts.assertInstanceof(vectorLayer, ol.layer.Vector, @@ -275,12 +269,11 @@ ol.renderer.dom.VectorLayer.prototype.prepareFrame = ol.renderer.vector.getTolerance(resolution, pixelRatio), extent, resolution, vectorLayer.getRenderBuffer()); vectorSource.loadFeatures(extent, resolution, projection); - var renderFeature = - /** - * @param {ol.Feature} feature Feature. - * @this {ol.renderer.dom.VectorLayer} - */ - function(feature) { + /** + * @param {ol.Feature} feature Feature. + * @this {ol.renderer.dom.VectorLayer} + */ + var renderFeature = function(feature) { var styles; var styleFunction = feature.getStyleFunction(); if (styleFunction) { @@ -333,8 +326,7 @@ ol.renderer.dom.VectorLayer.prototype.prepareFrame = * @param {ol.render.canvas.ReplayGroup} replayGroup Replay group. * @return {boolean} `true` if an image is loading. */ -ol.renderer.dom.VectorLayer.prototype.renderFeature = - function(feature, resolution, pixelRatio, styles, replayGroup) { +ol.renderer.dom.VectorLayer.prototype.renderFeature = function(feature, resolution, pixelRatio, styles, replayGroup) { if (!styles) { return false; } diff --git a/src/ol/renderer/layerrenderer.js b/src/ol/renderer/layerrenderer.js index 6518480db4..b094289591 100644 --- a/src/ol/renderer/layerrenderer.js +++ b/src/ol/renderer/layerrenderer.js @@ -16,7 +16,6 @@ goog.require('ol.source.Tile'); goog.require('ol.vec.Mat4'); - /** * @constructor * @extends {ol.Observable} @@ -58,8 +57,7 @@ ol.renderer.Layer.prototype.forEachFeatureAtCoordinate = ol.nullFunction; * @return {T|undefined} Callback result. * @template S,T */ -ol.renderer.Layer.prototype.forEachLayerAtPixel = - function(pixel, frameState, callback, thisArg) { +ol.renderer.Layer.prototype.forEachLayerAtPixel = function(pixel, frameState, callback, thisArg) { var coordinate = pixel.slice(); ol.vec.Mat4.multVec2( frameState.pixelToCoordinateMatrix, coordinate, coordinate); @@ -94,8 +92,7 @@ ol.renderer.Layer.prototype.hasFeatureAtCoordinate = goog.functions.FALSE; * lookup. * @protected */ -ol.renderer.Layer.prototype.createLoadedTileFinder = - function(source, projection, tiles) { +ol.renderer.Layer.prototype.createLoadedTileFinder = function(source, projection, tiles) { return ( /** * @param {number} zoom Zoom level. @@ -103,13 +100,13 @@ ol.renderer.Layer.prototype.createLoadedTileFinder = * @return {boolean} The tile range is fully loaded. */ function(zoom, tileRange) { - return source.forEachLoadedTile(projection, zoom, - tileRange, function(tile) { - if (!tiles[zoom]) { - tiles[zoom] = {}; - } - tiles[zoom][tile.tileCoord.toString()] = tile; - }); + function callback(tile) { + if (!tiles[zoom]) { + tiles[zoom] = {}; + } + tiles[zoom][tile.tileCoord.toString()] = tile; + } + return source.forEachLoadedTile(projection, zoom, tileRange, callback); }); }; @@ -182,8 +179,7 @@ ol.renderer.Layer.prototype.renderIfReadyAndVisible = function() { * @param {ol.source.Tile} tileSource Tile source. * @protected */ -ol.renderer.Layer.prototype.scheduleExpireCache = - function(frameState, tileSource) { +ol.renderer.Layer.prototype.scheduleExpireCache = function(frameState, tileSource) { if (tileSource.canExpireCache()) { frameState.postRenderFunctions.push( goog.partial( @@ -207,8 +203,7 @@ ol.renderer.Layer.prototype.scheduleExpireCache = * @param {Array.} attributions Attributions (source). * @protected */ -ol.renderer.Layer.prototype.updateAttributions = - function(attributionsSet, attributions) { +ol.renderer.Layer.prototype.updateAttributions = function(attributionsSet, attributions) { if (attributions) { var attribution, i, ii; for (i = 0, ii = attributions.length; i < ii; ++i) { @@ -245,8 +240,7 @@ ol.renderer.Layer.prototype.updateLogos = function(frameState, source) { * @param {ol.TileRange} tileRange Tile range. * @protected */ -ol.renderer.Layer.prototype.updateUsedTiles = - function(usedTiles, tileSource, z, tileRange) { +ol.renderer.Layer.prototype.updateUsedTiles = function(usedTiles, tileSource, z, tileRange) { // FIXME should we use tilesToDrawByZ instead? var tileSourceKey = goog.getUid(tileSource).toString(); var zKey = z.toString(); @@ -270,8 +264,7 @@ ol.renderer.Layer.prototype.updateUsedTiles = * @protected * @return {ol.Coordinate} Snapped center. */ -ol.renderer.Layer.prototype.snapCenterToPixel = - function(center, resolution, size) { +ol.renderer.Layer.prototype.snapCenterToPixel = function(center, resolution, size) { return [ resolution * (Math.round(center[0] / resolution) + (size[0] % 2) / 2), resolution * (Math.round(center[1] / resolution) + (size[1] % 2) / 2) diff --git a/src/ol/renderer/maprenderer.js b/src/ol/renderer/maprenderer.js index 68efff4bb2..68d1253087 100644 --- a/src/ol/renderer/maprenderer.js +++ b/src/ol/renderer/maprenderer.js @@ -29,7 +29,6 @@ ol.RendererType = { }; - /** * @constructor * @extends {goog.Disposable} @@ -125,8 +124,7 @@ ol.renderer.Map.expireIconCache_ = function(map, frameState) { * @return {T|undefined} Callback result. * @template S,T,U */ -ol.renderer.Map.prototype.forEachFeatureAtCoordinate = - function(coordinate, frameState, callback, thisArg, +ol.renderer.Map.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, callback, thisArg, layerFilter, thisArg2) { var result; var viewState = frameState.viewState; @@ -200,8 +198,7 @@ ol.renderer.Map.prototype.forEachFeatureAtCoordinate = * @return {T|undefined} Callback result. * @template S,T,U */ -ol.renderer.Map.prototype.forEachLayerAtPixel = - function(pixel, frameState, callback, thisArg, +ol.renderer.Map.prototype.forEachLayerAtPixel = function(pixel, frameState, callback, thisArg, layerFilter, thisArg2) { var result; var viewState = frameState.viewState; @@ -238,8 +235,7 @@ ol.renderer.Map.prototype.forEachLayerAtPixel = * @return {boolean} Is there a feature at the given coordinate? * @template U */ -ol.renderer.Map.prototype.hasFeatureAtCoordinate = - function(coordinate, frameState, layerFilter, thisArg) { +ol.renderer.Map.prototype.hasFeatureAtCoordinate = function(coordinate, frameState, layerFilter, thisArg) { var hasFeature = this.forEachFeatureAtCoordinate( coordinate, frameState, goog.functions.TRUE, this, layerFilter, thisArg); @@ -344,8 +340,7 @@ ol.renderer.Map.prototype.renderFrame = ol.nullFunction; * @param {olx.FrameState} frameState Frame state. * @private */ -ol.renderer.Map.prototype.removeUnusedLayerRenderers_ = - function(map, frameState) { +ol.renderer.Map.prototype.removeUnusedLayerRenderers_ = function(map, frameState) { var layerKey; for (layerKey in this.layerRenderers_) { if (!frameState || !(layerKey in frameState.layerStates)) { @@ -368,8 +363,7 @@ ol.renderer.Map.prototype.scheduleExpireIconCache = function(frameState) { * @param {!olx.FrameState} frameState Frame state. * @protected */ -ol.renderer.Map.prototype.scheduleRemoveUnusedLayerRenderers = - function(frameState) { +ol.renderer.Map.prototype.scheduleRemoveUnusedLayerRenderers = function(frameState) { var layerKey; for (layerKey in this.layerRenderers_) { if (!(layerKey in frameState.layerStates)) { @@ -382,9 +376,9 @@ ol.renderer.Map.prototype.scheduleRemoveUnusedLayerRenderers = /** - * @param {ol.layer.LayerState} state1 - * @param {ol.layer.LayerState} state2 - * @return {number} + * @param {ol.layer.LayerState} state1 First layer state. + * @param {ol.layer.LayerState} state2 Second layer state. + * @return {number} The zIndex difference. */ ol.renderer.Map.sortByZIndex = function(state1, state2) { return state1.zIndex - state2.zIndex; diff --git a/src/ol/renderer/webgl/webglimagelayerrenderer.js b/src/ol/renderer/webgl/webglimagelayerrenderer.js index dc8d7cc51d..2cb88aa377 100644 --- a/src/ol/renderer/webgl/webglimagelayerrenderer.js +++ b/src/ol/renderer/webgl/webglimagelayerrenderer.js @@ -18,7 +18,6 @@ goog.require('ol.vec.Mat4'); goog.require('ol.webgl.Context'); - /** * @constructor * @extends {ol.renderer.webgl.Layer} @@ -74,8 +73,7 @@ ol.renderer.webgl.ImageLayer.prototype.createTexture_ = function(image) { /** * @inheritDoc */ -ol.renderer.webgl.ImageLayer.prototype.forEachFeatureAtCoordinate = - function(coordinate, frameState, callback, thisArg) { +ol.renderer.webgl.ImageLayer.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, callback, thisArg) { var layer = this.getLayer(); var source = layer.getSource(); var resolution = frameState.viewState.resolution; @@ -97,8 +95,7 @@ ol.renderer.webgl.ImageLayer.prototype.forEachFeatureAtCoordinate = /** * @inheritDoc */ -ol.renderer.webgl.ImageLayer.prototype.prepareFrame = - function(frameState, layerState, context) { +ol.renderer.webgl.ImageLayer.prototype.prepareFrame = function(frameState, layerState, context) { var gl = this.mapRenderer.getGL(); @@ -194,8 +191,7 @@ ol.renderer.webgl.ImageLayer.prototype.prepareFrame = * @param {ol.Extent} imageExtent Image extent. * @private */ -ol.renderer.webgl.ImageLayer.prototype.updateProjectionMatrix_ = - function(canvasWidth, canvasHeight, pixelRatio, +ol.renderer.webgl.ImageLayer.prototype.updateProjectionMatrix_ = function(canvasWidth, canvasHeight, pixelRatio, viewCenter, viewResolution, viewRotation, imageExtent) { var canvasExtentWidth = canvasWidth * viewResolution; @@ -223,8 +219,7 @@ ol.renderer.webgl.ImageLayer.prototype.updateProjectionMatrix_ = /** * @inheritDoc */ -ol.renderer.webgl.ImageLayer.prototype.hasFeatureAtCoordinate = - function(coordinate, frameState) { +ol.renderer.webgl.ImageLayer.prototype.hasFeatureAtCoordinate = function(coordinate, frameState) { var hasFeature = this.forEachFeatureAtCoordinate( coordinate, frameState, goog.functions.TRUE, this); return hasFeature !== undefined; @@ -234,8 +229,7 @@ ol.renderer.webgl.ImageLayer.prototype.hasFeatureAtCoordinate = /** * @inheritDoc */ -ol.renderer.webgl.ImageLayer.prototype.forEachLayerAtPixel = - function(pixel, frameState, callback, thisArg) { +ol.renderer.webgl.ImageLayer.prototype.forEachLayerAtPixel = function(pixel, frameState, callback, thisArg) { if (!this.image_ || !this.image_.getImage()) { return undefined; } @@ -294,13 +288,12 @@ ol.renderer.webgl.ImageLayer.prototype.forEachLayerAtPixel = /** * The transformation matrix to get the pixel on the image for a * pixel on the map. - * @param {ol.Size} mapSize - * @param {ol.Size} imageSize - * @return {goog.vec.Mat4.Number} + * @param {ol.Size} mapSize The map size. + * @param {ol.Size} imageSize The image size. + * @return {goog.vec.Mat4.Number} The transformation matrix. * @private */ -ol.renderer.webgl.ImageLayer.prototype.getHitTransformationMatrix_ = - function(mapSize, imageSize) { +ol.renderer.webgl.ImageLayer.prototype.getHitTransformationMatrix_ = function(mapSize, imageSize) { // the first matrix takes a map pixel, flips the y-axis and scales to // a range between -1 ... 1 var mapCoordMatrix = goog.vec.Mat4.createNumber(); diff --git a/src/ol/renderer/webgl/webgllayerrenderer.js b/src/ol/renderer/webgl/webgllayerrenderer.js index d03e23edfe..dea5090c92 100644 --- a/src/ol/renderer/webgl/webgllayerrenderer.js +++ b/src/ol/renderer/webgl/webgllayerrenderer.js @@ -15,7 +15,6 @@ goog.require('ol.webgl.Buffer'); goog.require('ol.webgl.Context'); - /** * @constructor * @extends {ol.renderer.Layer} @@ -88,8 +87,7 @@ goog.inherits(ol.renderer.webgl.Layer, ol.renderer.Layer); * @param {number} framebufferDimension Framebuffer dimension. * @protected */ -ol.renderer.webgl.Layer.prototype.bindFramebuffer = - function(frameState, framebufferDimension) { +ol.renderer.webgl.Layer.prototype.bindFramebuffer = function(frameState, framebufferDimension) { var gl = this.mapRenderer.getGL(); @@ -134,8 +132,7 @@ ol.renderer.webgl.Layer.prototype.bindFramebuffer = * @param {ol.layer.LayerState} layerState Layer state. * @param {ol.webgl.Context} context Context. */ -ol.renderer.webgl.Layer.prototype.composeFrame = - function(frameState, layerState, context) { +ol.renderer.webgl.Layer.prototype.composeFrame = function(frameState, layerState, context) { this.dispatchComposeEvent_( ol.render.EventType.PRECOMPOSE, context, frameState); @@ -189,8 +186,7 @@ ol.renderer.webgl.Layer.prototype.composeFrame = * @param {olx.FrameState} frameState Frame state. * @private */ -ol.renderer.webgl.Layer.prototype.dispatchComposeEvent_ = - function(type, context, frameState) { +ol.renderer.webgl.Layer.prototype.dispatchComposeEvent_ = function(type, context, frameState) { var layer = this.getLayer(); if (layer.hasListener(type)) { var viewState = frameState.viewState; diff --git a/src/ol/renderer/webgl/webglmapdefaultshader.js b/src/ol/renderer/webgl/webglmapdefaultshader.js index 926e305c12..1e5baea022 100644 --- a/src/ol/renderer/webgl/webglmapdefaultshader.js +++ b/src/ol/renderer/webgl/webglmapdefaultshader.js @@ -7,7 +7,6 @@ goog.provide('ol.renderer.webgl.map.shader.DefaultVertex'); goog.require('ol.webgl.shader'); - /** * @constructor * @extends {ol.webgl.shader.Fragment} @@ -43,7 +42,6 @@ ol.renderer.webgl.map.shader.DefaultFragment.SOURCE = goog.DEBUG ? ol.renderer.webgl.map.shader.DefaultFragment.OPTIMIZED_SOURCE; - /** * @constructor * @extends {ol.webgl.shader.Vertex} @@ -79,7 +77,6 @@ ol.renderer.webgl.map.shader.DefaultVertex.SOURCE = goog.DEBUG ? ol.renderer.webgl.map.shader.DefaultVertex.OPTIMIZED_SOURCE; - /** * @constructor * @param {WebGLRenderingContext} gl GL. diff --git a/src/ol/renderer/webgl/webglmaprenderer.js b/src/ol/renderer/webgl/webglmaprenderer.js index 7ee45244cf..f1ef14ec8d 100644 --- a/src/ol/renderer/webgl/webglmaprenderer.js +++ b/src/ol/renderer/webgl/webglmaprenderer.js @@ -42,7 +42,6 @@ goog.require('ol.webgl.WebGLContextEventType'); ol.renderer.webgl.TextureCacheEntry; - /** * @constructor * @extends {ol.renderer.Map} @@ -187,8 +186,7 @@ goog.inherits(ol.renderer.webgl.Map, ol.renderer.Map); * @param {number} magFilter Mag filter. * @param {number} minFilter Min filter. */ -ol.renderer.webgl.Map.prototype.bindTileTexture = - function(tile, tileSize, tileGutter, magFilter, minFilter) { +ol.renderer.webgl.Map.prototype.bindTileTexture = function(tile, tileSize, tileGutter, magFilter, minFilter) { var gl = this.getGL(); var tileKey = tile.getKey(); if (this.textureCache_.containsKey(tileKey)) { @@ -270,8 +268,7 @@ ol.renderer.webgl.Map.prototype.createLayerRenderer = function(layer) { * @param {olx.FrameState} frameState Frame state. * @private */ -ol.renderer.webgl.Map.prototype.dispatchComposeEvent_ = - function(type, frameState) { +ol.renderer.webgl.Map.prototype.dispatchComposeEvent_ = function(type, frameState) { var map = this.getMap(); if (map.hasListener(type)) { var context = this.context_; @@ -344,7 +341,7 @@ ol.renderer.webgl.Map.prototype.expireCache_ = function(map, frameState) { /** - * @return {ol.webgl.Context} + * @return {ol.webgl.Context} The context. */ ol.renderer.webgl.Map.prototype.getContext = function() { return this.context_; @@ -536,8 +533,7 @@ ol.renderer.webgl.Map.prototype.renderFrame = function(frameState) { /** * @inheritDoc */ -ol.renderer.webgl.Map.prototype.forEachFeatureAtCoordinate = - function(coordinate, frameState, callback, thisArg, +ol.renderer.webgl.Map.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, callback, thisArg, layerFilter, thisArg2) { var result; @@ -570,8 +566,7 @@ ol.renderer.webgl.Map.prototype.forEachFeatureAtCoordinate = /** * @inheritDoc */ -ol.renderer.webgl.Map.prototype.hasFeatureAtCoordinate = - function(coordinate, frameState, layerFilter, thisArg) { +ol.renderer.webgl.Map.prototype.hasFeatureAtCoordinate = function(coordinate, frameState, layerFilter, thisArg) { var hasFeature = false; if (this.getGL().isContextLost()) { @@ -603,8 +598,7 @@ ol.renderer.webgl.Map.prototype.hasFeatureAtCoordinate = /** * @inheritDoc */ -ol.renderer.webgl.Map.prototype.forEachLayerAtPixel = - function(pixel, frameState, callback, thisArg, +ol.renderer.webgl.Map.prototype.forEachLayerAtPixel = function(pixel, frameState, callback, thisArg, layerFilter, thisArg2) { if (this.getGL().isContextLost()) { return false; diff --git a/src/ol/renderer/webgl/webgltilelayerrenderer.js b/src/ol/renderer/webgl/webgltilelayerrenderer.js index 0eb9a11b48..5848b7130a 100644 --- a/src/ol/renderer/webgl/webgltilelayerrenderer.js +++ b/src/ol/renderer/webgl/webgltilelayerrenderer.js @@ -22,7 +22,6 @@ goog.require('ol.vec.Mat4'); goog.require('ol.webgl.Buffer'); - /** * @constructor * @extends {ol.renderer.webgl.Layer} @@ -112,8 +111,7 @@ ol.renderer.webgl.TileLayer.prototype.disposeInternal = function() { * lookup. * @protected */ -ol.renderer.webgl.TileLayer.prototype.createLoadedTileFinder = - function(source, projection, tiles) { +ol.renderer.webgl.TileLayer.prototype.createLoadedTileFinder = function(source, projection, tiles) { var mapRenderer = this.mapRenderer; return ( @@ -123,17 +121,17 @@ ol.renderer.webgl.TileLayer.prototype.createLoadedTileFinder = * @return {boolean} The tile range is fully loaded. */ function(zoom, tileRange) { - return source.forEachLoadedTile(projection, zoom, - tileRange, function(tile) { - var loaded = mapRenderer.isTileTextureLoaded(tile); - if (loaded) { - if (!tiles[zoom]) { - tiles[zoom] = {}; - } - tiles[zoom][tile.tileCoord.toString()] = tile; - } - return loaded; - }); + function callback(tile) { + var loaded = mapRenderer.isTileTextureLoaded(tile); + if (loaded) { + if (!tiles[zoom]) { + tiles[zoom] = {}; + } + tiles[zoom][tile.tileCoord.toString()] = tile; + } + return loaded; + } + return source.forEachLoadedTile(projection, zoom, tileRange, callback); }); }; @@ -150,8 +148,7 @@ ol.renderer.webgl.TileLayer.prototype.handleWebGLContextLost = function() { /** * @inheritDoc */ -ol.renderer.webgl.TileLayer.prototype.prepareFrame = - function(frameState, layerState, context) { +ol.renderer.webgl.TileLayer.prototype.prepareFrame = function(frameState, layerState, context) { var mapRenderer = this.mapRenderer; var gl = context.getGL(); @@ -385,8 +382,7 @@ ol.renderer.webgl.TileLayer.prototype.prepareFrame = /** * @inheritDoc */ -ol.renderer.webgl.TileLayer.prototype.forEachLayerAtPixel = - function(pixel, frameState, callback, thisArg) { +ol.renderer.webgl.TileLayer.prototype.forEachLayerAtPixel = function(pixel, frameState, callback, thisArg) { if (!this.framebuffer) { return undefined; } diff --git a/src/ol/renderer/webgl/webgltilelayershader.js b/src/ol/renderer/webgl/webgltilelayershader.js index 88396eaf71..0369aa35ec 100644 --- a/src/ol/renderer/webgl/webgltilelayershader.js +++ b/src/ol/renderer/webgl/webgltilelayershader.js @@ -7,7 +7,6 @@ goog.provide('ol.renderer.webgl.tilelayer.shader.Vertex'); goog.require('ol.webgl.shader'); - /** * @constructor * @extends {ol.webgl.shader.Fragment} @@ -43,7 +42,6 @@ ol.renderer.webgl.tilelayer.shader.Fragment.SOURCE = goog.DEBUG ? ol.renderer.webgl.tilelayer.shader.Fragment.OPTIMIZED_SOURCE; - /** * @constructor * @extends {ol.webgl.shader.Vertex} @@ -79,7 +77,6 @@ ol.renderer.webgl.tilelayer.shader.Vertex.SOURCE = goog.DEBUG ? ol.renderer.webgl.tilelayer.shader.Vertex.OPTIMIZED_SOURCE; - /** * @constructor * @param {WebGLRenderingContext} gl GL. diff --git a/src/ol/renderer/webgl/webglvectorlayerrenderer.js b/src/ol/renderer/webgl/webglvectorlayerrenderer.js index e09a283472..3745c03df7 100644 --- a/src/ol/renderer/webgl/webglvectorlayerrenderer.js +++ b/src/ol/renderer/webgl/webglvectorlayerrenderer.js @@ -11,7 +11,6 @@ goog.require('ol.renderer.webgl.Layer'); goog.require('ol.vec.Mat4'); - /** * @constructor * @extends {ol.renderer.webgl.Layer} @@ -72,8 +71,7 @@ goog.inherits(ol.renderer.webgl.VectorLayer, ol.renderer.webgl.Layer); /** * @inheritDoc */ -ol.renderer.webgl.VectorLayer.prototype.composeFrame = - function(frameState, layerState, context) { +ol.renderer.webgl.VectorLayer.prototype.composeFrame = function(frameState, layerState, context) { this.layerState_ = layerState; var viewState = frameState.viewState; var replayGroup = this.replayGroup_; @@ -104,8 +102,7 @@ ol.renderer.webgl.VectorLayer.prototype.disposeInternal = function() { /** * @inheritDoc */ -ol.renderer.webgl.VectorLayer.prototype.forEachFeatureAtCoordinate = - function(coordinate, frameState, callback, thisArg) { +ol.renderer.webgl.VectorLayer.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, callback, thisArg) { if (!this.replayGroup_ || !this.layerState_) { return undefined; } else { @@ -138,8 +135,7 @@ ol.renderer.webgl.VectorLayer.prototype.forEachFeatureAtCoordinate = /** * @inheritDoc */ -ol.renderer.webgl.VectorLayer.prototype.hasFeatureAtCoordinate = - function(coordinate, frameState) { +ol.renderer.webgl.VectorLayer.prototype.hasFeatureAtCoordinate = function(coordinate, frameState) { if (!this.replayGroup_ || !this.layerState_) { return false; } else { @@ -157,8 +153,7 @@ ol.renderer.webgl.VectorLayer.prototype.hasFeatureAtCoordinate = /** * @inheritDoc */ -ol.renderer.webgl.VectorLayer.prototype.forEachLayerAtPixel = - function(pixel, frameState, callback, thisArg) { +ol.renderer.webgl.VectorLayer.prototype.forEachLayerAtPixel = function(pixel, frameState, callback, thisArg) { var coordinate = pixel.slice(); ol.vec.Mat4.multVec2( frameState.pixelToCoordinateMatrix, coordinate, coordinate); @@ -177,8 +172,7 @@ ol.renderer.webgl.VectorLayer.prototype.forEachLayerAtPixel = * @param {goog.events.Event} event Image style change event. * @private */ -ol.renderer.webgl.VectorLayer.prototype.handleStyleImageChange_ = - function(event) { +ol.renderer.webgl.VectorLayer.prototype.handleStyleImageChange_ = function(event) { this.renderIfReadyAndVisible(); }; @@ -186,8 +180,7 @@ ol.renderer.webgl.VectorLayer.prototype.handleStyleImageChange_ = /** * @inheritDoc */ -ol.renderer.webgl.VectorLayer.prototype.prepareFrame = - function(frameState, layerState, context) { +ol.renderer.webgl.VectorLayer.prototype.prepareFrame = function(frameState, layerState, context) { var vectorLayer = /** @type {ol.layer.Vector} */ (this.getLayer()); goog.asserts.assertInstanceof(vectorLayer, ol.layer.Vector, @@ -243,12 +236,11 @@ ol.renderer.webgl.VectorLayer.prototype.prepareFrame = ol.renderer.vector.getTolerance(resolution, pixelRatio), extent, vectorLayer.getRenderBuffer()); vectorSource.loadFeatures(extent, resolution, projection); - var renderFeature = - /** - * @param {ol.Feature} feature Feature. - * @this {ol.renderer.webgl.VectorLayer} - */ - function(feature) { + /** + * @param {ol.Feature} feature Feature. + * @this {ol.renderer.webgl.VectorLayer} + */ + var renderFeature = function(feature) { var styles; var styleFunction = feature.getStyleFunction(); if (styleFunction) { @@ -301,8 +293,7 @@ ol.renderer.webgl.VectorLayer.prototype.prepareFrame = * @param {ol.render.webgl.ReplayGroup} replayGroup Replay group. * @return {boolean} `true` if an image is loading. */ -ol.renderer.webgl.VectorLayer.prototype.renderFeature = - function(feature, resolution, pixelRatio, styles, replayGroup) { +ol.renderer.webgl.VectorLayer.prototype.renderFeature = function(feature, resolution, pixelRatio, styles, replayGroup) { if (!styles) { return false; } diff --git a/src/ol/reproj/image.js b/src/ol/reproj/image.js index 0292d7168e..33e7b83534 100644 --- a/src/ol/reproj/image.js +++ b/src/ol/reproj/image.js @@ -18,7 +18,6 @@ goog.require('ol.reproj.Triangulation'); ol.reproj.ImageFunctionType; - /** * @classdesc * Class encapsulating single reprojected image. diff --git a/src/ol/reproj/tile.js b/src/ol/reproj/tile.js index a698dbb8c5..155007bc39 100644 --- a/src/ol/reproj/tile.js +++ b/src/ol/reproj/tile.js @@ -21,7 +21,6 @@ goog.require('ol.reproj.Triangulation'); ol.reproj.TileFunctionType; - /** * @classdesc * Class encapsulating single reprojected tile. diff --git a/src/ol/reproj/triangulation.js b/src/ol/reproj/triangulation.js index 571c676c6a..9c60063ded 100644 --- a/src/ol/reproj/triangulation.js +++ b/src/ol/reproj/triangulation.js @@ -15,7 +15,6 @@ goog.require('ol.proj'); ol.reproj.Triangle; - /** * @classdesc * Class containing triangulation of the given target extent. @@ -48,8 +47,8 @@ ol.reproj.Triangulation = function(sourceProj, targetProj, targetExtent, var transformInv = ol.proj.getTransform(this.targetProj_, this.sourceProj_); /** - * @param {ol.Coordinate} c - * @return {ol.Coordinate} + * @param {ol.Coordinate} c A coordinate. + * @return {ol.Coordinate} Transformed coordinate. * @private */ this.transformInv_ = function(c) { @@ -173,12 +172,12 @@ ol.reproj.Triangulation = function(sourceProj, targetProj, targetExtent, /** * Adds triangle to the triangulation. - * @param {ol.Coordinate} a - * @param {ol.Coordinate} b - * @param {ol.Coordinate} c - * @param {ol.Coordinate} aSrc - * @param {ol.Coordinate} bSrc - * @param {ol.Coordinate} cSrc + * @param {ol.Coordinate} a The target a coordinate. + * @param {ol.Coordinate} b The target b coordinate. + * @param {ol.Coordinate} c The target c coordinate. + * @param {ol.Coordinate} aSrc The source a coordinate. + * @param {ol.Coordinate} bSrc The source b coordinate. + * @param {ol.Coordinate} cSrc The source c coordinate. * @private */ ol.reproj.Triangulation.prototype.addTriangle_ = function(a, b, c, @@ -195,14 +194,14 @@ ol.reproj.Triangulation.prototype.addTriangle_ = function(a, b, c, * (and reprojects the vertices) if valid. * Performs quad subdivision if needed to increase precision. * - * @param {ol.Coordinate} a - * @param {ol.Coordinate} b - * @param {ol.Coordinate} c - * @param {ol.Coordinate} d - * @param {ol.Coordinate} aSrc - * @param {ol.Coordinate} bSrc - * @param {ol.Coordinate} cSrc - * @param {ol.Coordinate} dSrc + * @param {ol.Coordinate} a The target a coordinate. + * @param {ol.Coordinate} b The target b coordinate. + * @param {ol.Coordinate} c The target c coordinate. + * @param {ol.Coordinate} d The target d coordinate. + * @param {ol.Coordinate} aSrc The source a coordinate. + * @param {ol.Coordinate} bSrc The source b coordinate. + * @param {ol.Coordinate} cSrc The source c coordinate. + * @param {ol.Coordinate} dSrc The source d coordinate. * @param {number} maxSubdivision Maximal allowed subdivision of the quad. * @private */ diff --git a/src/ol/resolutionconstraint.js b/src/ol/resolutionconstraint.js index 9c128ff2e7..df385090cf 100644 --- a/src/ol/resolutionconstraint.js +++ b/src/ol/resolutionconstraint.js @@ -15,8 +15,7 @@ ol.ResolutionConstraintType; * @param {Array.} resolutions Resolutions. * @return {ol.ResolutionConstraintType} Zoom function. */ -ol.ResolutionConstraint.createSnapToResolutions = - function(resolutions) { +ol.ResolutionConstraint.createSnapToResolutions = function(resolutions) { return ( /** * @param {number|undefined} resolution Resolution. @@ -43,8 +42,7 @@ ol.ResolutionConstraint.createSnapToResolutions = * @param {number=} opt_maxLevel Maximum level. * @return {ol.ResolutionConstraintType} Zoom function. */ -ol.ResolutionConstraint.createSnapToPower = - function(power, maxResolution, opt_maxLevel) { +ol.ResolutionConstraint.createSnapToPower = function(power, maxResolution, opt_maxLevel) { return ( /** * @param {number|undefined} resolution Resolution. diff --git a/src/ol/size.js b/src/ol/size.js index 876df0dc1f..2dba83bb72 100644 --- a/src/ol/size.js +++ b/src/ol/size.js @@ -18,7 +18,7 @@ ol.Size; * @param {ol.Size} size Size. * @param {number} buffer Buffer. * @param {ol.Size=} opt_size Optional reusable size array. - * @return {ol.Size} + * @return {ol.Size} The buffered size. */ ol.size.buffer = function(size, buffer, opt_size) { if (opt_size === undefined) { @@ -56,7 +56,7 @@ ol.size.hasArea = function(size) { * @param {ol.Size} size Size. * @param {number} ratio Ratio. * @param {ol.Size=} opt_size Optional reusable size array. - * @return {ol.Size} + * @return {ol.Size} The scaled size. */ ol.size.scale = function(size, ratio, opt_size) { if (opt_size === undefined) { diff --git a/src/ol/source/bingmapssource.js b/src/ol/source/bingmapssource.js index 8c42d1b152..3e6f9e3978 100644 --- a/src/ol/source/bingmapssource.js +++ b/src/ol/source/bingmapssource.js @@ -13,7 +13,6 @@ goog.require('ol.source.TileImage'); goog.require('ol.tilecoord'); - /** * @classdesc * Layer source for Bing Maps tile data. @@ -79,8 +78,7 @@ ol.source.BingMaps.TOS_ATTRIBUTION = new ol.Attribution({ /** * @param {BingMapsImageryMetadataResponse} response Response. */ -ol.source.BingMaps.prototype.handleImageryMetadataResponse = - function(response) { +ol.source.BingMaps.prototype.handleImageryMetadataResponse = function(response) { if (response.statusCode != 200 || response.statusDescription != 'OK' || diff --git a/src/ol/source/clustersource.js b/src/ol/source/clustersource.js index 9fdc5f4326..3a6a957a80 100644 --- a/src/ol/source/clustersource.js +++ b/src/ol/source/clustersource.js @@ -13,13 +13,12 @@ goog.require('ol.geom.Point'); goog.require('ol.source.Vector'); - /** * @classdesc * Layer source to cluster vector data. * * @constructor - * @param {olx.source.ClusterOptions} options + * @param {olx.source.ClusterOptions} options Constructor options. * @extends {ol.source.Vector} * @api */ @@ -148,7 +147,7 @@ ol.source.Cluster.prototype.cluster_ = function() { /** * @param {Array.} features Features - * @return {ol.Feature} + * @return {ol.Feature} The cluster feature. * @private */ ol.source.Cluster.prototype.createCluster_ = function(features) { diff --git a/src/ol/source/imagecanvassource.js b/src/ol/source/imagecanvassource.js index 57f3d8b5c3..c52f47c3e8 100644 --- a/src/ol/source/imagecanvassource.js +++ b/src/ol/source/imagecanvassource.js @@ -6,14 +6,13 @@ goog.require('ol.extent'); goog.require('ol.source.Image'); - /** * @classdesc * Base class for image sources where a canvas element is the image. * * @constructor * @extends {ol.source.Image} - * @param {olx.source.ImageCanvasOptions} options + * @param {olx.source.ImageCanvasOptions} options Constructor options. * @api */ ol.source.ImageCanvas = function(options) { @@ -59,8 +58,7 @@ goog.inherits(ol.source.ImageCanvas, ol.source.Image); /** * @inheritDoc */ -ol.source.ImageCanvas.prototype.getImageInternal = - function(extent, resolution, pixelRatio, projection) { +ol.source.ImageCanvas.prototype.getImageInternal = function(extent, resolution, pixelRatio, projection) { resolution = this.findNearestResolution(resolution); var canvas = this.canvas_; diff --git a/src/ol/source/imagemapguidesource.js b/src/ol/source/imagemapguidesource.js index 0aca8cca20..c2e92211f1 100644 --- a/src/ol/source/imagemapguidesource.js +++ b/src/ol/source/imagemapguidesource.js @@ -10,7 +10,6 @@ goog.require('ol.extent'); goog.require('ol.source.Image'); - /** * @classdesc * Source for images from Mapguide servers @@ -117,8 +116,7 @@ ol.source.ImageMapGuide.prototype.getParams = function() { /** * @inheritDoc */ -ol.source.ImageMapGuide.prototype.getImageInternal = - function(extent, resolution, pixelRatio, projection) { +ol.source.ImageMapGuide.prototype.getImageInternal = function(extent, resolution, pixelRatio, projection) { resolution = this.findNearestResolution(resolution); pixelRatio = this.hidpi_ ? pixelRatio : 1; @@ -207,8 +205,7 @@ ol.source.ImageMapGuide.prototype.updateParams = function(params) { * @param {ol.proj.Projection} projection Projection. * @return {string} The mapagent map image request URL. */ -ol.source.ImageMapGuide.prototype.getUrl = - function(baseUrl, params, extent, size, projection) { +ol.source.ImageMapGuide.prototype.getUrl = function(baseUrl, params, extent, size, projection) { var scale = ol.source.ImageMapGuide.getScale(extent, size, this.metersPerUnit_, this.displayDpi_); var center = ol.extent.getCenter(extent); diff --git a/src/ol/source/imagesource.js b/src/ol/source/imagesource.js index a0a4b4cb09..3a1ceaae7a 100644 --- a/src/ol/source/imagesource.js +++ b/src/ol/source/imagesource.js @@ -24,7 +24,6 @@ goog.require('ol.source.Source'); ol.source.ImageOptions; - /** * @classdesc * Abstract base class; normally only used for creating subclasses and not @@ -89,8 +88,7 @@ ol.source.Image.prototype.getResolutions = function() { * @param {number} resolution Resolution. * @return {number} Resolution. */ -ol.source.Image.prototype.findNearestResolution = - function(resolution) { +ol.source.Image.prototype.findNearestResolution = function(resolution) { if (this.resolutions_) { var idx = ol.array.linearFindNearest(this.resolutions_, resolution, 0); resolution = this.resolutions_[idx]; @@ -106,8 +104,7 @@ ol.source.Image.prototype.findNearestResolution = * @param {ol.proj.Projection} projection Projection. * @return {ol.ImageBase} Single image. */ -ol.source.Image.prototype.getImage = - function(extent, resolution, pixelRatio, projection) { +ol.source.Image.prototype.getImage = function(extent, resolution, pixelRatio, projection) { var sourceProjection = this.getProjection(); if (!ol.ENABLE_RASTER_REPROJECTION || !sourceProjection || @@ -178,6 +175,8 @@ ol.source.Image.prototype.handleImageChange = function(event) { new ol.source.ImageEvent(ol.source.ImageEventType.IMAGELOADERROR, image)); break; + default: + // pass } }; @@ -193,7 +192,6 @@ ol.source.Image.defaultImageLoadFunction = function(image, src) { }; - /** * @classdesc * Events emitted by {@link ol.source.Image} instances are instances of this diff --git a/src/ol/source/imagestaticsource.js b/src/ol/source/imagestaticsource.js index fc6e75d9ab..1738006e26 100644 --- a/src/ol/source/imagestaticsource.js +++ b/src/ol/source/imagestaticsource.js @@ -10,7 +10,6 @@ goog.require('ol.proj'); goog.require('ol.source.Image'); - /** * @classdesc * A layer source for displaying a single, static image. @@ -63,8 +62,7 @@ goog.inherits(ol.source.ImageStatic, ol.source.Image); /** * @inheritDoc */ -ol.source.ImageStatic.prototype.getImageInternal = - function(extent, resolution, pixelRatio, projection) { +ol.source.ImageStatic.prototype.getImageInternal = function(extent, resolution, pixelRatio, projection) { if (ol.extent.intersects(extent, this.image_.getExtent())) { return this.image_; } diff --git a/src/ol/source/imagevectorsource.js b/src/ol/source/imagevectorsource.js index ccfddf1ffd..30755af318 100644 --- a/src/ol/source/imagevectorsource.js +++ b/src/ol/source/imagevectorsource.js @@ -14,7 +14,6 @@ goog.require('ol.style.Style'); goog.require('ol.vec.Mat4'); - /** * @classdesc * An image source whose images are canvas elements into which vector features @@ -106,8 +105,7 @@ goog.inherits(ol.source.ImageVector, ol.source.ImageCanvas); * @return {HTMLCanvasElement} Canvas element. * @private */ -ol.source.ImageVector.prototype.canvasFunctionInternal_ = - function(extent, resolution, pixelRatio, size, projection) { +ol.source.ImageVector.prototype.canvasFunctionInternal_ = function(extent, resolution, pixelRatio, size, projection) { var replayGroup = new ol.render.canvas.ReplayGroup( ol.renderer.vector.getTolerance(resolution, pixelRatio), extent, @@ -217,8 +215,7 @@ ol.source.ImageVector.prototype.getStyleFunction = function() { * @return {!goog.vec.Mat4.Number} Transform. * @private */ -ol.source.ImageVector.prototype.getTransform_ = - function(center, resolution, pixelRatio, size) { +ol.source.ImageVector.prototype.getTransform_ = function(center, resolution, pixelRatio, size) { return ol.vec.Mat4.makeTransform2D(this.transform_, size[0] / 2, size[1] / 2, pixelRatio / resolution, -pixelRatio / resolution, @@ -232,8 +229,7 @@ ol.source.ImageVector.prototype.getTransform_ = * @param {goog.events.Event} event Image style change event. * @private */ -ol.source.ImageVector.prototype.handleImageChange_ = - function(event) { +ol.source.ImageVector.prototype.handleImageChange_ = function(event) { this.changed(); }; @@ -256,8 +252,7 @@ ol.source.ImageVector.prototype.handleSourceChange_ = function() { * @return {boolean} `true` if an image is loading. * @private */ -ol.source.ImageVector.prototype.renderFeature_ = - function(feature, resolution, pixelRatio, replayGroup) { +ol.source.ImageVector.prototype.renderFeature_ = function(feature, resolution, pixelRatio, replayGroup) { var styles; var styleFunction = feature.getStyleFunction(); if (styleFunction) { diff --git a/src/ol/source/imagewmssource.js b/src/ol/source/imagewmssource.js index 0dbe4695a9..61f5565f0d 100644 --- a/src/ol/source/imagewmssource.js +++ b/src/ol/source/imagewmssource.js @@ -18,7 +18,6 @@ goog.require('ol.source.wms'); goog.require('ol.source.wms.ServerType'); - /** * @classdesc * Source for WMS servers providing single, untiled images. @@ -136,8 +135,7 @@ ol.source.ImageWMS.GETFEATUREINFO_IMAGE_SIZE_ = [101, 101]; * @return {string|undefined} GetFeatureInfo URL. * @api stable */ -ol.source.ImageWMS.prototype.getGetFeatureInfoUrl = - function(coordinate, resolution, projection, params) { +ol.source.ImageWMS.prototype.getGetFeatureInfoUrl = function(coordinate, resolution, projection, params) { goog.asserts.assert(!('VERSION' in params), 'key VERSION is not allowed in params'); @@ -185,8 +183,7 @@ ol.source.ImageWMS.prototype.getParams = function() { /** * @inheritDoc */ -ol.source.ImageWMS.prototype.getImageInternal = - function(extent, resolution, pixelRatio, projection) { +ol.source.ImageWMS.prototype.getImageInternal = function(extent, resolution, pixelRatio, projection) { if (this.url_ === undefined) { return null; @@ -271,17 +268,14 @@ ol.source.ImageWMS.prototype.getImageLoadFunction = function() { * @return {string} Request URL. * @private */ -ol.source.ImageWMS.prototype.getRequestUrl_ = - function(extent, size, pixelRatio, projection, params) { +ol.source.ImageWMS.prototype.getRequestUrl_ = function(extent, size, pixelRatio, projection, params) { goog.asserts.assert(this.url_ !== undefined, 'url is defined'); params[this.v13_ ? 'CRS' : 'SRS'] = projection.getCode(); if (!('STYLES' in this.params_)) { - /* jshint -W053 */ params['STYLES'] = new String(''); - /* jshint +W053 */ } if (pixelRatio != 1) { diff --git a/src/ol/source/mapquestsource.js b/src/ol/source/mapquestsource.js index 49e5241b24..458aa3d5d9 100644 --- a/src/ol/source/mapquestsource.js +++ b/src/ol/source/mapquestsource.js @@ -6,7 +6,6 @@ goog.require('ol.source.OSM'); goog.require('ol.source.XYZ'); - /** * @classdesc * Layer source for the MapQuest tile server. diff --git a/src/ol/source/osmsource.js b/src/ol/source/osmsource.js index f00859485e..52f7816ec6 100644 --- a/src/ol/source/osmsource.js +++ b/src/ol/source/osmsource.js @@ -4,7 +4,6 @@ goog.require('ol.Attribution'); goog.require('ol.source.XYZ'); - /** * @classdesc * Layer source for the OpenStreetMap tile server. diff --git a/src/ol/source/rastersource.js b/src/ol/source/rastersource.js index 8121573a69..5689705323 100644 --- a/src/ol/source/rastersource.js +++ b/src/ol/source/rastersource.js @@ -23,7 +23,6 @@ goog.require('ol.source.State'); goog.require('ol.source.Tile'); - /** * @classdesc * A source that transforms data from any number of input sources using an array @@ -78,7 +77,9 @@ ol.source.Raster = function(options) { * @type {ol.TileQueue} */ this.tileQueue_ = new ol.TileQueue( - function() { return 1; }, + function() { + return 1; + }, goog.bind(this.changed, this)); var layerStatesArray = ol.source.Raster.getLayerStatesArray_(this.renderers_); @@ -167,8 +168,7 @@ ol.source.Raster.prototype.setOperation = function(operation, opt_lib) { * @return {olx.FrameState} The updated frame state. * @private */ -ol.source.Raster.prototype.updateFrameState_ = - function(extent, resolution, projection) { +ol.source.Raster.prototype.updateFrameState_ = function(extent, resolution, projection) { var frameState = /** @type {olx.FrameState} */ ( goog.object.clone(this.frameState_)); @@ -212,8 +212,7 @@ ol.source.Raster.prototype.isDirty_ = function(extent, resolution) { /** * @inheritDoc */ -ol.source.Raster.prototype.getImage = - function(extent, resolution, pixelRatio, projection) { +ol.source.Raster.prototype.getImage = function(extent, resolution, pixelRatio, projection) { if (!this.allSourcesReady_()) { return null; @@ -313,8 +312,7 @@ ol.source.Raster.prototype.composeFrame_ = function(frameState, callback) { * @param {Object} data The user data. * @private */ -ol.source.Raster.prototype.onWorkerComplete_ = - function(frameState, callback, err, output, data) { +ol.source.Raster.prototype.onWorkerComplete_ = function(frameState, callback, err, output, data) { if (err) { callback(err); return; @@ -470,7 +468,6 @@ ol.source.Raster.createTileRenderer_ = function(source) { ol.source.Raster.RenderedState; - /** * @classdesc * Events emitted by {@link ol.source.Raster} instances are instances of this diff --git a/src/ol/source/source.js b/src/ol/source/source.js index 84f0c6208e..a9650e8247 100644 --- a/src/ol/source/source.js +++ b/src/ol/source/source.js @@ -30,7 +30,6 @@ ol.source.State = { ol.source.SourceOptions; - /** * @classdesc * Abstract base class; normally only used for creating subclasses and not diff --git a/src/ol/source/stamensource.js b/src/ol/source/stamensource.js index 733542835e..2265e7d27f 100644 --- a/src/ol/source/stamensource.js +++ b/src/ol/source/stamensource.js @@ -76,7 +76,6 @@ ol.source.StamenProviderConfig = { }; - /** * @classdesc * Layer source for the Stamen tile server. diff --git a/src/ol/source/tilearcgisrestsource.js b/src/ol/source/tilearcgisrestsource.js index b4afd52cc0..d788ba3342 100644 --- a/src/ol/source/tilearcgisrestsource.js +++ b/src/ol/source/tilearcgisrestsource.js @@ -14,7 +14,6 @@ goog.require('ol.source.TileImage'); goog.require('ol.tilecoord'); - /** * @classdesc * Layer source for tile data from ArcGIS Rest services. Map and Image @@ -86,8 +85,7 @@ ol.source.TileArcGISRest.prototype.getParams = function() { * @return {string|undefined} Request URL. * @private */ -ol.source.TileArcGISRest.prototype.getRequestUrl_ = - function(tileCoord, tileSize, tileExtent, +ol.source.TileArcGISRest.prototype.getRequestUrl_ = function(tileCoord, tileSize, tileExtent, pixelRatio, projection, params) { var urls = this.urls; @@ -121,11 +119,9 @@ ol.source.TileArcGISRest.prototype.getRequestUrl_ = // If a MapServer, use export. If an ImageServer, use exportImage. if (goog.string.endsWith(url, 'MapServer/')) { url = url + 'export'; - } - else if (goog.string.endsWith(url, 'ImageServer/')) { + } else if (goog.string.endsWith(url, 'ImageServer/')) { url = url + 'exportImage'; - } - else { + } else { goog.asserts.fail('Unknown Rest Service', url); } @@ -148,8 +144,7 @@ ol.source.TileArcGISRest.prototype.getTilePixelRatio = function(pixelRatio) { * @return {string|undefined} Tile URL. * @private */ -ol.source.TileArcGISRest.prototype.tileUrlFunction_ = - function(tileCoord, pixelRatio, projection) { +ol.source.TileArcGISRest.prototype.tileUrlFunction_ = function(tileCoord, pixelRatio, projection) { var tileGrid = this.getTileGrid(); if (!tileGrid) { diff --git a/src/ol/source/tiledebugsource.js b/src/ol/source/tiledebugsource.js index 336c832693..eb3a4f4187 100644 --- a/src/ol/source/tiledebugsource.js +++ b/src/ol/source/tiledebugsource.js @@ -8,7 +8,6 @@ goog.require('ol.size'); goog.require('ol.source.Tile'); - /** * @constructor * @extends {ol.Tile} @@ -74,7 +73,6 @@ ol.DebugTile_.prototype.getImage = function(opt_context) { }; - /** * @classdesc * A pseudo tile source, which does not fetch tiles from a server, but renders diff --git a/src/ol/source/tileimagesource.js b/src/ol/source/tileimagesource.js index 5e7534d78d..61fb419f74 100644 --- a/src/ol/source/tileimagesource.js +++ b/src/ol/source/tileimagesource.js @@ -12,7 +12,6 @@ goog.require('ol.reproj.Tile'); goog.require('ol.source.UrlTile'); - /** * @classdesc * Base class for sources providing images divided into a tile grid. @@ -186,8 +185,7 @@ ol.source.TileImage.prototype.getTileCacheForProjection = function(projection) { * @return {ol.Tile} Tile. * @private */ -ol.source.TileImage.prototype.createTile_ = - function(z, x, y, pixelRatio, projection, key) { +ol.source.TileImage.prototype.createTile_ = function(z, x, y, pixelRatio, projection, key) { var tileCoord = [z, x, y]; var urlTileCoord = this.getTileCoordForTileUrlFunction( tileCoord, projection); @@ -209,8 +207,7 @@ ol.source.TileImage.prototype.createTile_ = /** * @inheritDoc */ -ol.source.TileImage.prototype.getTile = - function(z, x, y, pixelRatio, projection) { +ol.source.TileImage.prototype.getTile = function(z, x, y, pixelRatio, projection) { if (!ol.ENABLE_RASTER_REPROJECTION || !this.getProjection() || !projection || @@ -253,8 +250,7 @@ ol.source.TileImage.prototype.getTile = * @return {!ol.Tile} Tile. * @protected */ -ol.source.TileImage.prototype.getTileInternal = - function(z, x, y, pixelRatio, projection) { +ol.source.TileImage.prototype.getTileInternal = function(z, x, y, pixelRatio, projection) { var /** @type {ol.Tile} */ tile = null; var tileCoordKey = this.getKeyZXY(z, x, y); var paramsKey = this.getKeyParams(); @@ -327,8 +323,7 @@ ol.source.TileImage.prototype.setRenderReprojectionEdges = function(render) { * @param {ol.tilegrid.TileGrid} tilegrid Tile grid to use for the projection. * @api */ -ol.source.TileImage.prototype.setTileGridForProjection = - function(projection, tilegrid) { +ol.source.TileImage.prototype.setTileGridForProjection = function(projection, tilegrid) { if (ol.ENABLE_RASTER_REPROJECTION) { var proj = ol.proj.get(projection); if (proj) { diff --git a/src/ol/source/tilejsonsource.js b/src/ol/source/tilejsonsource.js index 16e744bf22..812a5c967b 100644 --- a/src/ol/source/tilejsonsource.js +++ b/src/ol/source/tilejsonsource.js @@ -22,7 +22,6 @@ goog.require('ol.source.State'); goog.require('ol.source.TileImage'); - /** * @classdesc * Layer source for tile data in TileJSON format. diff --git a/src/ol/source/tilesource.js b/src/ol/source/tilesource.js index 3ff95e2cf2..00130edfc4 100644 --- a/src/ol/source/tilesource.js +++ b/src/ol/source/tilesource.js @@ -32,7 +32,6 @@ goog.require('ol.tilegrid.TileGrid'); ol.source.TileOptions; - /** * @classdesc * Abstract base class; normally only used for creating subclasses and not @@ -119,8 +118,7 @@ ol.source.Tile.prototype.expireCache = function(projection, usedTiles) { * considered loaded. * @return {boolean} The tile range is fully covered with loaded tiles. */ -ol.source.Tile.prototype.forEachLoadedTile = - function(projection, z, tileRange, callback) { +ol.source.Tile.prototype.forEachLoadedTile = function(projection, z, tileRange, callback) { var tileCache = this.getTileCacheForProjection(projection); if (!tileCache) { return false; @@ -258,8 +256,7 @@ ol.source.Tile.prototype.getTilePixelRatio = function(pixelRatio) { * @param {ol.proj.Projection} projection Projection. * @return {ol.Size} Tile size. */ -ol.source.Tile.prototype.getTilePixelSize = - function(z, pixelRatio, projection) { +ol.source.Tile.prototype.getTilePixelSize = function(z, pixelRatio, projection) { var tileGrid = this.getTileGridForProjection(projection); var tilePixelRatio = this.getTilePixelRatio(pixelRatio); var tileSize = ol.size.toSize(tileGrid.getTileSize(z), this.tmpSize); @@ -280,8 +277,7 @@ ol.source.Tile.prototype.getTilePixelSize = * @return {ol.TileCoord} Tile coordinate to be passed to the tileUrlFunction or * null if no tile URL should be created for the passed `tileCoord`. */ -ol.source.Tile.prototype.getTileCoordForTileUrlFunction = - function(tileCoord, opt_projection) { +ol.source.Tile.prototype.getTileCoordForTileUrlFunction = function(tileCoord, opt_projection) { var projection = opt_projection !== undefined ? opt_projection : this.getProjection(); var tileGrid = this.getTileGridForProjection(projection); @@ -303,7 +299,6 @@ ol.source.Tile.prototype.getTileCoordForTileUrlFunction = ol.source.Tile.prototype.useTile = ol.nullFunction; - /** * @classdesc * Events emitted by {@link ol.source.Tile} instances are instances of this diff --git a/src/ol/source/tileutfgridsource.js b/src/ol/source/tileutfgridsource.js index 5cc861ab36..dd2ae4bd08 100644 --- a/src/ol/source/tileutfgridsource.js +++ b/src/ol/source/tileutfgridsource.js @@ -15,7 +15,6 @@ goog.require('ol.source.State'); goog.require('ol.source.Tile'); - /** * @classdesc * Layer source for UTFGrid interaction data loaded from TileJSON format. @@ -166,8 +165,7 @@ ol.source.TileUTFGrid.prototype.handleTileJSONResponse = function(tileJSON) { /** * @inheritDoc */ -ol.source.TileUTFGrid.prototype.getTile = - function(z, x, y, pixelRatio, projection) { +ol.source.TileUTFGrid.prototype.getTile = function(z, x, y, pixelRatio, projection) { var tileCoordKey = this.getKeyZXY(z, x, y); if (this.tileCache.containsKey(tileCoordKey)) { return /** @type {!ol.Tile} */ (this.tileCache.get(tileCoordKey)); @@ -200,7 +198,6 @@ ol.source.TileUTFGrid.prototype.useTile = function(z, x, y) { }; - /** * @constructor * @extends {ol.Tile} @@ -211,8 +208,7 @@ ol.source.TileUTFGrid.prototype.useTile = function(z, x, y) { * @param {boolean} preemptive Load the tile when visible (before it's needed). * @private */ -ol.source.TileUTFGridTile_ = - function(tileCoord, state, src, extent, preemptive) { +ol.source.TileUTFGridTile_ = function(tileCoord, state, src, extent, preemptive) { goog.base(this, tileCoord, state); @@ -269,7 +265,7 @@ ol.source.TileUTFGridTile_.prototype.getImage = function(opt_context) { /** * Synchronously returns data at given coordinate (if available). * @param {ol.Coordinate} coordinate Coordinate. - * @return {Object} + * @return {Object} The data. */ ol.source.TileUTFGridTile_.prototype.getData = function(coordinate) { if (!this.grid_ || !this.keys_ || !this.data_) { @@ -309,8 +305,7 @@ ol.source.TileUTFGridTile_.prototype.getData = function(coordinate) { * The tile data is requested if not yet loaded. * @template T */ -ol.source.TileUTFGridTile_.prototype.forDataAtCoordinate = - function(coordinate, callback, opt_this, opt_request) { +ol.source.TileUTFGridTile_.prototype.forDataAtCoordinate = function(coordinate, callback, opt_this, opt_request) { if (this.state == ol.TileState.IDLE && opt_request === true) { goog.events.listenOnce(this, goog.events.EventType.CHANGE, function(e) { callback.call(opt_this, this.getData(coordinate)); @@ -346,7 +341,7 @@ ol.source.TileUTFGridTile_.prototype.handleError_ = function() { /** - * @param {!UTFGridJSON} json + * @param {!UTFGridJSON} json UTFGrid data. * @private */ ol.source.TileUTFGridTile_.prototype.handleLoad_ = function(json) { diff --git a/src/ol/source/tilewmssource.js b/src/ol/source/tilewmssource.js index ccec57afeb..f83c9251e3 100644 --- a/src/ol/source/tilewmssource.js +++ b/src/ol/source/tilewmssource.js @@ -20,7 +20,6 @@ goog.require('ol.source.wms.ServerType'); goog.require('ol.tilecoord'); - /** * @classdesc * Layer source for tile data from WMS servers. @@ -117,8 +116,7 @@ goog.inherits(ol.source.TileWMS, ol.source.TileImage); * @return {string|undefined} GetFeatureInfo URL. * @api stable */ -ol.source.TileWMS.prototype.getGetFeatureInfoUrl = - function(coordinate, resolution, projection, params) { +ol.source.TileWMS.prototype.getGetFeatureInfoUrl = function(coordinate, resolution, projection, params) { goog.asserts.assert(!('VERSION' in params), 'key VERSION is not allowed in params'); @@ -207,8 +205,7 @@ ol.source.TileWMS.prototype.getParams = function() { * @return {string|undefined} Request URL. * @private */ -ol.source.TileWMS.prototype.getRequestUrl_ = - function(tileCoord, tileSize, tileExtent, +ol.source.TileWMS.prototype.getRequestUrl_ = function(tileCoord, tileSize, tileExtent, pixelRatio, projection, params) { var urls = this.urls; @@ -222,9 +219,7 @@ ol.source.TileWMS.prototype.getRequestUrl_ = params[this.v13_ ? 'CRS' : 'SRS'] = projection.getCode(); if (!('STYLES' in this.params_)) { - /* jshint -W053 */ params['STYLES'] = new String(''); - /* jshint +W053 */ } if (pixelRatio != 1) { @@ -312,8 +307,7 @@ ol.source.TileWMS.prototype.resetCoordKeyPrefix_ = function() { * @return {string|undefined} Tile URL. * @private */ -ol.source.TileWMS.prototype.tileUrlFunction_ = - function(tileCoord, pixelRatio, projection) { +ol.source.TileWMS.prototype.tileUrlFunction_ = function(tileCoord, pixelRatio, projection) { var tileGrid = this.getTileGrid(); if (!tileGrid) { diff --git a/src/ol/source/urltilesource.js b/src/ol/source/urltilesource.js index 0f0b70b7f5..6b8cb575d8 100644 --- a/src/ol/source/urltilesource.js +++ b/src/ol/source/urltilesource.js @@ -28,7 +28,6 @@ goog.require('ol.source.TileEvent'); ol.source.UrlTileOptions; - /** * @classdesc * Base class for sources providing tiles divided into a tile grid over http. @@ -143,6 +142,8 @@ ol.source.UrlTile.prototype.handleTileChange = function(event) { this.dispatchEvent( new ol.source.TileEvent(ol.source.TileEventType.TILELOADERROR, tile)); break; + default: + // pass } }; diff --git a/src/ol/source/vectorsource.js b/src/ol/source/vectorsource.js index 251f66ba38..9a3352726c 100644 --- a/src/ol/source/vectorsource.js +++ b/src/ol/source/vectorsource.js @@ -63,7 +63,6 @@ ol.source.VectorEventType = { }; - /** * @classdesc * Provides a source of features for vector layers. Vector features provided @@ -221,8 +220,8 @@ ol.source.Vector.prototype.addFeatureInternal = function(feature) { /** - * @param {string} featureKey - * @param {ol.Feature} feature + * @param {string} featureKey Unique identifier for the feature. + * @param {ol.Feature} feature The feature. * @private */ ol.source.Vector.prototype.setupChangeEvents_ = function(featureKey, feature) { @@ -240,10 +239,10 @@ ol.source.Vector.prototype.setupChangeEvents_ = function(featureKey, feature) { /** - * @param {string} featureKey - * @param {ol.Feature} feature - * @return {boolean} `true` if the feature is "valid", in the sense that it is - * also a candidate for insertion into the Rtree, otherwise `false`. + * @param {string} featureKey Unique identifier for the feature. + * @param {ol.Feature} feature The feature. + * @return {boolean} The feature is "valid", in the sense that it is also a + * candidate for insertion into the Rtree. * @private */ ol.source.Vector.prototype.addToIndex_ = function(featureKey, feature) { @@ -447,8 +446,7 @@ ol.source.Vector.prototype.forEachFeature = function(callback, opt_this) { * @return {S|undefined} The return value from the last call to the callback. * @template T,S */ -ol.source.Vector.prototype.forEachFeatureAtCoordinateDirect = - function(coordinate, callback, opt_this) { +ol.source.Vector.prototype.forEachFeatureAtCoordinateDirect = function(coordinate, callback, opt_this) { var extent = [coordinate[0], coordinate[1], coordinate[0], coordinate[1]]; return this.forEachFeatureInExtent(extent, function(feature) { var geometry = feature.getGeometry(); @@ -483,8 +481,7 @@ ol.source.Vector.prototype.forEachFeatureAtCoordinateDirect = * @template T,S * @api */ -ol.source.Vector.prototype.forEachFeatureInExtent = - function(extent, callback, opt_this) { +ol.source.Vector.prototype.forEachFeatureInExtent = function(extent, callback, opt_this) { if (this.featuresRtree_) { return this.featuresRtree_.forEachInExtent(extent, callback, opt_this); } else if (this.featuresCollection_) { @@ -510,8 +507,7 @@ ol.source.Vector.prototype.forEachFeatureInExtent = * @template T,S * @api */ -ol.source.Vector.prototype.forEachFeatureIntersectingExtent = - function(extent, callback, opt_this) { +ol.source.Vector.prototype.forEachFeatureIntersectingExtent = function(extent, callback, opt_this) { return this.forEachFeatureInExtent(extent, /** * @param {ol.Feature} feature Feature. @@ -536,7 +532,7 @@ ol.source.Vector.prototype.forEachFeatureIntersectingExtent = * Get the features collection associated with this source. Will be `null` * unless the source was configured with `useSpatialIndex` set to `false`, or * with an {@link ol.Collection} as `features`. - * @return {ol.Collection.} + * @return {ol.Collection.} The collection of features. * @api */ ol.source.Vector.prototype.getFeaturesCollection = function() { @@ -608,8 +604,7 @@ ol.source.Vector.prototype.getFeaturesInExtent = function(extent) { * @return {ol.Feature} Closest feature. * @api stable */ -ol.source.Vector.prototype.getClosestFeatureToCoordinate = - function(coordinate) { +ol.source.Vector.prototype.getClosestFeatureToCoordinate = function(coordinate) { // Find the closest feature using branch and bound. We start searching an // infinite extent, and find the distance from the first feature found. This // becomes the closest feature. We then compute a smaller extent which any @@ -844,7 +839,6 @@ ol.source.Vector.prototype.removeFromIdIndex_ = function(feature) { }; - /** * @classdesc * Events emitted by {@link ol.source.Vector} instances are instances of this diff --git a/src/ol/source/vectortilesource.js b/src/ol/source/vectortilesource.js index f482e64ef7..5f8bf47e68 100644 --- a/src/ol/source/vectortilesource.js +++ b/src/ol/source/vectortilesource.js @@ -9,7 +9,6 @@ goog.require('ol.featureloader'); goog.require('ol.source.UrlTile'); - /** * @classdesc * Class for layer sources providing vector data divided into a tile grid, to be @@ -67,8 +66,7 @@ goog.inherits(ol.source.VectorTile, ol.source.UrlTile); /** * @inheritDoc */ -ol.source.VectorTile.prototype.getTile = - function(z, x, y, pixelRatio, projection) { +ol.source.VectorTile.prototype.getTile = function(z, x, y, pixelRatio, projection) { var tileCoordKey = this.getKeyZXY(z, x, y); if (this.tileCache.containsKey(tileCoordKey)) { return /** @type {!ol.Tile} */ (this.tileCache.get(tileCoordKey)); diff --git a/src/ol/source/wmtssource.js b/src/ol/source/wmtssource.js index 4e8231e08e..77c322a4d7 100644 --- a/src/ol/source/wmtssource.js +++ b/src/ol/source/wmtssource.js @@ -25,7 +25,6 @@ ol.source.WMTSRequestEncoding = { }; - /** * @classdesc * Layer source for tile data from WMTS servers. diff --git a/src/ol/source/xyzsource.js b/src/ol/source/xyzsource.js index 64e7bb0921..fa1c702d24 100644 --- a/src/ol/source/xyzsource.js +++ b/src/ol/source/xyzsource.js @@ -3,7 +3,6 @@ goog.provide('ol.source.XYZ'); goog.require('ol.source.TileImage'); - /** * @classdesc * Layer source for tile data with URLs in a set XYZ format that are diff --git a/src/ol/source/zoomifysource.js b/src/ol/source/zoomifysource.js index bcddc08af1..1e7cfa9382 100644 --- a/src/ol/source/zoomifysource.js +++ b/src/ol/source/zoomifysource.js @@ -21,7 +21,6 @@ ol.source.ZoomifyTierSizeCalculation = { }; - /** * @classdesc * Layer source for tile data in Zoomify format. @@ -134,7 +133,6 @@ ol.source.Zoomify = function(opt_options) { goog.inherits(ol.source.Zoomify, ol.source.TileImage); - /** * @constructor * @extends {ol.ImageTile} diff --git a/src/ol/sphere/sphere.js b/src/ol/sphere/sphere.js index ebd6f96592..fbe3a8db07 100644 --- a/src/ol/sphere/sphere.js +++ b/src/ol/sphere/sphere.js @@ -10,7 +10,6 @@ goog.provide('ol.Sphere'); goog.require('ol.math'); - /** * @classdesc * Class to create objects that can be used with {@link diff --git a/src/ol/structs/lrucache.js b/src/ol/structs/lrucache.js index 0034c9c1d0..93ef30907d 100644 --- a/src/ol/structs/lrucache.js +++ b/src/ol/structs/lrucache.js @@ -4,7 +4,6 @@ goog.require('goog.asserts'); goog.require('goog.object'); - /** * Implements a Least-Recently-Used cache where the keys do not conflict with * Object's properties (e.g. 'hasOwnProperty' is not allowed as a key). Expiring diff --git a/src/ol/structs/priorityqueue.js b/src/ol/structs/priorityqueue.js index a1ab4c946e..ce370b985d 100644 --- a/src/ol/structs/priorityqueue.js +++ b/src/ol/structs/priorityqueue.js @@ -4,7 +4,6 @@ goog.require('goog.asserts'); goog.require('goog.object'); - /** * Priority queue. * diff --git a/src/ol/structs/rbush.js b/src/ol/structs/rbush.js index 987a208428..e1b2e59dc9 100644 --- a/src/ol/structs/rbush.js +++ b/src/ol/structs/rbush.js @@ -6,7 +6,6 @@ goog.require('ol.ext.rbush'); goog.require('ol.extent'); - /** * Wrapper around the RBush by Vladimir Agafonkin. * @@ -197,8 +196,7 @@ ol.structs.RBush.prototype.forEach = function(callback, opt_this) { * @return {*} Callback return value. * @template S */ -ol.structs.RBush.prototype.forEachInExtent = - function(extent, callback, opt_this) { +ol.structs.RBush.prototype.forEachInExtent = function(extent, callback, opt_this) { if (goog.DEBUG) { ++this.readers_; try { diff --git a/src/ol/style/atlasmanager.js b/src/ol/style/atlasmanager.js index f979c6c4ed..3a0a18ce7e 100644 --- a/src/ol/style/atlasmanager.js +++ b/src/ol/style/atlasmanager.js @@ -18,7 +18,6 @@ goog.require('ol'); ol.style.AtlasManagerInfo; - /** * Manages the creation of image atlases. * @@ -170,8 +169,7 @@ ol.style.AtlasManager.prototype.mergeInfos_ = function(info, hitInfo) { * @return {?ol.style.AtlasManagerInfo} The position and atlas image for the * entry, or `null` if the image is too big. */ -ol.style.AtlasManager.prototype.add = - function(id, width, height, +ol.style.AtlasManager.prototype.add = function(id, width, height, renderCallback, opt_renderHitCallback, opt_this) { if (width + this.space_ > this.maxSize_ || height + this.space_ > this.maxSize_) { @@ -213,8 +211,7 @@ ol.style.AtlasManager.prototype.add = * @return {?ol.style.AtlasInfo} The position and atlas image for the entry, * or `null` if the image is too big. */ -ol.style.AtlasManager.prototype.add_ = - function(isHitAtlas, id, width, height, +ol.style.AtlasManager.prototype.add_ = function(isHitAtlas, id, width, height, renderCallback, opt_this) { var atlases = (isHitAtlas) ? this.hitAtlases_ : this.atlases_; var atlas, info, i, ii; @@ -253,7 +250,6 @@ ol.style.AtlasManager.prototype.add_ = ol.style.AtlasInfo; - /** * This class facilitates the creation of image atlases. * @@ -311,7 +307,7 @@ ol.style.Atlas = function(size, space) { /** * @param {string} id The identifier of the entry to check. - * @return {?ol.style.AtlasInfo} + * @return {?ol.style.AtlasInfo} The atlas info. */ ol.style.Atlas.prototype.get = function(id) { return /** @type {?ol.style.AtlasInfo} */ ( @@ -329,8 +325,7 @@ ol.style.Atlas.prototype.get = function(id) { * `renderCallback`. * @return {?ol.style.AtlasInfo} The position and atlas image for the entry. */ -ol.style.Atlas.prototype.add = - function(id, width, height, renderCallback, opt_this) { +ol.style.Atlas.prototype.add = function(id, width, height, renderCallback, opt_this) { var block, i, ii; for (i = 0, ii = this.emptyBlocks_.length; i < ii; ++i) { block = this.emptyBlocks_[i]; @@ -367,8 +362,7 @@ ol.style.Atlas.prototype.add = * @param {number} width The width of the entry to insert. * @param {number} height The height of the entry to insert. */ -ol.style.Atlas.prototype.split_ = - function(index, block, width, height) { +ol.style.Atlas.prototype.split_ = function(index, block, width, height) { var deltaWidth = block.width - width; var deltaHeight = block.height - height; @@ -426,8 +420,7 @@ ol.style.Atlas.prototype.split_ = * @param {ol.style.Atlas.Block} newBlock1 The 1st block to add. * @param {ol.style.Atlas.Block} newBlock2 The 2nd block to add. */ -ol.style.Atlas.prototype.updateBlocks_ = - function(index, newBlock1, newBlock2) { +ol.style.Atlas.prototype.updateBlocks_ = function(index, newBlock1, newBlock2) { var args = [index, 1]; if (newBlock1.width > 0 && newBlock1.height > 0) { args.push(newBlock1); diff --git a/src/ol/style/circlestyle.js b/src/ol/style/circlestyle.js index 3fc8d8b4ca..375156331d 100644 --- a/src/ol/style/circlestyle.js +++ b/src/ol/style/circlestyle.js @@ -11,7 +11,6 @@ goog.require('ol.style.ImageState'); goog.require('ol.style.Stroke'); - /** * @classdesc * Set circle style for vector features. @@ -235,7 +234,7 @@ ol.style.Circle.RenderOptions; /** * @private - * @param {ol.style.AtlasManager|undefined} atlasManager + * @param {ol.style.AtlasManager|undefined} atlasManager An atlas manager. */ ol.style.Circle.prototype.render_ = function(atlasManager) { var imageSize; @@ -323,8 +322,8 @@ ol.style.Circle.prototype.render_ = function(atlasManager) { /** * @private - * @param {ol.style.Circle.RenderOptions} renderOptions - * @param {CanvasRenderingContext2D} context + * @param {ol.style.Circle.RenderOptions} renderOptions Render options. + * @param {CanvasRenderingContext2D} context The rendering context. * @param {number} x The origin for the symbol (x). * @param {number} y The origin for the symbol (y). */ @@ -358,7 +357,7 @@ ol.style.Circle.prototype.draw_ = function(renderOptions, context, x, y) { /** * @private - * @param {ol.style.Circle.RenderOptions} renderOptions + * @param {ol.style.Circle.RenderOptions} renderOptions Render options. */ ol.style.Circle.prototype.createHitDetectionCanvas_ = function(renderOptions) { this.hitDetectionImageSize_ = [renderOptions.size, renderOptions.size]; @@ -384,13 +383,12 @@ ol.style.Circle.prototype.createHitDetectionCanvas_ = function(renderOptions) { /** * @private - * @param {ol.style.Circle.RenderOptions} renderOptions - * @param {CanvasRenderingContext2D} context + * @param {ol.style.Circle.RenderOptions} renderOptions Render options. + * @param {CanvasRenderingContext2D} context The context. * @param {number} x The origin for the symbol (x). * @param {number} y The origin for the symbol (y). */ -ol.style.Circle.prototype.drawHitDetectionCanvas_ = - function(renderOptions, context, x, y) { +ol.style.Circle.prototype.drawHitDetectionCanvas_ = function(renderOptions, context, x, y) { // reset transform context.setTransform(1, 0, 0, 1, 0, 0); diff --git a/src/ol/style/fillstyle.js b/src/ol/style/fillstyle.js index bd80d7a3fd..f57308ab17 100644 --- a/src/ol/style/fillstyle.js +++ b/src/ol/style/fillstyle.js @@ -3,7 +3,6 @@ goog.provide('ol.style.Fill'); goog.require('ol.color'); - /** * @classdesc * Set fill style for vector features. diff --git a/src/ol/style/iconstyle.js b/src/ol/style/iconstyle.js index f8d99ebc7b..8ae467f871 100644 --- a/src/ol/style/iconstyle.js +++ b/src/ol/style/iconstyle.js @@ -37,7 +37,6 @@ ol.style.IconOrigin = { }; - /** * @classdesc * Set icon style for vector features. @@ -372,7 +371,6 @@ ol.style.Icon.prototype.unlistenImageChange = function(listener, thisArg) { }; - /** * @constructor * @param {Image|HTMLCanvasElement} image Image. @@ -646,7 +644,6 @@ ol.style.IconImage_.prototype.unlistenImage_ = function() { }; - /** * @constructor */ diff --git a/src/ol/style/imagestyle.js b/src/ol/style/imagestyle.js index 49038c899b..fc07ebe197 100644 --- a/src/ol/style/imagestyle.js +++ b/src/ol/style/imagestyle.js @@ -23,7 +23,6 @@ ol.style.ImageState = { ol.style.ImageOptions; - /** * @classdesc * A base class used for creating subclasses and not instantiated in diff --git a/src/ol/style/regularshapestyle.js b/src/ol/style/regularshapestyle.js index 8979b046b7..8b4b680ff0 100644 --- a/src/ol/style/regularshapestyle.js +++ b/src/ol/style/regularshapestyle.js @@ -12,7 +12,6 @@ goog.require('ol.style.ImageState'); goog.require('ol.style.Stroke'); - /** * @classdesc * Set regular shape style for vector features. The resulting shape will be @@ -298,7 +297,7 @@ ol.style.RegularShape.RenderOptions; /** * @private - * @param {ol.style.AtlasManager|undefined} atlasManager + * @param {ol.style.AtlasManager|undefined} atlasManager An atlas manager. */ ol.style.RegularShape.prototype.render_ = function(atlasManager) { var imageSize; @@ -403,8 +402,8 @@ ol.style.RegularShape.prototype.render_ = function(atlasManager) { /** * @private - * @param {ol.style.RegularShape.RenderOptions} renderOptions - * @param {CanvasRenderingContext2D} context + * @param {ol.style.RegularShape.RenderOptions} renderOptions Render options. + * @param {CanvasRenderingContext2D} context The rendering context. * @param {number} x The origin for the symbol (x). * @param {number} y The origin for the symbol (y). */ @@ -448,10 +447,9 @@ ol.style.RegularShape.prototype.draw_ = function(renderOptions, context, x, y) { /** * @private - * @param {ol.style.RegularShape.RenderOptions} renderOptions + * @param {ol.style.RegularShape.RenderOptions} renderOptions Render options. */ -ol.style.RegularShape.prototype.createHitDetectionCanvas_ = - function(renderOptions) { +ol.style.RegularShape.prototype.createHitDetectionCanvas_ = function(renderOptions) { this.hitDetectionImageSize_ = [renderOptions.size, renderOptions.size]; if (this.fill_) { this.hitDetectionCanvas_ = this.canvas_; @@ -475,13 +473,12 @@ ol.style.RegularShape.prototype.createHitDetectionCanvas_ = /** * @private - * @param {ol.style.RegularShape.RenderOptions} renderOptions - * @param {CanvasRenderingContext2D} context + * @param {ol.style.RegularShape.RenderOptions} renderOptions Render options. + * @param {CanvasRenderingContext2D} context The context. * @param {number} x The origin for the symbol (x). * @param {number} y The origin for the symbol (y). */ -ol.style.RegularShape.prototype.drawHitDetectionCanvas_ = - function(renderOptions, context, x, y) { +ol.style.RegularShape.prototype.drawHitDetectionCanvas_ = function(renderOptions, context, x, y) { // reset transform context.setTransform(1, 0, 0, 1, 0, 0); diff --git a/src/ol/style/strokestyle.js b/src/ol/style/strokestyle.js index a103c80eb9..0c75cb4f6e 100644 --- a/src/ol/style/strokestyle.js +++ b/src/ol/style/strokestyle.js @@ -5,7 +5,6 @@ goog.require('goog.crypt.Md5'); goog.require('ol.color'); - /** * @classdesc * Set stroke style for vector features. diff --git a/src/ol/style/style.js b/src/ol/style/style.js index 46420cc44e..a494d2d62a 100644 --- a/src/ol/style/style.js +++ b/src/ol/style/style.js @@ -12,7 +12,6 @@ goog.require('ol.style.Image'); goog.require('ol.style.Stroke'); - /** * @classdesc * Container for vector feature rendering styles. Any changes made to the style diff --git a/src/ol/style/textstyle.js b/src/ol/style/textstyle.js index 926405dc74..4f62e83b69 100644 --- a/src/ol/style/textstyle.js +++ b/src/ol/style/textstyle.js @@ -4,7 +4,6 @@ goog.provide('ol.style.Text'); goog.require('ol.style.Fill'); - /** * @classdesc * Set text style for vector features. diff --git a/src/ol/tile.js b/src/ol/tile.js index 7f5d02759b..590addbc8c 100644 --- a/src/ol/tile.js +++ b/src/ol/tile.js @@ -19,7 +19,6 @@ ol.TileState = { }; - /** * @classdesc * Base class for tiles. @@ -91,7 +90,7 @@ ol.Tile.prototype.getKey = function() { /** * Get the tile coordinate for this tile. - * @return {ol.TileCoord} + * @return {ol.TileCoord} The tile coordinate. * @api */ ol.Tile.prototype.getTileCoord = function() { diff --git a/src/ol/tilecache.js b/src/ol/tilecache.js index a06962f998..0726171e38 100644 --- a/src/ol/tilecache.js +++ b/src/ol/tilecache.js @@ -6,7 +6,6 @@ goog.require('ol.structs.LRUCache'); goog.require('ol.tilecoord'); - /** * @constructor * @extends {ol.structs.LRUCache.} diff --git a/src/ol/tilegrid/tilegrid.js b/src/ol/tilegrid/tilegrid.js index e640b646c1..87df9da396 100644 --- a/src/ol/tilegrid/tilegrid.js +++ b/src/ol/tilegrid/tilegrid.js @@ -19,7 +19,6 @@ goog.require('ol.size'); goog.require('ol.tilecoord'); - /** * @classdesc * Base class for setting the grid pattern for sources accessing tiled-image @@ -163,8 +162,7 @@ ol.tilegrid.TileGrid.tmpTileCoord_ = [0, 0, 0]; * @return {boolean} Callback succeeded. * @template T */ -ol.tilegrid.TileGrid.prototype.forEachTileCoordParentTileRange = - function(tileCoord, callback, opt_this, opt_tileRange, opt_extent) { +ol.tilegrid.TileGrid.prototype.forEachTileCoordParentTileRange = function(tileCoord, callback, opt_this, opt_tileRange, opt_extent) { var tileCoordExtent = this.getTileCoordExtent(tileCoord, opt_extent); var z = tileCoord[0] - 1; while (z >= this.minZoom) { @@ -257,8 +255,7 @@ ol.tilegrid.TileGrid.prototype.getResolutions = function() { * @param {ol.Extent=} opt_extent Temporary ol.Extent object. * @return {ol.TileRange} Tile range. */ -ol.tilegrid.TileGrid.prototype.getTileCoordChildTileRange = - function(tileCoord, opt_tileRange, opt_extent) { +ol.tilegrid.TileGrid.prototype.getTileCoordChildTileRange = function(tileCoord, opt_tileRange, opt_extent) { if (tileCoord[0] < this.maxZoom) { var tileCoordExtent = this.getTileCoordExtent(tileCoord, opt_extent); return this.getTileRangeForExtentAndZ( @@ -275,8 +272,7 @@ ol.tilegrid.TileGrid.prototype.getTileCoordChildTileRange = * @param {ol.Extent=} opt_extent Temporary ol.Extent object. * @return {ol.Extent} Extent. */ -ol.tilegrid.TileGrid.prototype.getTileRangeExtent = - function(z, tileRange, opt_extent) { +ol.tilegrid.TileGrid.prototype.getTileRangeExtent = function(z, tileRange, opt_extent) { var origin = this.getOrigin(z); var resolution = this.getResolution(z); var tileSize = ol.size.toSize(this.getTileSize(z), this.tmpSize_); @@ -294,8 +290,7 @@ ol.tilegrid.TileGrid.prototype.getTileRangeExtent = * @param {ol.TileRange=} opt_tileRange Temporary tile range object. * @return {ol.TileRange} Tile range. */ -ol.tilegrid.TileGrid.prototype.getTileRangeForExtentAndResolution = - function(extent, resolution, opt_tileRange) { +ol.tilegrid.TileGrid.prototype.getTileRangeForExtentAndResolution = function(extent, resolution, opt_tileRange) { var tileCoord = ol.tilegrid.TileGrid.tmpTileCoord_; this.getTileCoordForXYAndResolution_( extent[0], extent[1], resolution, false, tileCoord); @@ -314,8 +309,7 @@ ol.tilegrid.TileGrid.prototype.getTileRangeForExtentAndResolution = * @param {ol.TileRange=} opt_tileRange Temporary tile range object. * @return {ol.TileRange} Tile range. */ -ol.tilegrid.TileGrid.prototype.getTileRangeForExtentAndZ = - function(extent, z, opt_tileRange) { +ol.tilegrid.TileGrid.prototype.getTileRangeForExtentAndZ = function(extent, z, opt_tileRange) { var resolution = this.getResolution(z); return this.getTileRangeForExtentAndResolution( extent, resolution, opt_tileRange); @@ -345,8 +339,7 @@ ol.tilegrid.TileGrid.prototype.getTileCoordCenter = function(tileCoord) { * @return {ol.Extent} Extent. * @api */ -ol.tilegrid.TileGrid.prototype.getTileCoordExtent = - function(tileCoord, opt_extent) { +ol.tilegrid.TileGrid.prototype.getTileCoordExtent = function(tileCoord, opt_extent) { var origin = this.getOrigin(tileCoord[0]); var resolution = this.getResolution(tileCoord[0]); var tileSize = ol.size.toSize(this.getTileSize(tileCoord[0]), this.tmpSize_); @@ -369,8 +362,7 @@ ol.tilegrid.TileGrid.prototype.getTileCoordExtent = * @return {ol.TileCoord} Tile coordinate. * @api */ -ol.tilegrid.TileGrid.prototype.getTileCoordForCoordAndResolution = - function(coordinate, resolution, opt_tileCoord) { +ol.tilegrid.TileGrid.prototype.getTileCoordForCoordAndResolution = function(coordinate, resolution, opt_tileCoord) { return this.getTileCoordForXYAndResolution_( coordinate[0], coordinate[1], resolution, false, opt_tileCoord); }; @@ -421,8 +413,7 @@ ol.tilegrid.TileGrid.prototype.getTileCoordForXYAndResolution_ = function( * @return {ol.TileCoord} Tile coordinate. * @api */ -ol.tilegrid.TileGrid.prototype.getTileCoordForCoordAndZ = - function(coordinate, z, opt_tileCoord) { +ol.tilegrid.TileGrid.prototype.getTileCoordForCoordAndZ = function(coordinate, z, opt_tileCoord) { var resolution = this.getResolution(z); return this.getTileCoordForXYAndResolution_( coordinate[0], coordinate[1], resolution, false, opt_tileCoord); @@ -528,8 +519,7 @@ ol.tilegrid.getForProjection = function(projection) { * ol.extent.Corner.TOP_LEFT). * @return {ol.tilegrid.TileGrid} TileGrid instance. */ -ol.tilegrid.createForExtent = - function(extent, opt_maxZoom, opt_tileSize, opt_corner) { +ol.tilegrid.createForExtent = function(extent, opt_maxZoom, opt_tileSize, opt_corner) { var corner = opt_corner !== undefined ? opt_corner : ol.extent.Corner.TOP_LEFT; @@ -575,8 +565,7 @@ ol.tilegrid.createXYZ = function(opt_options) { * ol.DEFAULT_TILE_SIZE). * @return {!Array.} Resolutions array. */ -ol.tilegrid.resolutionsFromExtent = - function(extent, opt_maxZoom, opt_tileSize) { +ol.tilegrid.resolutionsFromExtent = function(extent, opt_maxZoom, opt_tileSize) { var maxZoom = opt_maxZoom !== undefined ? opt_maxZoom : ol.DEFAULT_MAX_ZOOM; @@ -606,8 +595,7 @@ ol.tilegrid.resolutionsFromExtent = * ol.extent.Corner.BOTTOM_LEFT). * @return {ol.tilegrid.TileGrid} TileGrid instance. */ -ol.tilegrid.createForProjection = - function(projection, opt_maxZoom, opt_tileSize, opt_corner) { +ol.tilegrid.createForProjection = function(projection, opt_maxZoom, opt_tileSize, opt_corner) { var extent = ol.tilegrid.extentFromProjection(projection); return ol.tilegrid.createForExtent( extent, opt_maxZoom, opt_tileSize, opt_corner); diff --git a/src/ol/tilegrid/wmtstilegrid.js b/src/ol/tilegrid/wmtstilegrid.js index e13060b9b6..6036c44472 100644 --- a/src/ol/tilegrid/wmtstilegrid.js +++ b/src/ol/tilegrid/wmtstilegrid.js @@ -5,7 +5,6 @@ goog.require('ol.proj'); goog.require('ol.tilegrid.TileGrid'); - /** * @classdesc * Set the grid pattern for sources accessing WMTS tiled-image servers. @@ -74,8 +73,7 @@ ol.tilegrid.WMTS.prototype.getMatrixIds = function() { * @return {ol.tilegrid.WMTS} WMTS tileGrid instance. * @api */ -ol.tilegrid.WMTS.createFromCapabilitiesMatrixSet = - function(matrixSet, opt_extent) { +ol.tilegrid.WMTS.createFromCapabilitiesMatrixSet = function(matrixSet, opt_extent) { /** @type {!Array.} */ var resolutions = []; diff --git a/src/ol/tilequeue.js b/src/ol/tilequeue.js index 20a27fab57..ba11c36f58 100644 --- a/src/ol/tilequeue.js +++ b/src/ol/tilequeue.js @@ -14,7 +14,6 @@ goog.require('ol.structs.PriorityQueue'); ol.TilePriorityFunction; - /** * @constructor * @extends {ol.structs.PriorityQueue.} diff --git a/src/ol/tilerange.js b/src/ol/tilerange.js index 1052149c91..bd1f041d0b 100644 --- a/src/ol/tilerange.js +++ b/src/ol/tilerange.js @@ -5,7 +5,6 @@ goog.require('ol.Size'); goog.require('ol.TileCoord'); - /** * A representation of a contiguous block of tiles. A tile range is specified * by its min/max tile coordinates and is inclusive of coordinates. diff --git a/src/ol/tileurlfunction.js b/src/ol/tileurlfunction.js index 2353f42454..49533af14a 100644 --- a/src/ol/tileurlfunction.js +++ b/src/ol/tileurlfunction.js @@ -122,8 +122,7 @@ ol.TileUrlFunction.createFromTileUrlFunctions = function(tileUrlFunctions) { * @param {ol.proj.Projection} projection Projection. * @return {string|undefined} Tile URL. */ -ol.TileUrlFunction.nullTileUrlFunction = - function(tileCoord, pixelRatio, projection) { +ol.TileUrlFunction.nullTileUrlFunction = function(tileCoord, pixelRatio, projection) { return undefined; }; diff --git a/src/ol/vectortile.js b/src/ol/vectortile.js index 55e22eb4cb..6a493ba78a 100644 --- a/src/ol/vectortile.js +++ b/src/ol/vectortile.js @@ -18,7 +18,6 @@ goog.require('ol.proj.Projection'); ol.TileReplayState; - /** * @constructor * @extends {ol.Tile} @@ -29,8 +28,7 @@ ol.TileReplayState; * @param {ol.TileLoadFunctionType} tileLoadFunction Tile load function. * @param {ol.proj.Projection} projection Feature projection. */ -ol.VectorTile = - function(tileCoord, state, src, format, tileLoadFunction, projection) { +ol.VectorTile = function(tileCoord, state, src, format, tileLoadFunction, projection) { goog.base(this, tileCoord, state); @@ -92,7 +90,7 @@ goog.inherits(ol.VectorTile, ol.Tile); /** - * @return {CanvasRenderingContext2D} + * @return {CanvasRenderingContext2D} The rendering context. */ ol.VectorTile.prototype.getContext = function() { return this.context_; @@ -126,7 +124,7 @@ ol.VectorTile.prototype.getFeatures = function() { /** - * @return {ol.TileReplayState} + * @return {ol.TileReplayState} The replay state. */ ol.VectorTile.prototype.getReplayState = function() { return this.replayState_; diff --git a/src/ol/view.js b/src/ol/view.js index 6aebea294f..9bec014084 100644 --- a/src/ol/view.js +++ b/src/ol/view.js @@ -40,7 +40,6 @@ ol.ViewHint = { }; - /** * @classdesc * An ol.View object represents a simple 2D view of the map. @@ -633,7 +632,7 @@ ol.View.prototype.setZoom = function(zoom) { /** * @param {olx.ViewOptions} options View options. * @private - * @return {ol.CenterConstraintType} + * @return {ol.CenterConstraintType} The constraint. */ ol.View.createCenterConstraint_ = function(options) { if (options.extent !== undefined) { @@ -648,7 +647,7 @@ ol.View.createCenterConstraint_ = function(options) { * @private * @param {olx.ViewOptions} options View options. * @return {{constraint: ol.ResolutionConstraintType, maxResolution: number, - * minResolution: number}} + * minResolution: number}} The constraint. */ ol.View.createResolutionConstraint_ = function(options) { var resolutionConstraint; diff --git a/src/ol/webgl/buffer.js b/src/ol/webgl/buffer.js index 023847fc78..6374f5bd51 100644 --- a/src/ol/webgl/buffer.js +++ b/src/ol/webgl/buffer.js @@ -14,7 +14,6 @@ ol.webgl.BufferUsage = { }; - /** * @constructor * @param {Array.=} opt_arr Array. diff --git a/src/ol/webgl/context.js b/src/ol/webgl/context.js index 9792c70e9e..2758874cb0 100644 --- a/src/ol/webgl/context.js +++ b/src/ol/webgl/context.js @@ -17,7 +17,6 @@ goog.require('ol.webgl.WebGLContextEventType'); ol.webgl.BufferCacheEntry; - /** * @classdesc * A WebGL context for accessing low-level WebGL capabilities. @@ -356,7 +355,7 @@ ol.webgl.Context.prototype.logger_ = goog.log.getLogger('ol.webgl.Context'); * @param {WebGLRenderingContext} gl WebGL rendering context. * @param {number=} opt_wrapS wrapS. * @param {number=} opt_wrapT wrapT. - * @return {WebGLTexture} + * @return {WebGLTexture} The texture. * @private */ ol.webgl.Context.createTexture_ = function(gl, opt_wrapS, opt_wrapT) { @@ -384,7 +383,7 @@ ol.webgl.Context.createTexture_ = function(gl, opt_wrapS, opt_wrapT) { * @param {number} height Height. * @param {number=} opt_wrapS wrapS. * @param {number=} opt_wrapT wrapT. - * @return {WebGLTexture} + * @return {WebGLTexture} The texture. */ ol.webgl.Context.createEmptyTexture = function( gl, width, height, opt_wrapS, opt_wrapT) { @@ -402,7 +401,7 @@ ol.webgl.Context.createEmptyTexture = function( * @param {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} image Image. * @param {number=} opt_wrapS wrapS. * @param {number=} opt_wrapT wrapT. - * @return {WebGLTexture} + * @return {WebGLTexture} The texture. */ ol.webgl.Context.createTexture = function(gl, image, opt_wrapS, opt_wrapT) { var texture = ol.webgl.Context.createTexture_(gl, opt_wrapS, opt_wrapT); diff --git a/src/ol/webgl/shader.js b/src/ol/webgl/shader.js index b60d437e3e..5c2909ec7a 100644 --- a/src/ol/webgl/shader.js +++ b/src/ol/webgl/shader.js @@ -8,7 +8,6 @@ goog.require('goog.webgl'); goog.require('ol.webgl'); - /** * @constructor * @param {string} source Source. @@ -45,7 +44,6 @@ ol.webgl.Shader.prototype.getSource = function() { ol.webgl.Shader.prototype.isAnimated = goog.functions.FALSE; - /** * @constructor * @extends {ol.webgl.Shader} @@ -66,7 +64,6 @@ ol.webgl.shader.Fragment.prototype.getType = function() { }; - /** * @constructor * @extends {ol.webgl.Shader} diff --git a/src/ol/webgl/shader.mustache b/src/ol/webgl/shader.mustache index 6d22c1be9e..bfab3c44f7 100644 --- a/src/ol/webgl/shader.mustache +++ b/src/ol/webgl/shader.mustache @@ -7,7 +7,6 @@ goog.provide('{{className}}Vertex'); goog.require('ol.webgl.shader'); - /** * @constructor * @extends {ol.webgl.shader.Fragment} @@ -43,7 +42,6 @@ goog.addSingletonGetter({{className}}Fragment); {{className}}Fragment.OPTIMIZED_SOURCE; - /** * @constructor * @extends {ol.webgl.shader.Vertex} @@ -79,7 +77,6 @@ goog.addSingletonGetter({{className}}Vertex); {{className}}Vertex.OPTIMIZED_SOURCE; - /** * @constructor * @param {WebGLRenderingContext} gl GL. diff --git a/src/ol/webgl/webgl.js b/src/ol/webgl/webgl.js index 2ed574eea0..cd74b587e0 100644 --- a/src/ol/webgl/webgl.js +++ b/src/ol/webgl/webgl.js @@ -38,6 +38,7 @@ ol.webgl.getContext = function(canvas, opt_attributes) { return /** @type {!WebGLRenderingContext} */ (context); } } catch (e) { + // pass } } return null; diff --git a/src/ol/xml.js b/src/ol/xml.js index 203bd60428..3a681947e3 100644 --- a/src/ol/xml.js +++ b/src/ol/xml.js @@ -436,8 +436,7 @@ ol.xml.makeReplacer = function(valueReader, opt_this) { * @return {ol.xml.Parser} Parser. * @template T */ -ol.xml.makeObjectPropertyPusher = - function(valueReader, opt_property, opt_this) { +ol.xml.makeObjectPropertyPusher = function(valueReader, opt_property, opt_this) { goog.asserts.assert(valueReader !== undefined, 'undefined valueReader, expected function(this: T, Node, Array.<*>)'); return ( @@ -470,8 +469,7 @@ ol.xml.makeObjectPropertyPusher = * @return {ol.xml.Parser} Parser. * @template T */ -ol.xml.makeObjectPropertySetter = - function(valueReader, opt_property, opt_this) { +ol.xml.makeObjectPropertySetter = function(valueReader, opt_property, opt_this) { goog.asserts.assert(valueReader !== undefined, 'undefined valueReader, expected function(this: T, Node, Array.<*>)'); return ( diff --git a/tasks/.jshintrc b/tasks/.jshintrc deleted file mode 100644 index 3c2c4aa041..0000000000 --- a/tasks/.jshintrc +++ /dev/null @@ -1,22 +0,0 @@ -{ - "curly": true, - "eqeqeq": true, - "indent": 2, - "latedef": true, - "newcap": true, - "nonew": true, - "quotmark": "single", - "undef": true, - "trailing": true, - "maxlen": 80, - "globals": { - "Buffer": false, - "__dirname": false, - "__filename": false, - "exports": true, - "module": false, - "process": false, - "require": false, - "setImmediate": false - } -} diff --git a/tasks/build-examples.js b/tasks/build-examples.js index 531339aeda..25e8eb7628 100644 --- a/tasks/build-examples.js +++ b/tasks/build-examples.js @@ -7,9 +7,7 @@ var marked = require('marked'); var pkg = require('../package.json'); var markupRegEx = /([^\/^\.]*)\.html$/; -/* jshint -W101 */ var cleanupJSRegEx = /.*(\/\/ NOCOMPILE|goog\.require\(.*\);|.*renderer: common\..*,?)[\n]*/g; -/* jshint +W101 */ var requiresRegEx = /.*goog\.require\('(ol\.\S*)'\);/g; var isCssRegEx = /\.css$/; var isJsRegEx = /\.js$/; @@ -48,7 +46,7 @@ function getLinkToApiHtml(requires) { var lis = requires.map(function(symb) { var href = '../apidoc/' + symb + '.html'; return '
  • ' + symb + '
  • '; + symb + '">' + symb + ''; }); return '
      ' + lis.join() + '
    '; } @@ -135,7 +133,7 @@ function augmentExamples(files, metalsmith, done) { } file.extraHead = { local: resources.join('\n'), - remote: remoteResources.join('\n'), + remote: remoteResources.join('\n') }; file.extraResources = file.resources.length ? ',' + fiddleResources.join(',') : ''; diff --git a/tasks/build-ext.js b/tasks/build-ext.js index f64923b3e9..a880c75fb2 100644 --- a/tasks/build-ext.js +++ b/tasks/build-ext.js @@ -66,8 +66,7 @@ function wrapModule(mod, callback) { }; if (mod.browserify) { - var b = browserify(mod.main, {standalone: mod.name}). - bundle(function(err, buf) { + browserify(mod.main, {standalone: mod.name}).bundle(function(err, buf) { if (err) { callback(err); return; diff --git a/tasks/generate-exports.js b/tasks/generate-exports.js index 3394e670f4..38e5eea736 100644 --- a/tasks/generate-exports.js +++ b/tasks/generate-exports.js @@ -1,5 +1,4 @@ var fs = require('fs'); -var path = require('path'); var async = require('async'); var fse = require('fs-extra'); diff --git a/tasks/generate-externs.js b/tasks/generate-externs.js index c0c9d20559..d02ef04478 100644 --- a/tasks/generate-externs.js +++ b/tasks/generate-externs.js @@ -1,6 +1,3 @@ -var fs = require('fs'); -var path = require('path'); - var async = require('async'); var fse = require('fs-extra'); var nomnom = require('nomnom'); diff --git a/tasks/generate-info.js b/tasks/generate-info.js index 1523c0a6a4..a2961f01b8 100644 --- a/tasks/generate-info.js +++ b/tasks/generate-info.js @@ -109,7 +109,7 @@ function getNewer(date, newer, callback) { * pass the sourceDir to the task so it can do the walking. */ if (isWindows) { - paths = [sourceDir].concat(externsPaths); + paths = [sourceDir].concat(externsPaths); } callback(null, newer ? paths : []); diff --git a/tasks/install.js b/tasks/install.js index d3850dc968..68d8465a43 100644 --- a/tasks/install.js +++ b/tasks/install.js @@ -1,5 +1,3 @@ -var async = require('async'); - var buildExt = require('./build-ext'); buildExt(function(err) { diff --git a/tasks/serve-lib.js b/tasks/serve-lib.js index 808118ece1..8a6f9d721e 100644 --- a/tasks/serve-lib.js +++ b/tasks/serve-lib.js @@ -4,7 +4,6 @@ */ var path = require('path'); -var url = require('url'); var closure = require('closure-util'); var nomnom = require('nomnom'); @@ -21,7 +20,7 @@ var createServer = exports.createServer = function(callback) { var manager = new closure.Manager({ lib: [ 'src/**/*.js', - 'build/ol.ext/*.js', + 'build/ol.ext/*.js' ], cwd: path.join(__dirname, '..') }); diff --git a/tasks/test-coverage.js b/tasks/test-coverage.js index 2d4152b90f..5aa3e43476 100644 --- a/tasks/test-coverage.js +++ b/tasks/test-coverage.js @@ -43,8 +43,9 @@ var copyOpts = { /** * A small utility method printing out log messages. + * @param {string} msg The message. */ -var log = function(msg){ +var log = function(msg) { process.stdout.write(msg + '\n'); }; @@ -54,12 +55,13 @@ var log = function(msg){ * * See http://www.geedew.com/remove-a-directory-that-is-not-empty-in-nodejs/ * adjusted to use path.join + * @param {string} p Path to the directory. */ var deleteFolderRecursive = function(p) { - if( fs.existsSync(p) ) { - fs.readdirSync(p).forEach(function(file,index){ + if (fs.existsSync(p)) { + fs.readdirSync(p).forEach(function(file,index) { var curPath = path.join(p, file); - if(fs.lstatSync(curPath).isDirectory()) { // recurse + if (fs.lstatSync(curPath).isDirectory()) { // recurse deleteFolderRecursive(curPath); } else { // delete file fs.unlinkSync(curPath); @@ -73,7 +75,7 @@ var deleteFolderRecursive = function(p) { * Creates folders for backup and instrumentation and copies the contents of the * current src folder into them. */ -var setupBackupAndInstrumentationDir = function(){ +var setupBackupAndInstrumentationDir = function() { if (!fs.existsSync(backupDir)) { log('• create directory for backup of src: ' + backupDir); fs.mkdirSync(backupDir); @@ -95,7 +97,7 @@ var setupBackupAndInstrumentationDir = function(){ * backup over the src directory and removes the instrumentation and backup * directory. */ -var revertBackupAndInstrumentationDir = function(){ +var revertBackupAndInstrumentationDir = function() { log('• copy original src back to src folder'); wrench.copyDirSyncRecursive(backupDir, dir, copyOpts); log('• delete backup directory'); @@ -108,7 +110,7 @@ var revertBackupAndInstrumentationDir = function(){ /** * Callback for when runTestsuite() has finished. */ -var collectAndWriteCoverageData = function(code) { +var collectAndWriteCoverageData = function() { log('• collect data from coverage.json'); var coverageFile = path.join(__dirname,'../coverage/coverage.json'); @@ -120,7 +122,7 @@ var collectAndWriteCoverageData = function(code) { revertBackupAndInstrumentationDir(); log('• write report from collected data'); - reporter.write(collector, true, function () { + reporter.write(collector, true, function() { process.exit(0); }); }; @@ -128,6 +130,8 @@ var collectAndWriteCoverageData = function(code) { /** * Will instrument all JavaScript files that are passed as second parameter. * This is the callback to the glob call. + * @param {Error} err Any error. + * @param {Array.} files List of file paths. */ var foundAllJavaScriptSourceFiles = function(err, files) { if (err) { @@ -168,17 +172,13 @@ var foundAllJavaScriptSourceFiles = function(err, files) { * coverage process by gathering all JavaScript files and then instrumenting * them. */ -var main = function(){ +var main = function() { setupBackupAndInstrumentationDir(); glob(dir + '/**/*.js', {}, foundAllJavaScriptSourceFiles); }; - - if (require.main === module) { main(); } module.exports = main; - - diff --git a/tasks/test-rendering.js b/tasks/test-rendering.js index 9df2f2bc1b..fdb29c7290 100644 --- a/tasks/test-rendering.js +++ b/tasks/test-rendering.js @@ -3,7 +3,6 @@ * and Closure Library and runs rendering tests in SlimerJS. */ -var fs = require('fs'); var path = require('path'); var spawn = require('child_process').spawn; diff --git a/tasks/test.js b/tasks/test.js index 48a96c56ab..6ce93f0116 100644 --- a/tasks/test.js +++ b/tasks/test.js @@ -64,7 +64,7 @@ function runTests(includeCoverage, callback) { ]; var config = { ignoreResourceErrors: true, - useColors: true, + useColors: true }; if (includeCoverage) { @@ -82,7 +82,7 @@ function runTests(includeCoverage, callback) { } if (require.main === module) { - runTests(false, function(code){ + runTests(false, function(code) { process.exit(code); }); } diff --git a/test/phantom_hooks.js b/test/phantom_hooks.js index 5f2fa839b6..5880770711 100644 --- a/test/phantom_hooks.js +++ b/test/phantom_hooks.js @@ -1,3 +1,5 @@ +/* eslint-disable no-console */ + module.exports = { afterEnd: function(runner) { var fs = require('fs'); diff --git a/test/spec/.eslintrc b/test/spec/.eslintrc new file mode 100644 index 0000000000..509c93fc5c --- /dev/null +++ b/test/spec/.eslintrc @@ -0,0 +1,11 @@ +{ + "env": { + "mocha": true + }, + "globals": { + "afterLoadText": false, + "expect": false, + "proj4": false, + "sinon": false + } +} diff --git a/test/spec/ol/control/zoomslidercontrol.test.js b/test/spec/ol/control/zoomslidercontrol.test.js index b9e73a4062..d3cb78ada9 100644 --- a/test/spec/ol/control/zoomslidercontrol.test.js +++ b/test/spec/ol/control/zoomslidercontrol.test.js @@ -25,26 +25,22 @@ describe('ol.control.ZoomSlider', function() { describe('DOM creation', function() { it('creates the expected DOM elements', function() { var zoomSliderContainers = goog.dom.getElementsByClass( - 'ol-zoomslider', target), - zoomSliderContainer, - zoomSliderThumbs, - zoomSliderThumb, - hasUnselectableCls; + 'ol-zoomslider', target); expect(zoomSliderContainers.length).to.be(1); - zoomSliderContainer = zoomSliderContainers[0]; + var zoomSliderContainer = zoomSliderContainers[0]; expect(zoomSliderContainer instanceof HTMLDivElement).to.be(true); - hasUnselectableCls = goog.dom.classlist.contains(zoomSliderContainer, + var hasUnselectableCls = goog.dom.classlist.contains(zoomSliderContainer, 'ol-unselectable'); expect(hasUnselectableCls).to.be(true); - zoomSliderThumbs = goog.dom.getElementsByClass('ol-zoomslider-thumb', + var zoomSliderThumbs = goog.dom.getElementsByClass('ol-zoomslider-thumb', zoomSliderContainer); expect(zoomSliderThumbs.length).to.be(1); - zoomSliderThumb = zoomSliderThumbs[0]; + var zoomSliderThumb = zoomSliderThumbs[0]; expect(zoomSliderThumb instanceof HTMLButtonElement).to.be(true); hasUnselectableCls = goog.dom.classlist.contains(zoomSliderThumb, diff --git a/test/spec/ol/coordinate.test.js b/test/spec/ol/coordinate.test.js index dd0176b55a..7eb88841e8 100644 --- a/test/spec/ol/coordinate.test.js +++ b/test/spec/ol/coordinate.test.js @@ -3,8 +3,7 @@ goog.provide('ol.test.coordinate'); describe('ol.coordinate', function() { describe('#add', function() { - var coordinate, - delta; + var coordinate, delta; beforeEach(function() { coordinate = [50.73, 7.1]; @@ -31,13 +30,13 @@ describe('ol.coordinate', function() { }); describe('#equals', function() { - var cologne = [50.93333, 6.95], - bonn1 = [50.73, 7.1], - bonn2 = [50.73000, 7.10000]; + var cologne = [50.93333, 6.95]; + var bonn1 = [50.73, 7.1]; + var bonn2 = [50.73000, 7.10000]; it('compares correctly', function() { - var bonnEqualsBonn = ol.coordinate.equals(bonn1, bonn2), - bonnEqualsCologne = ol.coordinate.equals(bonn1, cologne); + var bonnEqualsBonn = ol.coordinate.equals(bonn1, bonn2); + var bonnEqualsCologne = ol.coordinate.equals(bonn1, cologne); expect(bonnEqualsBonn).to.be(true); expect(bonnEqualsCologne).to.be(false); }); @@ -61,9 +60,7 @@ describe('ol.coordinate', function() { }); describe('#createStringXY', function() { - var coordinate, - created, - formatted; + var coordinate, created, formatted; beforeEach(function() { coordinate = [6.6123, 46.7919]; created = null; diff --git a/test/spec/ol/featureloader.test.js b/test/spec/ol/featureloader.test.js index 40ce61b03a..e05849f2e6 100644 --- a/test/spec/ol/featureloader.test.js +++ b/test/spec/ol/featureloader.test.js @@ -27,7 +27,8 @@ describe('ol.featureloader', function() { describe('when called with urlFunction', function() { it('adds features to the source', function(done) { url = function(extent, resolution, projection) { - return 'spec/ol/data/point.json';}; + return 'spec/ol/data/point.json'; + }; loader = ol.featureloader.xhr(url, format); source.on(ol.source.VectorEventType.ADDFEATURE, function(e) { diff --git a/test/spec/ol/format/esrijsonformat.test.js b/test/spec/ol/format/esrijsonformat.test.js index 41956080bd..ded24d1e4a 100644 --- a/test/spec/ol/format/esrijsonformat.test.js +++ b/test/spec/ol/format/esrijsonformat.test.js @@ -67,24 +67,22 @@ describe('ol.format.EsriJSON', function() { var multiPolygonEsriJSON = { geometry: { - rings: [ - [ - [0, 1], - [1, 4], - [4, 3], - [3, 0] - ], [ - [2, 2], - [3, 2], - [3, 3], - [2, 3] - ], [ - [10, 1], - [11, 5], - [14, 3], - [13, 0] - ] - ] + rings: [[ + [0, 1], + [1, 4], + [4, 3], + [3, 0] + ], [ + [2, 2], + [3, 2], + [3, 3], + [2, 3] + ], [ + [10, 1], + [11, 5], + [14, 3], + [13, 0] + ]] } }; @@ -93,62 +91,60 @@ describe('ol.format.EsriJSON', function() { }; var data = { - features: [ - { - attributes: { - 'LINK_ID': 573730499, - 'RP_TYPE': 14, - 'RP_FUNC': 0, - 'DIRECTION': 2, - 'LOGKOD': '', - 'CHANGED': '', - 'USERID': '', - 'ST_NAME': '', - 'L_REFADDR': '', - 'L_NREFADDR': '', - 'R_REFADDR': '', - 'R_NREFADDR': '', - 'SPEED_CAT': '7', - 'ZIPCODE': '59330', - 'SHAPE_LEN': 46.3826 - }, - geometry: { - paths: [[ - [1549497.66985, 6403707.96], - [1549491.1, 6403710.1], - [1549488.03995, 6403716.7504], - [1549488.5401, 6403724.5504], - [1549494.37985, 6403733.54], - [1549499.6799, 6403738.0504], - [1549506.22, 6403739.2504] - ]] - } - }, { - attributes: { - 'LINK_ID': 30760556, - 'RP_TYPE': 12, - 'RP_FUNC': 1, - 'DIRECTION': 0, - 'LOGKOD': '', - 'CHANGED': '', - 'USERID': '', - 'ST_NAME': 'BRUNNSGATAN', - 'L_REFADDR': '24', - 'L_NREFADDR': '16', - 'R_REFADDR': '', - 'R_NREFADDR': '', - 'SPEED_CAT': '7', - 'ZIPCODE': '59330', - 'SHAPE_LEN': 70.3106 - }, - geometry: { - paths: [[ - [1549754.2769, 6403854.8024], - [1549728.45985, 6403920.2] - ]] - } + features: [{ + attributes: { + 'LINK_ID': 573730499, + 'RP_TYPE': 14, + 'RP_FUNC': 0, + 'DIRECTION': 2, + 'LOGKOD': '', + 'CHANGED': '', + 'USERID': '', + 'ST_NAME': '', + 'L_REFADDR': '', + 'L_NREFADDR': '', + 'R_REFADDR': '', + 'R_NREFADDR': '', + 'SPEED_CAT': '7', + 'ZIPCODE': '59330', + 'SHAPE_LEN': 46.3826 + }, + geometry: { + paths: [[ + [1549497.66985, 6403707.96], + [1549491.1, 6403710.1], + [1549488.03995, 6403716.7504], + [1549488.5401, 6403724.5504], + [1549494.37985, 6403733.54], + [1549499.6799, 6403738.0504], + [1549506.22, 6403739.2504] + ]] } - ] + }, { + attributes: { + 'LINK_ID': 30760556, + 'RP_TYPE': 12, + 'RP_FUNC': 1, + 'DIRECTION': 0, + 'LOGKOD': '', + 'CHANGED': '', + 'USERID': '', + 'ST_NAME': 'BRUNNSGATAN', + 'L_REFADDR': '24', + 'L_NREFADDR': '16', + 'R_REFADDR': '', + 'R_NREFADDR': '', + 'SPEED_CAT': '7', + 'ZIPCODE': '59330', + 'SHAPE_LEN': 70.3106 + }, + geometry: { + paths: [[ + [1549754.2769, 6403854.8024], + [1549728.45985, 6403920.2] + ]] + } + }] }; describe('#readFeature', function() { @@ -270,8 +266,8 @@ describe('ol.format.EsriJSON', function() { describe('#readFeatures', function() { it('parses feature collection', function() { - var str = JSON.stringify(data), - array = format.readFeatures(str); + var str = JSON.stringify(data); + var array = format.readFeatures(str); expect(array.length).to.be(2); @@ -545,12 +541,12 @@ describe('ol.format.EsriJSON', function() { }); it('parses polygon', function() { - var outer = [[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]], - inner1 = [[1, 1], [2, 1], [2, 2], [1, 2], [1, 1]], - inner2 = [[8, 8], [9, 8], [9, 9], [8, 9], [8, 8]], - str = JSON.stringify({ - rings: [outer, inner1, inner2] - }); + var outer = [[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]; + var inner1 = [[1, 1], [2, 1], [2, 2], [1, 2], [1, 1]]; + var inner2 = [[8, 8], [9, 8], [9, 9], [8, 9], [8, 8]]; + var str = JSON.stringify({ + rings: [outer, inner1, inner2] + }); var obj = format.readGeometry(str); expect(obj).to.be.a(ol.geom.Polygon); expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XY); @@ -563,13 +559,13 @@ describe('ol.format.EsriJSON', function() { }); it('parses XYZ polygon', function() { - var outer = [[0, 0, 5], [0, 10, 5], [10, 10, 5], [10, 0, 5], [0, 0, 5]], - inner1 = [[1, 1, 3], [2, 1, 3], [2, 2, 3], [1, 2, 3], [1, 1, 3]], - inner2 = [[8, 8, 2], [9, 8, 2], [9, 9, 2], [8, 9, 2], [8, 8, 2]], - str = JSON.stringify({ - rings: [outer, inner1, inner2], - hasZ: true - }); + var outer = [[0, 0, 5], [0, 10, 5], [10, 10, 5], [10, 0, 5], [0, 0, 5]]; + var inner1 = [[1, 1, 3], [2, 1, 3], [2, 2, 3], [1, 2, 3], [1, 1, 3]]; + var inner2 = [[8, 8, 2], [9, 8, 2], [9, 9, 2], [8, 9, 2], [8, 8, 2]]; + var str = JSON.stringify({ + rings: [outer, inner1, inner2], + hasZ: true + }); var obj = format.readGeometry(str); expect(obj).to.be.a(ol.geom.Polygon); expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XYZ); @@ -582,13 +578,13 @@ describe('ol.format.EsriJSON', function() { }); it('parses XYM polygon', function() { - var outer = [[0, 0, 5], [0, 10, 5], [10, 10, 5], [10, 0, 5], [0, 0, 5]], - inner1 = [[1, 1, 3], [2, 1, 3], [2, 2, 3], [1, 2, 3], [1, 1, 3]], - inner2 = [[8, 8, 2], [9, 8, 2], [9, 9, 2], [8, 9, 2], [8, 8, 2]], - str = JSON.stringify({ - rings: [outer, inner1, inner2], - hasM: true - }); + var outer = [[0, 0, 5], [0, 10, 5], [10, 10, 5], [10, 0, 5], [0, 0, 5]]; + var inner1 = [[1, 1, 3], [2, 1, 3], [2, 2, 3], [1, 2, 3], [1, 1, 3]]; + var inner2 = [[8, 8, 2], [9, 8, 2], [9, 9, 2], [8, 9, 2], [8, 8, 2]]; + var str = JSON.stringify({ + rings: [outer, inner1, inner2], + hasM: true + }); var obj = format.readGeometry(str); expect(obj).to.be.a(ol.geom.Polygon); expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XYM); @@ -601,17 +597,23 @@ describe('ol.format.EsriJSON', function() { }); it('parses XYZM polygon', function() { - var outer = [[0, 0, 5, 1], [0, 10, 5, 1], [10, 10, 5, 1], - [10, 0, 5, 1], [0, 0, 5, 1]], - inner1 = [[1, 1, 3, 2], [2, 1, 3, 2], [2, 2, 3, 2], - [1, 2, 3, 2], [1, 1, 3, 2]], - inner2 = [[8, 8, 2, 1], [9, 8, 2, 1], [9, 9, 2, 1], - [8, 9, 2, 1], [8, 8, 2, 1]], - str = JSON.stringify({ - rings: [outer, inner1, inner2], - hasZ: true, - hasM: true - }); + var outer = [ + [0, 0, 5, 1], [0, 10, 5, 1], [10, 10, 5, 1], + [10, 0, 5, 1], [0, 0, 5, 1] + ]; + var inner1 = [ + [1, 1, 3, 2], [2, 1, 3, 2], [2, 2, 3, 2], + [1, 2, 3, 2], [1, 1, 3, 2] + ]; + var inner2 = [ + [8, 8, 2, 1], [9, 8, 2, 1], [9, 9, 2, 1], + [8, 9, 2, 1], [8, 8, 2, 1] + ]; + var str = JSON.stringify({ + rings: [outer, inner1, inner2], + hasZ: true, + hasM: true + }); var obj = format.readGeometry(str); expect(obj).to.be.a(ol.geom.Polygon); expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XYZM); @@ -811,9 +813,9 @@ describe('ol.format.EsriJSON', function() { }); it('encodes polygon', function() { - var outer = [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]], - inner1 = [[1, 1], [2, 1], [2, 2], [1, 2], [1, 1]], - inner2 = [[8, 8], [9, 8], [9, 9], [8, 9], [8, 8]]; + var outer = [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]; + var inner1 = [[1, 1], [2, 1], [2, 2], [1, 2], [1, 1]]; + var inner2 = [[8, 8], [9, 8], [9, 9], [8, 9], [8, 8]]; var polygon = new ol.geom.Polygon([outer, inner1, inner2]); var esrijson = format.writeGeometry(polygon); expect(polygon.getCoordinates(false)).to.eql( @@ -821,9 +823,9 @@ describe('ol.format.EsriJSON', function() { }); it('encodes XYZ polygon', function() { - var outer = [[0, 0, 5], [0, 10, 5], [10, 10, 5], [10, 0, 5], [0, 0, 5]], - inner1 = [[1, 1, 3], [2, 1, 3], [2, 2, 3], [1, 2, 3], [1, 1, 3]], - inner2 = [[8, 8, 2], [9, 8, 2], [9, 9, 2], [8, 9, 2], [8, 8, 2]]; + var outer = [[0, 0, 5], [0, 10, 5], [10, 10, 5], [10, 0, 5], [0, 0, 5]]; + var inner1 = [[1, 1, 3], [2, 1, 3], [2, 2, 3], [1, 2, 3], [1, 1, 3]]; + var inner2 = [[8, 8, 2], [9, 8, 2], [9, 9, 2], [8, 9, 2], [8, 8, 2]]; var polygon = new ol.geom.Polygon([outer, inner1, inner2], ol.geom.GeometryLayout.XYZ); var esrijson = format.writeGeometry(polygon); @@ -832,9 +834,9 @@ describe('ol.format.EsriJSON', function() { }); it('encodes XYM polygon', function() { - var outer = [[0, 0, 5], [0, 10, 5], [10, 10, 5], [10, 0, 5], [0, 0, 5]], - inner1 = [[1, 1, 3], [2, 1, 3], [2, 2, 3], [1, 2, 3], [1, 1, 3]], - inner2 = [[8, 8, 2], [9, 8, 2], [9, 9, 2], [8, 9, 2], [8, 8, 2]]; + var outer = [[0, 0, 5], [0, 10, 5], [10, 10, 5], [10, 0, 5], [0, 0, 5]]; + var inner1 = [[1, 1, 3], [2, 1, 3], [2, 2, 3], [1, 2, 3], [1, 1, 3]]; + var inner2 = [[8, 8, 2], [9, 8, 2], [9, 9, 2], [8, 9, 2], [8, 8, 2]]; var polygon = new ol.geom.Polygon([outer, inner1, inner2], ol.geom.GeometryLayout.XYM); var esrijson = format.writeGeometry(polygon); @@ -843,12 +845,15 @@ describe('ol.format.EsriJSON', function() { }); it('encodes XYZM polygon', function() { - var outer = [[0, 0, 5, 1], [0, 10, 5, 2], [10, 10, 5, 1], - [10, 0, 5, 1], [0, 0, 5, 1]], - inner1 = [[1, 1, 3, 1], [2, 1, 3, 2], [2, 2, 3, 1], [1, 2, 3, 1], - [1, 1, 3, 1]], - inner2 = [[8, 8, 2, 1], [9, 8, 2, 2], [9, 9, 2, 1], [8, 9, 2, 1], - [8, 8, 2, 1]]; + var outer = [ + [0, 0, 5, 1], [0, 10, 5, 2], [10, 10, 5, 1], [10, 0, 5, 1], [0, 0, 5, 1] + ]; + var inner1 = [ + [1, 1, 3, 1], [2, 1, 3, 2], [2, 2, 3, 1], [1, 2, 3, 1], [1, 1, 3, 1] + ]; + var inner2 = [ + [8, 8, 2, 1], [9, 8, 2, 2], [9, 9, 2, 1], [8, 9, 2, 1], [8, 8, 2, 1] + ]; var polygon = new ol.geom.Polygon([outer, inner1, inner2], ol.geom.GeometryLayout.XYZM); var esrijson = format.writeGeometry(polygon); @@ -995,8 +1000,8 @@ describe('ol.format.EsriJSON', function() { describe('#writeFeatures', function() { it('encodes feature collection', function() { - var str = JSON.stringify(data), - array = format.readFeatures(str); + var str = JSON.stringify(data); + var array = format.readFeatures(str); var esrijson = format.writeFeaturesObject(array); var result = format.readFeatures(esrijson); expect(array.length).to.equal(result.length); @@ -1015,8 +1020,8 @@ describe('ol.format.EsriJSON', function() { }); it('transforms and encodes feature collection', function() { - var str = JSON.stringify(data), - array = format.readFeatures(str); + var str = JSON.stringify(data); + var array = format.readFeatures(str); var esrijson = format.writeFeatures(array, { featureProjection: 'EPSG:3857', dataProjection: 'EPSG:4326' diff --git a/test/spec/ol/format/geojsonformat.test.js b/test/spec/ol/format/geojsonformat.test.js index c36bbe2c91..95358095df 100644 --- a/test/spec/ol/format/geojsonformat.test.js +++ b/test/spec/ol/format/geojsonformat.test.js @@ -71,66 +71,64 @@ describe('ol.format.GeoJSON', function() { var data = { 'type': 'FeatureCollection', - 'features': [ - { - 'type': 'Feature', - 'properties': { - 'LINK_ID': 573730499, - 'RP_TYPE': 14, - 'RP_FUNC': 0, - 'DIRECTION': 2, - 'LOGKOD': '', - 'CHANGED': '', - 'USERID': '', - 'ST_NAME': '', - 'L_REFADDR': '', - 'L_NREFADDR': '', - 'R_REFADDR': '', - 'R_NREFADDR': '', - 'SPEED_CAT': '7', - 'ZIPCODE': '59330', - 'SHAPE_LEN': 46.3826 - }, - 'geometry': { - 'type': 'LineString', - 'coordinates': [ - [1549497.66985, 6403707.96], - [1549491.1, 6403710.1], - [1549488.03995, 6403716.7504], - [1549488.5401, 6403724.5504], - [1549494.37985, 6403733.54], - [1549499.6799, 6403738.0504], - [1549506.22, 6403739.2504] - ] - } - }, { - 'type': 'Feature', - 'properties': { - 'LINK_ID': 30760556, - 'RP_TYPE': 12, - 'RP_FUNC': 1, - 'DIRECTION': 0, - 'LOGKOD': '', - 'CHANGED': '', - 'USERID': '', - 'ST_NAME': 'BRUNNSGATAN', - 'L_REFADDR': '24', - 'L_NREFADDR': '16', - 'R_REFADDR': '', - 'R_NREFADDR': '', - 'SPEED_CAT': '7', - 'ZIPCODE': '59330', - 'SHAPE_LEN': 70.3106 - }, - 'geometry': { - 'type': 'LineString', - 'coordinates': [ - [1549754.2769, 6403854.8024], - [1549728.45985, 6403920.2] - ] - } + 'features': [{ + 'type': 'Feature', + 'properties': { + 'LINK_ID': 573730499, + 'RP_TYPE': 14, + 'RP_FUNC': 0, + 'DIRECTION': 2, + 'LOGKOD': '', + 'CHANGED': '', + 'USERID': '', + 'ST_NAME': '', + 'L_REFADDR': '', + 'L_NREFADDR': '', + 'R_REFADDR': '', + 'R_NREFADDR': '', + 'SPEED_CAT': '7', + 'ZIPCODE': '59330', + 'SHAPE_LEN': 46.3826 + }, + 'geometry': { + 'type': 'LineString', + 'coordinates': [ + [1549497.66985, 6403707.96], + [1549491.1, 6403710.1], + [1549488.03995, 6403716.7504], + [1549488.5401, 6403724.5504], + [1549494.37985, 6403733.54], + [1549499.6799, 6403738.0504], + [1549506.22, 6403739.2504] + ] } - ] + }, { + 'type': 'Feature', + 'properties': { + 'LINK_ID': 30760556, + 'RP_TYPE': 12, + 'RP_FUNC': 1, + 'DIRECTION': 0, + 'LOGKOD': '', + 'CHANGED': '', + 'USERID': '', + 'ST_NAME': 'BRUNNSGATAN', + 'L_REFADDR': '24', + 'L_NREFADDR': '16', + 'R_REFADDR': '', + 'R_NREFADDR': '', + 'SPEED_CAT': '7', + 'ZIPCODE': '59330', + 'SHAPE_LEN': 70.3106 + }, + 'geometry': { + 'type': 'LineString', + 'coordinates': [ + [1549754.2769, 6403854.8024], + [1549728.45985, 6403920.2] + ] + } + }] }; describe('#readFeature', function() { @@ -231,8 +229,8 @@ describe('ol.format.GeoJSON', function() { describe('#readFeatures', function() { it('parses feature collection', function() { - var str = JSON.stringify(data), - array = format.readFeatures(str); + var str = JSON.stringify(data); + var array = format.readFeatures(str); expect(array.length).to.be(2); @@ -344,13 +342,13 @@ describe('ol.format.GeoJSON', function() { }); it('parses polygon', function() { - var outer = [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]], - inner1 = [[1, 1], [2, 1], [2, 2], [1, 2], [1, 1]], - inner2 = [[8, 8], [9, 8], [9, 9], [8, 9], [8, 8]], - str = JSON.stringify({ - type: 'Polygon', - coordinates: [outer, inner1, inner2] - }); + var outer = [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]; + var inner1 = [[1, 1], [2, 1], [2, 2], [1, 2], [1, 1]]; + var inner2 = [[8, 8], [9, 8], [9, 9], [8, 9], [8, 8]]; + var str = JSON.stringify({ + type: 'Polygon', + coordinates: [outer, inner1, inner2] + }); var obj = format.readGeometry(str); expect(obj).to.be.a(ol.geom.Polygon); @@ -495,8 +493,8 @@ describe('ol.format.GeoJSON', function() { describe('#writeFeatures', function() { it('encodes feature collection', function() { - var str = JSON.stringify(data), - array = format.readFeatures(str); + var str = JSON.stringify(data); + var array = format.readFeatures(str); var geojson = format.writeFeaturesObject(array); var result = format.readFeatures(geojson); expect(array.length).to.equal(result.length); @@ -515,8 +513,8 @@ describe('ol.format.GeoJSON', function() { }); it('transforms and encodes feature collection', function() { - var str = JSON.stringify(data), - array = format.readFeatures(str); + var str = JSON.stringify(data); + var array = format.readFeatures(str); var geojson = format.writeFeatures(array, { featureProjection: 'EPSG:3857' }); @@ -576,9 +574,9 @@ describe('ol.format.GeoJSON', function() { }); it('encodes polygon', function() { - var outer = [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]], - inner1 = [[1, 1], [2, 1], [2, 2], [1, 2], [1, 1]], - inner2 = [[8, 8], [9, 8], [9, 9], [8, 9], [8, 8]]; + var outer = [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]; + var inner1 = [[1, 1], [2, 1], [2, 2], [1, 2], [1, 1]]; + var inner2 = [[8, 8], [9, 8], [9, 9], [8, 9], [8, 8]]; var polygon = new ol.geom.Polygon([outer, inner1, inner2]); var geojson = format.writeGeometry(polygon); expect(polygon.getCoordinates()).to.eql( diff --git a/test/spec/ol/format/gmlformat.test.js b/test/spec/ol/format/gmlformat.test.js index fbb8177285..7f1a0b7302 100644 --- a/test/spec/ol/format/gmlformat.test.js +++ b/test/spec/ol/format/gmlformat.test.js @@ -10,13 +10,9 @@ var readGeometry = function(format, text, opt_options) { describe('ol.format.GML2', function() { - var format, formatWGS84, formatNoSrs; + var format; beforeEach(function() { format = new ol.format.GML2({srsName: 'CRS:84'}); - formatWGS84 = new ol.format.GML2({ - srsName: 'urn:x-ogc:def:crs:EPSG:4326' - }); - formatNoSrs = new ol.format.GML2(); }); describe('#readFeatures', function() { @@ -284,7 +280,8 @@ describe('ol.format.GML3', function() { describe('axis order', function() { it('can read and write a linestring geometry with ' + - 'correct axis order', function() { + 'correct axis order', + function() { var text = '' + @@ -949,11 +946,10 @@ describe('ol.format.GML3', function() { }); describe('when parsing TOPP states WFS with autoconfigure', function() { - var features, text, gmlFormat; + var features, gmlFormat; before(function(done) { afterLoadText('spec/ol/format/gml/topp-states-wfs.xml', function(xml) { try { - text = xml; gmlFormat = new ol.format.GML(); features = gmlFormat.readFeatures(xml); } catch (e) { diff --git a/test/spec/ol/format/kmlformat.test.js b/test/spec/ol/format/kmlformat.test.js index 2daac96ad1..21ea9fe12b 100644 --- a/test/spec/ol/format/kmlformat.test.js +++ b/test/spec/ol/format/kmlformat.test.js @@ -1504,7 +1504,6 @@ describe('ol.format.KML', function() { var fs = format.readFeatures(text); - expect(fs).to.have.length(1); var f = fs[0]; expect(f).to.be.an(ol.Feature); diff --git a/test/spec/ol/format/polylineformat.test.js b/test/spec/ol/format/polylineformat.test.js index 247c5b6fc8..4830b10759 100644 --- a/test/spec/ol/format/polylineformat.test.js +++ b/test/spec/ol/format/polylineformat.test.js @@ -8,6 +8,7 @@ describe('ol.format.Polyline', function() { var floats, smallFloats, encodedFloats; var signedIntegers, encodedSignedIntegers; var unsignedIntegers, encodedUnsignedIntegers; + var points3857; function resetTestingData() { format = new ol.format.Polyline(); @@ -64,7 +65,6 @@ describe('ol.format.Polyline', function() { }); - describe('encodeFloats', function() { it('returns expected value', function() { var encodeFloats = ol.format.Polyline.encodeFloats; @@ -89,7 +89,6 @@ describe('ol.format.Polyline', function() { }); - describe('encodeSignedIntegers', function() { it('returns expected value', function() { var encodeSignedIntegers = ol.format.Polyline.encodeSignedIntegers; @@ -109,7 +108,6 @@ describe('ol.format.Polyline', function() { }); - describe('encodeUnsignedIntegers', function() { it('returns expected value', function() { var encodeUnsignedIntegers = ol.format.Polyline.encodeUnsignedIntegers; @@ -129,7 +127,6 @@ describe('ol.format.Polyline', function() { }); - describe('encodeFloat', function() { it('returns expected value', function() { var encodeFloats = ol.format.Polyline.encodeFloats; @@ -177,7 +174,6 @@ describe('ol.format.Polyline', function() { }); - describe('encodeSignedInteger', function() { it('returns expected value', function() { var encodeSignedIntegers = ol.format.Polyline.encodeSignedIntegers; @@ -215,7 +211,6 @@ describe('ol.format.Polyline', function() { }); - describe('encodeUnsignedInteger', function() { it('returns expected value', function() { var encodeUnsignedInteger = ol.format.Polyline.encodeUnsignedInteger; diff --git a/test/spec/ol/format/wfsformat.test.js b/test/spec/ol/format/wfsformat.test.js index 613bf245a3..150a575a60 100644 --- a/test/spec/ol/format/wfsformat.test.js +++ b/test/spec/ol/format/wfsformat.test.js @@ -434,7 +434,6 @@ describe('ol.format.WFS', function() { }); - describe('when writing out a GetFeature request', function() { var text; before(function(done) { diff --git a/test/spec/ol/format/wmsgetfeatureinfoformat.test.js b/test/spec/ol/format/wmsgetfeatureinfoformat.test.js index aff68e2dc0..f49f8e8129 100644 --- a/test/spec/ol/format/wmsgetfeatureinfoformat.test.js +++ b/test/spec/ol/format/wmsgetfeatureinfoformat.test.js @@ -56,7 +56,7 @@ describe('ol.format.WMSGetFeatureInfo', function() { }); it('read empty attributes', function() { - text = + var text = '' + '} events */ function trackEvents(feature, interaction) { @@ -103,8 +104,8 @@ describe('ol.interaction.Modify', function() { * Validates the event array to verify proper event sequence. Checks * that first and last event are correct ModifyEvents and that feature * modifications event are in between. - * @param {Array} event - * @param {Array} features + * @param {Array} events The events. + * @param {Array} features The features. */ function validateEvents(events, features) { @@ -160,7 +161,7 @@ describe('ol.interaction.Modify', function() { }); map.addInteraction(modify); - events = trackEvents(first, modify); + var events = trackEvents(first, modify); expect(first.getGeometry().getRevision()).to.equal(firstRevision); expect(first.getGeometry().getCoordinates()[0]).to.have.length(5); @@ -341,7 +342,7 @@ describe('ol.interaction.Modify', function() { map.addInteraction(modify); var feature = features[0]; - var listeners, listener; + var listeners; listeners = getListeners(feature, modify); expect(listeners).to.have.length(1); diff --git a/test/spec/ol/interaction/selectinteraction.test.js b/test/spec/ol/interaction/selectinteraction.test.js index c6f6fd6e87..4feac188ac 100644 --- a/test/spec/ol/interaction/selectinteraction.test.js +++ b/test/spec/ol/interaction/selectinteraction.test.js @@ -159,7 +159,6 @@ describe('ol.interaction.Select', function() { }); describe('filter features using the filter option', function() { - var select; describe('with multi set to true', function() { diff --git a/test/spec/ol/interaction/translateinteraction.test.js b/test/spec/ol/interaction/translateinteraction.test.js index 1d0504ce99..0c4b186a07 100644 --- a/test/spec/ol/interaction/translateinteraction.test.js +++ b/test/spec/ol/interaction/translateinteraction.test.js @@ -24,13 +24,13 @@ describe('ol.interaction.Translate', function() { source.addFeatures(features); var layer = new ol.layer.Vector({source: source}); map = new ol.Map({ - target: target, - layers: [layer], - view: new ol.View({ + target: target, + layers: [layer], + view: new ol.View({ projection: 'EPSG:4326', center: [0, 0], resolution: 1 - }) + }) }); map.once('postrender', function() { done(); diff --git a/test/spec/ol/math.test.js b/test/spec/ol/math.test.js index ba781f75da..fbff4e80bb 100644 --- a/test/spec/ol/math.test.js +++ b/test/spec/ol/math.test.js @@ -156,5 +156,4 @@ describe('ol.math.toRadians', function() { }); - goog.require('ol.math'); diff --git a/test/spec/ol/pointer/mousesource.test.js b/test/spec/ol/pointer/mousesource.test.js index ec6bde2800..224a9d9e26 100644 --- a/test/spec/ol/pointer/mousesource.test.js +++ b/test/spec/ol/pointer/mousesource.test.js @@ -63,14 +63,12 @@ describe('ol.pointer.MouseSource', function() { }); function simulateTouchEvent(type, x, y) { - var touches = [ - { - identifier: 4, - clientX: x, - clientY: y, - target: target - } - ]; + var touches = [{ + identifier: 4, + clientX: x, + clientY: y, + target: target + }]; var event = new goog.events.BrowserEvent({ type: type, diff --git a/test/spec/ol/proj/proj.test.js b/test/spec/ol/proj/proj.test.js index 3df67a36ad..3298dacb32 100644 --- a/test/spec/ol/proj/proj.test.js +++ b/test/spec/ol/proj/proj.test.js @@ -49,7 +49,8 @@ describe('ol.proj', function() { }); it('gives that CRS:84, urn:ogc:def:crs:EPSG:6.6:4326, EPSG:4326 are ' + - 'equivalent', function() { + 'equivalent', + function() { _testAllEquivalent([ 'CRS:84', 'urn:ogc:def:crs:EPSG:6.6:4326', @@ -461,7 +462,9 @@ describe('ol.proj', function() { units: units, extent: extent }); - var transform = function(input, output, dimension) {return input;}; + var transform = function(input, output, dimension) { + return input; + }; ol.proj.addTransform(foo, bar, transform); expect(ol.proj.transforms_).not.to.be(undefined); expect(ol.proj.transforms_.foo).not.to.be(undefined); diff --git a/test/spec/ol/renderer/canvas/canvasmaprenderer.test.js b/test/spec/ol/renderer/canvas/canvasmaprenderer.test.js index fea012cb90..6149ca3bcd 100644 --- a/test/spec/ol/renderer/canvas/canvasmaprenderer.test.js +++ b/test/spec/ol/renderer/canvas/canvasmaprenderer.test.js @@ -69,7 +69,9 @@ describe('ol.renderer.canvas.Map', function() { map.renderSync(); var cb = sinon.spy(); map.forEachFeatureAtPixel(map.getPixelFromCoordinate([0, 0]), cb, null, - function() { return false; }); + function() { + return false; + }); expect(cb).to.not.be.called(); }); @@ -96,8 +98,12 @@ describe('ol.renderer.canvas.Map', function() { renderer = map.getRenderer(); renderer.layerRenderers_ = {}; var layerRenderer = new ol.renderer.canvas.Layer(layer); - layerRenderer.prepareFrame = function() { return true; }; - layerRenderer.getImage = function() { return null; }; + layerRenderer.prepareFrame = function() { + return true; + }; + layerRenderer.getImage = function() { + return null; + }; renderer.layerRenderers_[goog.getUid(layer)] = layerRenderer; }); diff --git a/test/spec/ol/source/bingmapssource.test.js b/test/spec/ol/source/bingmapssource.test.js index a53a9f63a1..b7e1191840 100644 --- a/test/spec/ol/source/bingmapssource.test.js +++ b/test/spec/ol/source/bingmapssource.test.js @@ -70,7 +70,6 @@ describe('ol.source.BingMaps', function() { }); - }); }); diff --git a/test/spec/ol/source/imagestaticsource.test.js b/test/spec/ol/source/imagestaticsource.test.js index 6278f7b435..1d5cf2461f 100644 --- a/test/spec/ol/source/imagestaticsource.test.js +++ b/test/spec/ol/source/imagestaticsource.test.js @@ -23,13 +23,14 @@ describe('ol.source.ImageStatic', function() { projection: projection }); + var image = source.getImage(extent, resolution, pixelRatio, projection); + source.on('imageloadend', function(event) { expect(image.getImage().width).to.be(128); expect(image.getImage().height).to.be(256); done(); }); - var image = source.getImage(extent, resolution, pixelRatio, projection); image.load(); }); @@ -43,13 +44,14 @@ describe('ol.source.ImageStatic', function() { projection: projection }); + var image = source.getImage(extent, resolution, pixelRatio, projection); + source.on('imageloadend', function(event) { expect(image.getImage().width).to.be(127); expect(image.getImage().height).to.be(254); done(); }); - var image = source.getImage(extent, resolution, pixelRatio, projection); image.load(); }); diff --git a/test/spec/ol/source/rastersource.test.js b/test/spec/ol/source/rastersource.test.js index 37633fde39..882a781d28 100644 --- a/test/spec/ol/source/rastersource.test.js +++ b/test/spec/ol/source/rastersource.test.js @@ -20,7 +20,7 @@ function itNoPhantom() { (typeof ImageData == 'function' ? describe : xdescribe)('ol.source.Raster', function() { - var target, map, redSource, greenSource, blueSource; + var target, map, redSource, greenSource, blueSource, raster; beforeEach(function() { target = document.createElement('div'); diff --git a/test/spec/ol/source/tilearcgisrestsource.test.js b/test/spec/ol/source/tilearcgisrestsource.test.js index f0277f6f15..d49a829729 100644 --- a/test/spec/ol/source/tilearcgisrestsource.test.js +++ b/test/spec/ol/source/tilearcgisrestsource.test.js @@ -126,7 +126,7 @@ describe('ol.source.TileArcGISRest', function() { it('add a new param', function() { var source = new ol.source.TileArcGISRest(options); - source.updateParams({ 'TEST': 'value' }); + source.updateParams({'TEST': 'value'}); var tile = source.getTile(3, 2, -7, 1, ol.proj.get('EPSG:3857')); var uri = new goog.Uri(tile.src_); @@ -139,7 +139,7 @@ describe('ol.source.TileArcGISRest', function() { options.params.TEST = 'value'; var source = new ol.source.TileArcGISRest(options); - source.updateParams({ 'TEST': 'newValue' }); + source.updateParams({'TEST': 'newValue'}); var tile = source.getTile(3, 2, -7, 1, ol.proj.get('EPSG:3857')); var uri = new goog.Uri(tile.src_); @@ -158,29 +158,29 @@ describe('ol.source.TileArcGISRest', function() { var setParams = source.getParams(); - expect(setParams).to.eql({ TEST: 'value' }); + expect(setParams).to.eql({TEST: 'value'}); }); it('verify on adding a param', function() { options.params.TEST = 'value'; var source = new ol.source.TileArcGISRest(options); - source.updateParams({ 'TEST2': 'newValue' }); + source.updateParams({'TEST2': 'newValue'}); var setParams = source.getParams(); - expect(setParams).to.eql({ TEST: 'value', TEST2: 'newValue' }); + expect(setParams).to.eql({TEST: 'value', TEST2: 'newValue'}); }); it('verify on update a param', function() { options.params.TEST = 'value'; var source = new ol.source.TileArcGISRest(options); - source.updateParams({ 'TEST': 'newValue' }); + source.updateParams({'TEST': 'newValue'}); var setParams = source.getParams(); - expect(setParams).to.eql({ TEST: 'newValue' }); + expect(setParams).to.eql({TEST: 'newValue'}); }); }); diff --git a/test/spec/ol/source/tilesource.test.js b/test/spec/ol/source/tilesource.test.js index e660f2f520..1155964481 100644 --- a/test/spec/ol/source/tilesource.test.js +++ b/test/spec/ol/source/tilesource.test.js @@ -71,8 +71,9 @@ describe('ol.source.Tile', function() { var zoom = 1; var range = new ol.TileRange(0, 1, 0, 1); - var covered = source.forEachLoadedTile(source.getProjection(), zoom, - range, function() { + var covered = source.forEachLoadedTile( + source.getProjection(), zoom, range, + function() { return true; }); expect(covered).to.be(true); @@ -90,8 +91,9 @@ describe('ol.source.Tile', function() { var zoom = 1; var range = new ol.TileRange(0, 1, 0, 1); - var covered = source.forEachLoadedTile(source.getProjection(), zoom, - range, function() { + var covered = source.forEachLoadedTile( + source.getProjection(), zoom, + range, function() { return true; }); expect(covered).to.be(false); @@ -109,8 +111,9 @@ describe('ol.source.Tile', function() { var zoom = 1; var range = new ol.TileRange(0, 1, 0, 1); - var covered = source.forEachLoadedTile(source.getProjection(), zoom, - range, function() { + var covered = source.forEachLoadedTile( + source.getProjection(), zoom, range, + function() { return false; }); expect(covered).to.be(false); @@ -170,7 +173,6 @@ describe('ol.source.Tile', function() { }); - /** * Tile source for tests that uses a EPSG:4326 based grid with 4 resolutions and * 256x256 tiles. diff --git a/test/spec/ol/source/wmtssource.test.js b/test/spec/ol/source/wmtssource.test.js index d3acf0b118..21d1c307be 100644 --- a/test/spec/ol/source/wmtssource.test.js +++ b/test/spec/ol/source/wmtssource.test.js @@ -20,7 +20,7 @@ describe('ol.source.WMTS', function() { function() { var options = ol.source.WMTS.optionsFromCapabilities( capabilities, - { layer: 'BlueMarbleNextGeneration', matrixSet: 'google3857' }); + {layer: 'BlueMarbleNextGeneration', matrixSet: 'google3857'}); expect(options.urls).to.be.an('array'); expect(options.urls).to.have.length(1); @@ -50,8 +50,8 @@ describe('ol.source.WMTS', function() { function() { var options = ol.source.WMTS.optionsFromCapabilities( capabilities, - { layer: 'BlueMarbleNextGeneration', matrixSet: 'google3857', - requestEncoding: 'REST' }); + {layer: 'BlueMarbleNextGeneration', matrixSet: 'google3857', + requestEncoding: 'REST'}); expect(options.urls).to.be.an('array'); expect(options.urls).to.have.length(1); @@ -80,8 +80,8 @@ describe('ol.source.WMTS', function() { it('can find a MatrixSet by SRS identifier', function() { var options = ol.source.WMTS.optionsFromCapabilities( capabilities, - { layer: 'BlueMarbleNextGeneration', projection: 'EPSG:3857', - requestEncoding: 'REST' }); + {layer: 'BlueMarbleNextGeneration', projection: 'EPSG:3857', + requestEncoding: 'REST'}); expect(options.matrixSet).to.be.eql('google3857'); }); diff --git a/test/spec/ol/sphere/sphere.test.js b/test/spec/ol/sphere/sphere.test.js index 3544a47c10..323793921e 100644 --- a/test/spec/ol/sphere/sphere.test.js +++ b/test/spec/ol/sphere/sphere.test.js @@ -7,83 +7,67 @@ goog.provide('ol.test.Sphere'); describe('ol.Sphere', function() { var sphere = new ol.Sphere(6371); - var expected = [ - { - c1: [0, 0], - c2: [0, 0], - haversineDistance: 0 - }, - { - c1: [0, 0], - c2: [45, 45], - haversineDistance: 6671.695598673525 - }, - { - c1: [0, 0], - c2: [-45, 45], - haversineDistance: 6671.695598673525 - }, - { - c1: [0, 0], - c2: [-45, -45], - haversineDistance: 6671.695598673525 - }, - { - c1: [0, 0], - c2: [45, -45], - haversineDistance: 6671.695598673525 - }, - { - c1: [45, 45], - c2: [45, 45], - haversineDistance: 0 - }, - { - c1: [45, 45], - c2: [-45, 45], - haversineDistance: 6671.695598673525 - }, - { - c1: [45, 45], - c2: [-45, -45], - haversineDistance: 13343.391197347048 - }, - { - c1: [45, 45], - c2: [45, -45], - haversineDistance: 10007.543398010286 - }, - { - c1: [-45, 45], - c2: [-45, 45], - haversineDistance: 0 - }, - { - c1: [-45, 45], - c2: [-45, -45], - haversineDistance: 10007.543398010286 - }, - { - c1: [-45, 45], - c2: [45, -45], - haversineDistance: 13343.391197347048 - }, - { - c1: [-45, -45], - c2: [-45, -45], - haversineDistance: 0 - }, - { - c1: [-45, -45], - c2: [45, -45], - haversineDistance: 6671.695598673525 - }, - { - c1: [45, -45], - c2: [45, -45], - haversineDistance: 0 - } - ]; + var expected = [{ + c1: [0, 0], + c2: [0, 0], + haversineDistance: 0 + }, { + c1: [0, 0], + c2: [45, 45], + haversineDistance: 6671.695598673525 + }, { + c1: [0, 0], + c2: [-45, 45], + haversineDistance: 6671.695598673525 + }, { + c1: [0, 0], + c2: [-45, -45], + haversineDistance: 6671.695598673525 + }, { + c1: [0, 0], + c2: [45, -45], + haversineDistance: 6671.695598673525 + }, { + c1: [45, 45], + c2: [45, 45], + haversineDistance: 0 + }, { + c1: [45, 45], + c2: [-45, 45], + haversineDistance: 6671.695598673525 + }, { + c1: [45, 45], + c2: [-45, -45], + haversineDistance: 13343.391197347048 + }, { + c1: [45, 45], + c2: [45, -45], + haversineDistance: 10007.543398010286 + }, { + c1: [-45, 45], + c2: [-45, 45], + haversineDistance: 0 + }, { + c1: [-45, 45], + c2: [-45, -45], + haversineDistance: 10007.543398010286 + }, { + c1: [-45, 45], + c2: [45, -45], + haversineDistance: 13343.391197347048 + }, { + c1: [-45, -45], + c2: [-45, -45], + haversineDistance: 0 + }, { + c1: [-45, -45], + c2: [45, -45], + haversineDistance: 6671.695598673525 + }, { + c1: [45, -45], + c2: [45, -45], + haversineDistance: 0 + }]; describe('haversineDistance', function() { diff --git a/test/spec/ol/style.test.js b/test/spec/ol/style.test.js index 2a42d4ac02..e0a5f0c382 100644 --- a/test/spec/ol/style.test.js +++ b/test/spec/ol/style.test.js @@ -49,7 +49,9 @@ describe('ol.style.Style', function() { var geom = new ol.geom.Point([1, 2]); style.setGeometry(geom); expect(style.getGeometry()).to.eql(geom); - var fn = function() { return geom; }; + var fn = function() { + return geom; + }; style.setGeometry(fn); expect(style.getGeometry()).to.eql(fn); style.setGeometry(null); diff --git a/test/spec/ol/tilegrid/tilegrid.test.js b/test/spec/ol/tilegrid/tilegrid.test.js index 7e05e94744..08ed45679e 100644 --- a/test/spec/ol/tilegrid/tilegrid.test.js +++ b/test/spec/ol/tilegrid/tilegrid.test.js @@ -4,14 +4,12 @@ describe('ol.tilegrid.TileGrid', function() { var extent; var resolutions; var origin; - var origins; var tileSize; beforeEach(function() { resolutions = [1000, 500, 250, 100]; extent = [0, 0, 100000, 100000]; origin = [0, 0]; - origins = []; tileSize = 100; }); diff --git a/test/spec/ol/tilerange.test.js b/test/spec/ol/tilerange.test.js index 7fa685874c..4fbf2d8f08 100644 --- a/test/spec/ol/tilerange.test.js +++ b/test/spec/ol/tilerange.test.js @@ -59,9 +59,7 @@ describe('ol.TileRange', function() { describe('with mixed z', function() { expect(function() { - var tileRange = new ol.TileRange.boundingTileRange( - [3, 1, 3], [4, 2, 0]); - tileRange = tileRange; // suppress gjslint warning about unused variable + return new ol.TileRange.boundingTileRange([3, 1, 3], [4, 2, 0]); }).to.throwException(); }); }); diff --git a/test/spec/ol/tileurlfunction.test.js b/test/spec/ol/tileurlfunction.test.js index 2c1bad89f9..6021e5bdaf 100644 --- a/test/spec/ol/tileurlfunction.test.js +++ b/test/spec/ol/tileurlfunction.test.js @@ -69,15 +69,21 @@ describe('ol.TileUrlFunction', function() { templates, tileGrid); var tileCoord = [3, 2, -2]; - sinon.stub(ol.tilecoord, 'hash', function() { return 3; }); + sinon.stub(ol.tilecoord, 'hash', function() { + return 3; + }); expect(tileUrlFunction(tileCoord)).to.eql('http://tile-1/3/2/1'); ol.tilecoord.hash.restore(); - sinon.stub(ol.tilecoord, 'hash', function() { return 2; }); + sinon.stub(ol.tilecoord, 'hash', function() { + return 2; + }); expect(tileUrlFunction(tileCoord)).to.eql('http://tile-3/3/2/1'); ol.tilecoord.hash.restore(); - sinon.stub(ol.tilecoord, 'hash', function() { return 1; }); + sinon.stub(ol.tilecoord, 'hash', function() { + return 1; + }); expect(tileUrlFunction(tileCoord)).to.eql('http://tile-2/3/2/1'); ol.tilecoord.hash.restore(); }); diff --git a/test/spec/ol/view.test.js b/test/spec/ol/view.test.js index b4ef6bd69b..c9f21c7fb2 100644 --- a/test/spec/ol/view.test.js +++ b/test/spec/ol/view.test.js @@ -404,11 +404,7 @@ describe('ol.View', function() { view.fit( new ol.geom.LineString([[6000, 46000], [6000, 47100], [7000, 46000]]), [200, 200], - { - padding: [100, 0, 0, 100], - constrainResolution: false - } - ); + {padding: [100, 0, 0, 100], constrainResolution: false}); expect(view.getResolution()).to.be(11); expect(view.getCenter()[0]).to.be(5950); expect(view.getCenter()[1]).to.be(47100); @@ -416,10 +412,7 @@ describe('ol.View', function() { view.fit( new ol.geom.LineString([[6000, 46000], [6000, 47100], [7000, 46000]]), [200, 200], - { - padding: [100, 0, 0, 100] - } - ); + {padding: [100, 0, 0, 100]}); expect(view.getResolution()).to.be(20); expect(view.getCenter()[0]).to.be(5500); expect(view.getCenter()[1]).to.be(47550); @@ -427,11 +420,7 @@ describe('ol.View', function() { view.fit( new ol.geom.LineString([[6000, 46000], [6000, 47100], [7000, 46000]]), [200, 200], - { - padding: [100, 0, 0, 100], - nearest: true - } - ); + {padding: [100, 0, 0, 100], nearest: true}); expect(view.getResolution()).to.be(10); expect(view.getCenter()[0]).to.be(6000); expect(view.getCenter()[1]).to.be(47050); @@ -439,11 +428,7 @@ describe('ol.View', function() { view.fit( new ol.geom.Point([6000, 46000]), [200, 200], - { - padding: [100, 0, 0, 100], - minResolution: 2 - } - ); + {padding: [100, 0, 0, 100], minResolution: 2}); expect(view.getResolution()).to.be(2); expect(view.getCenter()[0]).to.be(5900); expect(view.getCenter()[1]).to.be(46100); @@ -451,11 +436,7 @@ describe('ol.View', function() { view.fit( new ol.geom.Point([6000, 46000]), [200, 200], - { - padding: [100, 0, 0, 100], - maxZoom: 6 - } - ); + {padding: [100, 0, 0, 100], maxZoom: 6}); expect(view.getResolution()).to.be(2); expect(view.getZoom()).to.be(6); expect(view.getCenter()[0]).to.be(5900); @@ -465,11 +446,7 @@ describe('ol.View', function() { view.fit( new ol.geom.LineString([[6000, 46000], [6000, 47100], [7000, 46000]]), [200, 200], - { - padding: [100, 0, 0, 100], - constrainResolution: false - } - ); + {padding: [100, 0, 0, 100], constrainResolution: false}); expect(view.getResolution()).to.roughlyEqual(14.849242404917458, 1e-9); expect(view.getCenter()[0]).to.roughlyEqual(5200, 1e-9); expect(view.getCenter()[1]).to.roughlyEqual(46300, 1e-9); diff --git a/test/test-extensions.js b/test/test-extensions.js index 7d7551264e..17dd324473 100644 --- a/test/test-extensions.js +++ b/test/test-extensions.js @@ -1,3 +1,5 @@ +/* global resemble:false */ + // FIXME remove afterLoadXml as it uses the wrong XML parser on IE9 // helper functions for async testing and other utility functions. @@ -70,6 +72,7 @@ * Assert value is within some tolerance of a number. * @param {Number} n Number. * @param {Number} tol Tolerance. + * @return {expect.Assertion} The assertion. */ expect.Assertion.prototype.roughlyEqual = function(n, tol) { this.assert( @@ -88,6 +91,7 @@ /** * Assert that a sinon spy was called. + * @return {expect.Assertion} The assertion. */ expect.Assertion.prototype.called = function() { this.assert( @@ -105,7 +109,7 @@ function getChildNodes(node, options) { // check whitespace if (options && options.includeWhiteSpace) { - return node.childNodes; + return node.childNodes; } else { var nodes = []; for (var i = 0, ii = node.childNodes.length; i < ii; i++) { @@ -154,9 +158,8 @@ errors.push('nodeValue test failed | expected ' + nv1 + ' to equal ' + nv2); } - } - // for element type nodes compare namespace, attributes, and children - else if (node1.nodeType === 1) { + } else if (node1.nodeType === 1) { + // for element type nodes compare namespace, attributes, and children // test namespace alias and uri if (node1.prefix || node2.prefix) { if (testPrefix) { @@ -208,7 +211,6 @@ errors.push('Number of attributes test failed for: ' + node1.nodeName + ' | expected ' + node1AttrLen + ' to equal ' + node2AttrLen); } - var gv, ev; for (var name in node1Attr) { if (node2Attr[name] === undefined) { errors.push('Attribute name ' + node1Attr[name].name + @@ -272,6 +274,9 @@ /** * Checks if the XML document sort of equals another XML document. + * @param {Object} obj The other object. + * @param {Object} options The options. + * @return {expect.Assertion} The assertion. */ expect.Assertion.prototype.xmleql = function(obj, options) { if (obj && obj.nodeType == 9) { @@ -301,6 +306,8 @@ /** * Checks if the array sort of equals another array. + * @param {Object} obj The other object. + * @return {expect.Assertion} The assertion. */ expect.Assertion.prototype.arreql = function(obj) { this.assert( @@ -319,6 +326,8 @@ /** * Checks if the array sort of equals another array (allows NaNs to be equal). + * @param {Object} obj The other object. + * @return {expect.Assertion} The assertion. */ expect.Assertion.prototype.arreqlNaN = function(obj) { function compare(a, b) { @@ -359,7 +368,7 @@ }; global.assertWebGL = function(map) { - if(!ol.has.WEBGL) { + if (!ol.has.WEBGL) { expect().fail('No WebGL support!'); } }; @@ -373,7 +382,7 @@ .compareTo(canvas.getContext('2d').getImageData( 0, 0, canvas.width, canvas.height)) .onComplete(function(data) { - if(!data.isSameDimensions) { + if (!data.isSameDimensions) { expect().fail( 'The dimensions of the reference image and ' + 'the test canvas are not the same.'); @@ -388,8 +397,8 @@ expect(data.misMatchPercentage).to.be.below(tolerance); } done(); - }); - }; + }); + } global.resembleCanvas = resembleCanvas; function expectResembleCanvas(map, referenceImage, tolerance, done) { @@ -398,7 +407,7 @@ var canvas = event.context.canvas; resembleCanvas(canvas, referenceImage, tolerance, done); }); - }; + } function expectResembleWebGL(map, referenceImage, tolerance, done) { map.render(); @@ -421,7 +430,7 @@ resembleCanvas(canvas, referenceImage, tolerance, done); }); - }; + } /** * Assert that the given map resembles a reference image. diff --git a/test_rendering/slimerjs-profile/prefs.js b/test_rendering/slimerjs-profile/prefs.js index dbb7da3fd2..5dfd9e4d11 100644 --- a/test_rendering/slimerjs-profile/prefs.js +++ b/test_rendering/slimerjs-profile/prefs.js @@ -1,4 +1,6 @@ -user_pref("webgl.force-enabled", true); -user_pref("webgl.disabled", false); -user_pref("webgl.msaa-force", true); -user_pref("layout.css.devPixelsPerPx", "1.0"); +/* global user_pref */ + +user_pref('webgl.force-enabled', true); +user_pref('webgl.disabled', false); +user_pref('webgl.msaa-force', true); +user_pref('layout.css.devPixelsPerPx', '1.0'); diff --git a/test_rendering/spec/.eslintrc b/test_rendering/spec/.eslintrc new file mode 100644 index 0000000000..d728c558cd --- /dev/null +++ b/test_rendering/spec/.eslintrc @@ -0,0 +1,14 @@ +{ + "env": { + "mocha": true + }, + "globals": { + "IMAGE_TOLERANCE": false, + "assertWebGL": false, + "createMapDiv": false, + "disposeMap": false, + "expect": false, + "expectResemble": false, + "resembleCanvas": false + } +} diff --git a/test_rendering/spec/ol/style/circle.test.js b/test_rendering/spec/ol/style/circle.test.js index 2315637ba8..1fbe541bdd 100644 --- a/test_rendering/spec/ol/style/circle.test.js +++ b/test_rendering/spec/ol/style/circle.test.js @@ -8,7 +8,7 @@ describe('ol.rendering.style.Circle', function() { target = createMapDiv(50, 50); vectorSource = new ol.source.Vector(); - vectorLayer = new ol.layer.Vector({ + var vectorLayer = new ol.layer.Vector({ source: vectorSource }); diff --git a/test_rendering/spec/ol/style/icon.test.js b/test_rendering/spec/ol/style/icon.test.js index 2f425e48aa..bc1116396f 100644 --- a/test_rendering/spec/ol/style/icon.test.js +++ b/test_rendering/spec/ol/style/icon.test.js @@ -8,7 +8,7 @@ describe('ol.rendering.style.Icon', function() { target = createMapDiv(50, 50); vectorSource = new ol.source.Vector(); - vectorLayer = new ol.layer.Vector({ + var vectorLayer = new ol.layer.Vector({ source: vectorSource }); diff --git a/test_rendering/spec/ol/style/linestring.test.js b/test_rendering/spec/ol/style/linestring.test.js index bb8921f4a8..6142237586 100644 --- a/test_rendering/spec/ol/style/linestring.test.js +++ b/test_rendering/spec/ol/style/linestring.test.js @@ -8,7 +8,7 @@ describe('ol.rendering.style.LineString', function() { target = createMapDiv(50, 50); vectorSource = new ol.source.Vector(); - vectorLayer = new ol.layer.Vector({ + var vectorLayer = new ol.layer.Vector({ source: vectorSource }); diff --git a/test_rendering/spec/ol/style/polygon.test.js b/test_rendering/spec/ol/style/polygon.test.js index 29f7a64d2c..de8f53cfbd 100644 --- a/test_rendering/spec/ol/style/polygon.test.js +++ b/test_rendering/spec/ol/style/polygon.test.js @@ -8,7 +8,7 @@ describe('ol.rendering.style.Polygon', function() { target = createMapDiv(50, 50); vectorSource = new ol.source.Vector(); - vectorLayer = new ol.layer.Vector({ + var vectorLayer = new ol.layer.Vector({ source: vectorSource }); diff --git a/test_rendering/spec/ol/style/regularshape.test.js b/test_rendering/spec/ol/style/regularshape.test.js index c2eda752da..2df205f6f0 100644 --- a/test_rendering/spec/ol/style/regularshape.test.js +++ b/test_rendering/spec/ol/style/regularshape.test.js @@ -8,7 +8,7 @@ describe('ol.rendering.style.RegularShape', function() { target = createMapDiv(50, 50); vectorSource = new ol.source.Vector(); - vectorLayer = new ol.layer.Vector({ + var vectorLayer = new ol.layer.Vector({ source: vectorSource }); diff --git a/test_rendering/test.js b/test_rendering/test.js index 8343ab26c9..7a76fc8749 100644 --- a/test_rendering/test.js +++ b/test_rendering/test.js @@ -1,30 +1,32 @@ +/* global phantom, slimer */ +/* eslint-disable no-console */ + var url = phantom.args[0]; -var page = require("webpage").create(); +var page = require('webpage').create(); var v = slimer.geckoVersion; console.log('Gecko: ' + v.major + '.' + v.minor + '.' + v.patch); -page.open(url). - then(function(status){ - if (status == "success") { - page.onCallback = function(failedTests) { - if (failedTests.length > 0) { - for (var i = 0; i < failedTests.length; i++) { - var test = failedTests[i]; - console.log(test.title); - console.error(test.errorStack); - console.log(''); - } - console.error(failedTests.length + ' test(s) failed.'); - } else { - console.log('All tests passed.'); - } - page.close(); - phantom.exit(failedTests.length === 0 ? 0 : 1); - } - } else { - console.error("The tests could not be started. Is the server running?"); - page.close(); - phantom.exit(1); - } - }); +page.open(url).then(function(status) { + if (status === 'success') { + page.onCallback = function(failedTests) { + if (failedTests.length > 0) { + for (var i = 0; i < failedTests.length; i++) { + var test = failedTests[i]; + console.log(test.title); + console.error(test.errorStack); + console.log(''); + } + console.error(failedTests.length + ' test(s) failed.'); + } else { + console.log('All tests passed.'); + } + page.close(); + phantom.exit(failedTests.length === 0 ? 0 : 1); + } + } else { + console.error('The tests could not be started. Is the server running?'); + page.close(); + phantom.exit(1); + } +});