From 4ad85e52e2a4ac1f2b5bf5a3ab556c7f0a3cc2f8 Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Tue, 13 Jun 2017 09:35:15 +0200 Subject: [PATCH 1/6] Upgrade eslint to v4.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 284707035dc..f9d9be9f64e 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "clean-css-cli": "4.1.4", "coveralls": "2.13.1", "debounce": "^1.0.0", - "eslint": "3.19.0", + "eslint": "4.0.0", "eslint-config-openlayers": "7.0.0", "eslint-plugin-openlayers-internal": "^3.1.0", "expect.js": "0.3.1", From a17db4f45c322581f5da74c9f556aceb49db3983 Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Mon, 19 Jun 2017 11:56:06 +0200 Subject: [PATCH 2/6] Configure indent rule more explicitly --- package.json | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index f9d9be9f64e..807dbf73b61 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,23 @@ "openlayers-internal/one-provide": 2, "openlayers-internal/requires-first": 2, "openlayers-internal/valid-provide": 2, - "openlayers-internal/valid-requires": 2 + "openlayers-internal/valid-requires": 2, + "indent": [2, 2, { + "VariableDeclarator": 2, + "SwitchCase": 1, + "MemberExpression": 2, + "FunctionDeclaration": { + "parameters": 2, + "body": 1 + }, + "FunctionExpression": { + "parameters": 2, + "body": 1 + }, + "CallExpression": { + "arguments": 2 + } + }] } }, "ext": [ From d0ef05977be291e669439b485c03189bbfcf1984 Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Mon, 19 Jun 2017 11:58:00 +0200 Subject: [PATCH 3/6] Autofix indentation issues (eslint --fix) --- examples/color-manipulation.js | 2 +- examples/custom-interactions.js | 2 +- examples/feature-move-animation.js | 2 +- examples/geojson-vt.js | 8 +- examples/geolocation.js | 2 +- examples/here-maps.js | 10 +- examples/modify-test.js | 10 +- examples/polygon-styles.js | 8 +- examples/raster.js | 4 +- examples/vector-wfs-getfeature.js | 4 +- examples/xyz-esri-4326-512.js | 4 +- src/ol/centerconstraint.js | 22 +- src/ol/color.js | 66 ++-- src/ol/colorlike.js | 2 +- src/ol/control.js | 2 +- src/ol/control/attribution.js | 4 +- src/ol/control/control.js | 2 +- src/ol/control/fullscreen.js | 6 +- src/ol/control/mouseposition.js | 6 +- src/ol/control/overviewmap.js | 4 +- src/ol/control/scaleline.js | 2 +- src/ol/control/zoom.js | 8 +- src/ol/control/zoomtoextent.js | 6 +- src/ol/coordinate.js | 14 +- src/ol/deviceorientation.js | 10 +- src/ol/events/condition.js | 12 +- src/ol/events/event.js | 6 +- src/ol/events/eventtarget.js | 4 +- src/ol/feature.js | 4 +- src/ol/featureloader.js | 78 ++--- src/ol/format/esrijson.js | 12 +- src/ol/format/feature.js | 6 +- src/ol/format/filter.js | 2 +- src/ol/format/geojson.js | 10 +- src/ol/format/gml2.js | 6 +- src/ol/format/gml3.js | 10 +- src/ol/format/gmlbase.js | 10 +- src/ol/format/gpx.js | 10 +- src/ol/format/igc.js | 4 +- src/ol/format/kml.js | 102 +++--- src/ol/format/mvt.js | 6 +- src/ol/format/ows.js | 38 +-- src/ol/format/polyline.js | 12 +- src/ol/format/topojson.js | 8 +- src/ol/format/wfs.js | 16 +- src/ol/format/wkt.js | 8 +- src/ol/format/wmscapabilities.js | 54 +-- src/ol/format/wmtscapabilities.js | 6 +- src/ol/geolocation.js | 24 +- src/ol/geom/flat/geodesic.js | 2 +- src/ol/geom/flat/orient.js | 4 +- src/ol/geom/flat/simplify.js | 2 +- src/ol/geom/multipoint.js | 2 +- src/ol/geom/multipolygon.js | 2 +- src/ol/graticule.js | 108 +++--- src/ol/has.js | 36 +- src/ol/imagecanvas.js | 2 +- src/ol/interaction.js | 10 +- src/ol/interaction/draganddrop.js | 4 +- src/ol/interaction/dragbox.js | 6 +- src/ol/interaction/dragpan.js | 2 +- src/ol/interaction/dragrotate.js | 2 +- src/ol/interaction/dragrotateandzoom.js | 2 +- src/ol/interaction/dragzoom.js | 2 +- src/ol/interaction/draw.js | 44 +-- src/ol/interaction/extent.js | 10 +- src/ol/interaction/interaction.js | 2 +- src/ol/interaction/keyboardpan.js | 4 +- src/ol/interaction/keyboardzoom.js | 2 +- src/ol/interaction/modify.js | 12 +- src/ol/interaction/mousewheelzoom.js | 4 +- src/ol/interaction/pointer.js | 12 +- src/ol/interaction/select.js | 52 +-- src/ol/interaction/snap.js | 24 +- src/ol/layer/base.js | 6 +- src/ol/layer/heatmap.js | 4 +- src/ol/layer/tile.js | 4 +- src/ol/layer/vector.js | 22 +- src/ol/layer/vectortile.js | 6 +- src/ol/loadingstrategy.js | 32 +- src/ol/map.js | 22 +- src/ol/mapbrowsereventhandler.js | 32 +- src/ol/object.js | 4 +- src/ol/overlay.js | 22 +- src/ol/pointer/pointerevent.js | 2 +- src/ol/proj.js | 30 +- src/ol/proj/projection.js | 24 +- src/ol/render/canvas/imagereplay.js | 12 +- src/ol/render/canvas/immediate.js | 40 +-- src/ol/render/canvas/linestringreplay.js | 14 +- src/ol/render/canvas/polygonreplay.js | 18 +- src/ol/render/canvas/replay.js | 2 +- src/ol/render/canvas/textreplay.js | 22 +- src/ol/render/feature.js | 6 +- src/ol/render/webgl.js | 2 +- src/ol/render/webgl/circlereplay.js | 6 +- .../webgl/circlereplay/defaultshader.js | 8 +- src/ol/render/webgl/imagereplay.js | 4 +- .../render/webgl/imagereplay/defaultshader.js | 8 +- src/ol/render/webgl/immediate.js | 14 +- src/ol/render/webgl/linestringreplay.js | 20 +- .../webgl/linestringreplay/defaultshader.js | 8 +- src/ol/render/webgl/polygonreplay.js | 8 +- .../webgl/polygonreplay/defaultshader.js | 8 +- src/ol/render/webgl/replay.js | 12 +- src/ol/renderer/canvas/layer.js | 2 +- src/ol/renderer/canvas/map.js | 2 +- src/ol/renderer/canvas/tilelayer.js | 4 +- src/ol/renderer/canvas/vectorlayer.js | 2 +- src/ol/renderer/layer.js | 22 +- src/ol/renderer/map.js | 8 +- src/ol/renderer/webgl/defaultmapshader.js | 8 +- src/ol/renderer/webgl/imagelayer.js | 4 +- src/ol/renderer/webgl/layer.js | 2 +- src/ol/renderer/webgl/map.js | 8 +- src/ol/renderer/webgl/tilelayer.js | 24 +- src/ol/renderer/webgl/tilelayershader.js | 8 +- src/ol/reproj.js | 6 +- src/ol/reproj/image.js | 4 +- src/ol/reproj/tile.js | 4 +- src/ol/reproj/triangulation.js | 10 +- src/ol/resolutionconstraint.js | 56 ++-- src/ol/rotationconstraint.js | 38 +-- src/ol/source/bingmaps.js | 30 +- src/ol/source/image.js | 2 +- src/ol/source/imagearcgisrest.js | 6 +- src/ol/source/imagecanvas.js | 2 +- src/ol/source/imagemapguide.js | 8 +- src/ol/source/imagestatic.js | 4 +- src/ol/source/imagevector.js | 2 +- src/ol/source/imagewms.js | 2 +- src/ol/source/osm.js | 4 +- src/ol/source/raster.js | 6 +- src/ol/source/source.js | 2 +- src/ol/source/stamen.js | 2 +- src/ol/source/tile.js | 4 +- src/ol/source/tilearcgisrest.js | 4 +- src/ol/source/tiledebug.js | 2 +- src/ol/source/tileimage.js | 6 +- src/ol/source/tilejson.js | 2 +- src/ol/source/tileutfgrid.js | 4 +- src/ol/source/tilewms.js | 4 +- src/ol/source/urltile.js | 12 +- src/ol/source/vector.js | 2 +- src/ol/source/vectortile.js | 8 +- src/ol/source/wmts.js | 62 ++-- src/ol/source/xyz.js | 14 +- src/ol/source/zoomify.js | 4 +- src/ol/structs/priorityqueue.js | 2 +- src/ol/style/atlasmanager.js | 14 +- src/ol/style/fill.js | 4 +- src/ol/style/icon.js | 16 +- src/ol/style/iconimage.js | 8 +- src/ol/style/regularshape.js | 14 +- src/ol/style/stroke.js | 12 +- src/ol/style/text.js | 2 +- src/ol/tilegrid.js | 8 +- src/ol/tilegrid/tilegrid.js | 4 +- src/ol/tilegrid/wmts.js | 4 +- src/ol/tileurlfunction.js | 60 ++-- src/ol/vectorimagetile.js | 8 +- src/ol/view.js | 54 +-- src/ol/webgl/buffer.js | 2 +- src/ol/webgl/context.js | 2 +- src/ol/xml.js | 130 ++++---- tasks/build-examples.js | 4 +- tasks/serve.js | 4 +- test/spec/ol/array.test.js | 312 +++++++++--------- test/spec/ol/format/esrijson.test.js | 22 +- test/spec/ol/format/geojson.test.js | 4 +- test/spec/ol/format/gml.test.js | 34 +- test/spec/ol/format/kml.test.js | 8 +- test/spec/ol/format/ows.test.js | 6 +- test/spec/ol/format/wfs.test.js | 50 +-- test/spec/ol/format/wmtscapabilities.test.js | 26 +- test/spec/ol/geom/circle.test.js | 40 +-- test/spec/ol/geom/flat/center.test.js | 28 +- test/spec/ol/geom/flat/interpolate.test.js | 24 +- .../ol/geom/flat/intersectsextent.test.js | 16 +- test/spec/ol/interaction/modify.test.js | 8 +- test/spec/ol/interaction/translate.test.js | 4 +- test/spec/ol/proj/index.test.js | 14 +- .../ol/render/webgl/linestringreplay.test.js | 44 +-- .../ol/render/webgl/polygonreplay.test.js | 4 +- test/spec/ol/source/imagewms.test.js | 18 +- test/spec/ol/source/tileutfgrid.test.js | 8 +- test/spec/ol/source/tilewms.test.js | 16 +- test/spec/ol/source/wmts.test.js | 4 +- test/spec/ol/tilegrid/wmts.test.js | 182 +++++----- test/spec/ol/tilequeue.test.js | 2 +- test/spec/ol/vec/mat4.test.js | 2 +- test/spec/ol/view.test.js | 14 +- test/test-extensions.js | 34 +- test_rendering/spec/ol/reproj/tile.test.js | 26 +- .../spec/ol/style/linestring.test.js | 4 +- test_rendering/test.js | 6 +- 196 files changed, 1577 insertions(+), 1577 deletions(-) diff --git a/examples/color-manipulation.js b/examples/color-manipulation.js index 2cd424efa33..ef5d3fa3e98 100644 --- a/examples/color-manipulation.js +++ b/examples/color-manipulation.js @@ -97,7 +97,7 @@ function rgb2xyz(x) { function xyz2rgb(x) { return 255 * (x <= 0.0031308 ? - 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055); + 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055); } var raster = new ol.source.Raster({ diff --git a/examples/custom-interactions.js b/examples/custom-interactions.js index 2a8381854f1..c5a447059cb 100644 --- a/examples/custom-interactions.js +++ b/examples/custom-interactions.js @@ -142,7 +142,7 @@ var lineFeature = new ol.Feature( var polygonFeature = new ol.Feature( new ol.geom.Polygon([[[-3e6, -1e6], [-3e6, 1e6], - [-1e6, 1e6], [-1e6, -1e6], [-3e6, -1e6]]])); + [-1e6, 1e6], [-1e6, -1e6], [-3e6, -1e6]]])); var map = new ol.Map({ diff --git a/examples/feature-move-animation.js b/examples/feature-move-animation.js index 47f66e8f2ec..fa6dfea05b4 100644 --- a/examples/feature-move-animation.js +++ b/examples/feature-move-animation.js @@ -198,7 +198,7 @@ function stopAnimation(ended) { // if animation cancelled set the marker at the beginning var coord = ended ? routeCoords[routeLength - 1] : routeCoords[0]; /** @type {ol.geom.Point} */ (geoMarker.getGeometry()) - .setCoordinates(coord); + .setCoordinates(coord); //remove listener map.un('postcompose', moveFeature); } diff --git a/examples/geojson-vt.js b/examples/geojson-vt.js index b9b684cbc52..e8919387864 100644 --- a/examples/geojson-vt.js +++ b/examples/geojson-vt.js @@ -85,10 +85,10 @@ fetch(url).then(function(response) { var data = tileIndex.getTile(tileCoord[0], tileCoord[1], -tileCoord[2] - 1); var features = format.readFeatures( - JSON.stringify({ - type: 'FeatureCollection', - features: data ? data.features : [] - }, replacer)); + JSON.stringify({ + type: 'FeatureCollection', + features: data ? data.features : [] + }, replacer)); tile.setLoader(function() { tile.setFeatures(features); tile.setProjection(tilePixels); diff --git a/examples/geolocation.js b/examples/geolocation.js index d7d3e96beca..bfe2a165cd8 100644 --- a/examples/geolocation.js +++ b/examples/geolocation.js @@ -83,7 +83,7 @@ positionFeature.setStyle(new ol.style.Style({ geolocation.on('change:position', function() { var coordinates = geolocation.getPosition(); positionFeature.setGeometry(coordinates ? - new ol.geom.Point(coordinates) : null); + new ol.geom.Point(coordinates) : null); }); new ol.layer.Vector({ diff --git a/examples/here-maps.js b/examples/here-maps.js index c9aa6b06c3f..c2f82baaffa 100644 --- a/examples/here-maps.js +++ b/examples/here-maps.js @@ -81,11 +81,11 @@ var map = new ol.Map({ function createUrl(tpl, layerDesc) { return tpl - .replace('{base}', layerDesc.base) - .replace('{type}', layerDesc.type) - .replace('{scheme}', layerDesc.scheme) - .replace('{app_id}', layerDesc.app_id) - .replace('{app_code}', layerDesc.app_code); + .replace('{base}', layerDesc.base) + .replace('{type}', layerDesc.type) + .replace('{scheme}', layerDesc.scheme) + .replace('{app_id}', layerDesc.app_id) + .replace('{app_code}', layerDesc.app_code); } var select = document.getElementById('layer-select'); diff --git a/examples/modify-test.js b/examples/modify-test.js index 0b7c31bf7f7..c0dcd7904bc 100644 --- a/examples/modify-test.js +++ b/examples/modify-test.js @@ -96,8 +96,8 @@ var geojsonObject = { '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]]] + [-3e6, -1e6], [-5e6, -1e6]], [[-4.5e6, -0.5e6], + [-3.5e6, -0.5e6], [-4e6, 0.5e6], [-4.5e6, -0.5e6]]] } }, { 'type': 'Feature', @@ -117,11 +117,11 @@ var geojsonObject = { 'type': 'MultiPolygon', 'coordinates': [ [[[-5e6, 6e6], [-5e6, 8e6], [-3e6, 8e6], - [-3e6, 6e6], [-5e6, 6e6]]], + [-3e6, 6e6], [-5e6, 6e6]]], [[[-3e6, 6e6], [-2e6, 8e6], [0, 8e6], - [0, 6e6], [-3e6, 6e6]]], + [0, 6e6], [-3e6, 6e6]]], [[[1e6, 6e6], [1e6, 8e6], [3e6, 8e6], - [3e6, 6e6], [1e6, 6e6]]] + [3e6, 6e6], [1e6, 6e6]]] ] } }, { diff --git a/examples/polygon-styles.js b/examples/polygon-styles.js index d8700c2792c..c585e7710c1 100644 --- a/examples/polygon-styles.js +++ b/examples/polygon-styles.js @@ -54,28 +54,28 @@ var geojsonObject = { 'geometry': { 'type': 'Polygon', 'coordinates': [[[-5e6, 6e6], [-5e6, 8e6], [-3e6, 8e6], - [-3e6, 6e6], [-5e6, 6e6]]] + [-3e6, 6e6], [-5e6, 6e6]]] } }, { 'type': 'Feature', 'geometry': { 'type': 'Polygon', 'coordinates': [[[-2e6, 6e6], [-2e6, 8e6], [0, 8e6], - [0, 6e6], [-2e6, 6e6]]] + [0, 6e6], [-2e6, 6e6]]] } }, { 'type': 'Feature', 'geometry': { 'type': 'Polygon', 'coordinates': [[[1e6, 6e6], [1e6, 8e6], [3e6, 8e6], - [3e6, 6e6], [1e6, 6e6]]] + [3e6, 6e6], [1e6, 6e6]]] } }, { 'type': 'Feature', 'geometry': { 'type': 'Polygon', 'coordinates': [[[-2e6, -1e6], [-1e6, 1e6], - [0, -1e6], [-2e6, -1e6]]] + [0, -1e6], [-2e6, -1e6]]] } }] }; diff --git a/examples/raster.js b/examples/raster.js index 3f6027dcf24..174452dd26c 100644 --- a/examples/raster.js +++ b/examples/raster.js @@ -162,13 +162,13 @@ function plot(resolution, counts, threshold) { var value = counts.min + (index * counts.delta); return 'bar' + (value >= threshold ? ' selected' : ''); }) - .attr('width', barWidth - 2); + .attr('width', barWidth - 2); bar.transition().attr('transform', function(value, index) { return 'translate(' + (index * barWidth) + ', ' + (plotHeight - yScale(value)) + ')'; }) - .attr('height', yScale); + .attr('height', yScale); bar.on('mousemove', function(count, index) { var threshold = counts.min + (index * counts.delta); diff --git a/examples/vector-wfs-getfeature.js b/examples/vector-wfs-getfeature.js index e2e98023955..ca4fae3dee0 100644 --- a/examples/vector-wfs-getfeature.js +++ b/examples/vector-wfs-getfeature.js @@ -47,8 +47,8 @@ var featureRequest = new ol.format.WFS().writeGetFeature({ featureTypes: ['water_areas'], outputFormat: 'application/json', filter: ol.format.filter.and( - ol.format.filter.like('name', 'Mississippi*'), - ol.format.filter.equalTo('waterway', 'riverbank') + ol.format.filter.like('name', 'Mississippi*'), + ol.format.filter.equalTo('waterway', 'riverbank') ) }); diff --git a/examples/xyz-esri-4326-512.js b/examples/xyz-esri-4326-512.js index 7baa19090f2..2ec995853f2 100644 --- a/examples/xyz-esri-4326-512.js +++ b/examples/xyz-esri-4326-512.js @@ -28,8 +28,8 @@ var map = new ol.Map({ tileSize: tileSize, tileUrlFunction: function(tileCoord) { return urlTemplate.replace('{z}', (tileCoord[0] - 1).toString()) - .replace('{x}', tileCoord[1].toString()) - .replace('{y}', (-tileCoord[2] - 1).toString()); + .replace('{x}', tileCoord[1].toString()) + .replace('{y}', (-tileCoord[2] - 1).toString()); }, wrapX: true }) diff --git a/src/ol/centerconstraint.js b/src/ol/centerconstraint.js index 9e8f8cddf07..17788495d88 100644 --- a/src/ol/centerconstraint.js +++ b/src/ol/centerconstraint.js @@ -9,20 +9,20 @@ goog.require('ol.math'); */ ol.CenterConstraint.createExtent = function(extent) { return ( - /** + /** * @param {ol.Coordinate|undefined} center Center. * @return {ol.Coordinate|undefined} Center. */ - function(center) { - if (center) { - return [ - ol.math.clamp(center[0], extent[0], extent[2]), - ol.math.clamp(center[1], extent[1], extent[3]) - ]; - } else { - return undefined; - } - }); + function(center) { + if (center) { + return [ + ol.math.clamp(center[0], extent[0], extent[2]), + ol.math.clamp(center[1], extent[1], extent[3]) + ]; + } else { + return undefined; + } + }); }; diff --git a/src/ol/color.js b/src/ol/color.js index b9b040740ad..37267295188 100644 --- a/src/ol/color.js +++ b/src/ol/color.js @@ -72,56 +72,56 @@ ol.color.fromNamed = function(color) { * @return {ol.Color} Color. */ ol.color.fromString = ( - function() { + function() { - // We maintain a small cache of parsed strings. To provide cheap LRU-like - // semantics, whenever the cache grows too large we simply delete an - // arbitrary 25% of the entries. + // We maintain a small cache of parsed strings. To provide cheap LRU-like + // semantics, whenever the cache grows too large we simply delete an + // arbitrary 25% of the entries. - /** + /** * @const * @type {number} */ - var MAX_CACHE_SIZE = 1024; + var MAX_CACHE_SIZE = 1024; - /** + /** * @type {Object.} */ - var cache = {}; + var cache = {}; - /** + /** * @type {number} */ - var cacheSize = 0; + var cacheSize = 0; - return ( - /** + return ( + /** * @param {string} s String. * @return {ol.Color} Color. */ - function(s) { - var color; - if (cache.hasOwnProperty(s)) { - color = cache[s]; - } else { - if (cacheSize >= MAX_CACHE_SIZE) { - var i = 0; - var key; - for (key in cache) { - if ((i++ & 3) === 0) { - delete cache[key]; - --cacheSize; - } - } + function(s) { + var color; + if (cache.hasOwnProperty(s)) { + color = cache[s]; + } else { + if (cacheSize >= MAX_CACHE_SIZE) { + var i = 0; + var key; + for (key in cache) { + if ((i++ & 3) === 0) { + delete cache[key]; + --cacheSize; } - color = ol.color.fromStringInternal_(s); - cache[s] = color; - ++cacheSize; } - return color; - }); - - })(); + } + color = ol.color.fromStringInternal_(s); + cache[s] = color; + ++cacheSize; + } + return color; + }); + + })(); /** diff --git a/src/ol/colorlike.js b/src/ol/colorlike.js index a0919f63ff9..c00ec5ab5d3 100644 --- a/src/ol/colorlike.js +++ b/src/ol/colorlike.js @@ -23,7 +23,7 @@ ol.colorlike.asColorLike = function(color) { */ ol.colorlike.isColorLike = function(color) { return ( - typeof color === 'string' || + typeof color === 'string' || color instanceof CanvasPattern || color instanceof CanvasGradient ); diff --git a/src/ol/control.js b/src/ol/control.js index 3c26d83a409..88fe299bbc1 100644 --- a/src/ol/control.js +++ b/src/ol/control.js @@ -35,7 +35,7 @@ ol.control.defaults = function(opt_options) { } var attributionControl = options.attribution !== undefined ? - options.attribution : true; + options.attribution : true; if (attributionControl) { controls.push(new ol.control.Attribution(options.attributionOptions)); } diff --git a/src/ol/control/attribution.js b/src/ol/control/attribution.js index 36693993e4f..70545826597 100644 --- a/src/ol/control/attribution.js +++ b/src/ol/control/attribution.js @@ -53,7 +53,7 @@ ol.control.Attribution = function(opt_options) { * @type {boolean} */ this.collapsible_ = options.collapsible !== undefined ? - options.collapsible : true; + options.collapsible : true; if (!this.collapsible_) { this.collapsed_ = false; @@ -91,7 +91,7 @@ ol.control.Attribution = function(opt_options) { var activeLabel = (this.collapsible_ && !this.collapsed_) ? - this.collapseLabel_ : this.label_; + this.collapseLabel_ : this.label_; var button = document.createElement('button'); button.setAttribute('type', 'button'); button.title = tipLabel; diff --git a/src/ol/control/control.js b/src/ol/control/control.js index 5491bd0c444..e3330e76ae1 100644 --- a/src/ol/control/control.js +++ b/src/ol/control/control.js @@ -115,7 +115,7 @@ ol.control.Control.prototype.setMap = function(map) { this.map_ = map; if (this.map_) { var target = this.target_ ? - this.target_ : map.getOverlayContainerStopEvent(); + this.target_ : map.getOverlayContainerStopEvent(); target.appendChild(this.element); if (this.render !== ol.nullFunction) { this.listenerKeys.push(ol.events.listen(map, diff --git a/src/ol/control/fullscreen.js b/src/ol/control/fullscreen.js index 597650383c7..4a6cdae3c45 100644 --- a/src/ol/control/fullscreen.js +++ b/src/ol/control/fullscreen.js @@ -34,7 +34,7 @@ ol.control.FullScreen = function(opt_options) { * @type {string} */ this.cssClassName_ = options.className !== undefined ? options.className : - 'ol-full-screen'; + 'ol-full-screen'; var label = options.label !== undefined ? options.label : '\u2922'; @@ -43,7 +43,7 @@ ol.control.FullScreen = function(opt_options) { * @type {Node} */ this.labelNode_ = typeof label === 'string' ? - document.createTextNode(label) : label; + document.createTextNode(label) : label; var labelActive = options.labelActive !== undefined ? options.labelActive : '\u00d7'; @@ -52,7 +52,7 @@ ol.control.FullScreen = function(opt_options) { * @type {Node} */ this.labelActiveNode_ = typeof labelActive === 'string' ? - document.createTextNode(labelActive) : labelActive; + document.createTextNode(labelActive) : labelActive; var tipLabel = options.tipLabel ? options.tipLabel : 'Toggle full-screen'; var button = document.createElement('button'); diff --git a/src/ol/control/mouseposition.js b/src/ol/control/mouseposition.js index 3532b25925f..b49d8fa37fd 100644 --- a/src/ol/control/mouseposition.js +++ b/src/ol/control/mouseposition.js @@ -31,7 +31,7 @@ ol.control.MousePosition = function(opt_options) { element.className = options.className !== undefined ? options.className : 'ol-mouse-position'; var render = options.render ? - options.render : ol.control.MousePosition.render; + options.render : ol.control.MousePosition.render; ol.control.Control.call(this, { element: element, @@ -122,7 +122,7 @@ ol.control.MousePosition.prototype.handleProjectionChanged_ = function() { */ ol.control.MousePosition.prototype.getCoordinateFormat = function() { return /** @type {ol.CoordinateFormatType|undefined} */ ( - this.get(ol.control.MousePosition.Property_.COORDINATE_FORMAT)); + this.get(ol.control.MousePosition.Property_.COORDINATE_FORMAT)); }; @@ -135,7 +135,7 @@ ol.control.MousePosition.prototype.getCoordinateFormat = function() { */ ol.control.MousePosition.prototype.getProjection = function() { return /** @type {ol.proj.Projection|undefined} */ ( - this.get(ol.control.MousePosition.Property_.PROJECTION)); + this.get(ol.control.MousePosition.Property_.PROJECTION)); }; diff --git a/src/ol/control/overviewmap.js b/src/ol/control/overviewmap.js index 31ca836f2b5..1244f16de85 100644 --- a/src/ol/control/overviewmap.js +++ b/src/ol/control/overviewmap.js @@ -42,7 +42,7 @@ ol.control.OverviewMap = function(opt_options) { * @type {boolean} */ this.collapsible_ = options.collapsible !== undefined ? - options.collapsible : true; + options.collapsible : true; if (!this.collapsible_) { this.collapsed_ = false; @@ -80,7 +80,7 @@ ol.control.OverviewMap = function(opt_options) { } var activeLabel = (this.collapsible_ && !this.collapsed_) ? - this.collapseLabel_ : this.label_; + this.collapseLabel_ : this.label_; var button = document.createElement('button'); button.setAttribute('type', 'button'); button.title = tipLabel; diff --git a/src/ol/control/scaleline.js b/src/ol/control/scaleline.js index 08ad6a1f5f5..e5ed098b8a2 100644 --- a/src/ol/control/scaleline.js +++ b/src/ol/control/scaleline.js @@ -112,7 +112,7 @@ ol.control.ScaleLine.LEADING_DIGITS = [1, 2, 5]; */ ol.control.ScaleLine.prototype.getUnits = function() { return /** @type {ol.control.ScaleLineUnits|undefined} */ ( - this.get(ol.control.ScaleLine.Property_.UNITS)); + this.get(ol.control.ScaleLine.Property_.UNITS)); }; diff --git a/src/ol/control/zoom.js b/src/ol/control/zoom.js index 8d6b9811d61..4b06e6e0c5c 100644 --- a/src/ol/control/zoom.js +++ b/src/ol/control/zoom.js @@ -31,16 +31,16 @@ ol.control.Zoom = function(opt_options) { var zoomOutLabel = options.zoomOutLabel !== undefined ? options.zoomOutLabel : '\u2212'; var zoomInTipLabel = options.zoomInTipLabel !== undefined ? - options.zoomInTipLabel : 'Zoom in'; + options.zoomInTipLabel : 'Zoom in'; var zoomOutTipLabel = options.zoomOutTipLabel !== undefined ? - options.zoomOutTipLabel : 'Zoom out'; + options.zoomOutTipLabel : 'Zoom out'; var inElement = document.createElement('button'); inElement.className = className + '-in'; inElement.setAttribute('type', 'button'); inElement.title = zoomInTipLabel; inElement.appendChild( - typeof zoomInLabel === 'string' ? document.createTextNode(zoomInLabel) : zoomInLabel + typeof zoomInLabel === 'string' ? document.createTextNode(zoomInLabel) : zoomInLabel ); ol.events.listen(inElement, ol.events.EventType.CLICK, @@ -51,7 +51,7 @@ ol.control.Zoom = function(opt_options) { outElement.setAttribute('type', 'button'); outElement.title = zoomOutTipLabel; outElement.appendChild( - typeof zoomOutLabel === 'string' ? document.createTextNode(zoomOutLabel) : zoomOutLabel + typeof zoomOutLabel === 'string' ? document.createTextNode(zoomOutLabel) : zoomOutLabel ); ol.events.listen(outElement, ol.events.EventType.CLICK, diff --git a/src/ol/control/zoomtoextent.js b/src/ol/control/zoomtoextent.js index 9dd17855ede..df6ada888e0 100644 --- a/src/ol/control/zoomtoextent.js +++ b/src/ol/control/zoomtoextent.js @@ -27,16 +27,16 @@ ol.control.ZoomToExtent = function(opt_options) { this.extent_ = options.extent ? options.extent : null; var className = options.className !== undefined ? options.className : - 'ol-zoom-extent'; + 'ol-zoom-extent'; var label = options.label !== undefined ? options.label : 'E'; var tipLabel = options.tipLabel !== undefined ? - options.tipLabel : 'Fit to extent'; + options.tipLabel : 'Fit to extent'; var button = document.createElement('button'); button.setAttribute('type', 'button'); button.title = tipLabel; button.appendChild( - typeof label === 'string' ? document.createTextNode(label) : label + typeof label === 'string' ? document.createTextNode(label) : label ); ol.events.listen(button, ol.events.EventType.CLICK, diff --git a/src/ol/coordinate.js b/src/ol/coordinate.js index e1c7a7bc2c8..af16fad0215 100644 --- a/src/ol/coordinate.js +++ b/src/ol/coordinate.js @@ -80,7 +80,7 @@ ol.coordinate.closestOnSegment = function(coordinate, segment) { var dx = x2 - x1; var dy = y2 - y1; var along = (dx === 0 && dy === 0) ? 0 : - ((dx * (x0 - x1)) + (dy * (y0 - y1))) / ((dx * dx + dy * dy) || 0); + ((dx * (x0 - x1)) + (dy * (y0 - y1))) / ((dx * dx + dy * dy) || 0); var x, y; if (along <= 0) { x = x1; @@ -121,13 +121,13 @@ ol.coordinate.closestOnSegment = function(coordinate, segment) { */ ol.coordinate.createStringXY = function(opt_fractionDigits) { return ( - /** + /** * @param {ol.Coordinate|undefined} coordinate Coordinate. * @return {string} String XY. */ - function(coordinate) { - return ol.coordinate.toStringXY(coordinate, opt_fractionDigits); - }); + function(coordinate) { + return ol.coordinate.toStringXY(coordinate, opt_fractionDigits); + }); }; @@ -195,8 +195,8 @@ ol.coordinate.degreesToStringHDMS = function(hemispheres, degrees, opt_fractionD ol.coordinate.format = function(coordinate, template, opt_fractionDigits) { if (coordinate) { return template - .replace('{x}', coordinate[0].toFixed(opt_fractionDigits)) - .replace('{y}', coordinate[1].toFixed(opt_fractionDigits)); + .replace('{x}', coordinate[0].toFixed(opt_fractionDigits)) + .replace('{y}', coordinate[1].toFixed(opt_fractionDigits)); } else { return ''; } diff --git a/src/ol/deviceorientation.js b/src/ol/deviceorientation.js index e4094443282..beb9c61977b 100644 --- a/src/ol/deviceorientation.js +++ b/src/ol/deviceorientation.js @@ -132,7 +132,7 @@ ol.DeviceOrientation.prototype.orientationChange_ = function(originalEvent) { */ ol.DeviceOrientation.prototype.getAlpha = function() { return /** @type {number|undefined} */ ( - this.get(ol.DeviceOrientation.Property_.ALPHA)); + this.get(ol.DeviceOrientation.Property_.ALPHA)); }; @@ -145,7 +145,7 @@ ol.DeviceOrientation.prototype.getAlpha = function() { */ ol.DeviceOrientation.prototype.getBeta = function() { return /** @type {number|undefined} */ ( - this.get(ol.DeviceOrientation.Property_.BETA)); + this.get(ol.DeviceOrientation.Property_.BETA)); }; @@ -158,7 +158,7 @@ ol.DeviceOrientation.prototype.getBeta = function() { */ ol.DeviceOrientation.prototype.getGamma = function() { return /** @type {number|undefined} */ ( - this.get(ol.DeviceOrientation.Property_.GAMMA)); + this.get(ol.DeviceOrientation.Property_.GAMMA)); }; @@ -171,7 +171,7 @@ ol.DeviceOrientation.prototype.getGamma = function() { */ ol.DeviceOrientation.prototype.getHeading = function() { return /** @type {number|undefined} */ ( - this.get(ol.DeviceOrientation.Property_.HEADING)); + this.get(ol.DeviceOrientation.Property_.HEADING)); }; @@ -183,7 +183,7 @@ ol.DeviceOrientation.prototype.getHeading = function() { */ ol.DeviceOrientation.prototype.getTracking = function() { return /** @type {boolean} */ ( - this.get(ol.DeviceOrientation.Property_.TRACKING)); + this.get(ol.DeviceOrientation.Property_.TRACKING)); }; diff --git a/src/ol/events/condition.js b/src/ol/events/condition.js index 1b5d3ae8560..46b2730510f 100644 --- a/src/ol/events/condition.js +++ b/src/ol/events/condition.js @@ -17,7 +17,7 @@ goog.require('ol.has'); ol.events.condition.altKeyOnly = function(mapBrowserEvent) { var originalEvent = mapBrowserEvent.originalEvent; return ( - originalEvent.altKey && + originalEvent.altKey && !(originalEvent.metaKey || originalEvent.ctrlKey) && !originalEvent.shiftKey); }; @@ -34,7 +34,7 @@ ol.events.condition.altKeyOnly = function(mapBrowserEvent) { ol.events.condition.altShiftKeysOnly = function(mapBrowserEvent) { var originalEvent = mapBrowserEvent.originalEvent; return ( - originalEvent.altKey && + originalEvent.altKey && !(originalEvent.metaKey || originalEvent.ctrlKey) && originalEvent.shiftKey); }; @@ -138,7 +138,7 @@ ol.events.condition.doubleClick = function(mapBrowserEvent) { ol.events.condition.noModifierKeys = function(mapBrowserEvent) { var originalEvent = mapBrowserEvent.originalEvent; return ( - !originalEvent.altKey && + !originalEvent.altKey && !(originalEvent.metaKey || originalEvent.ctrlKey) && !originalEvent.shiftKey); }; @@ -156,7 +156,7 @@ ol.events.condition.noModifierKeys = function(mapBrowserEvent) { ol.events.condition.platformModifierKeyOnly = function(mapBrowserEvent) { var originalEvent = mapBrowserEvent.originalEvent; return ( - !originalEvent.altKey && + !originalEvent.altKey && (ol.has.MAC ? originalEvent.metaKey : originalEvent.ctrlKey) && !originalEvent.shiftKey); }; @@ -173,7 +173,7 @@ ol.events.condition.platformModifierKeyOnly = function(mapBrowserEvent) { ol.events.condition.shiftKeyOnly = function(mapBrowserEvent) { var originalEvent = mapBrowserEvent.originalEvent; return ( - !originalEvent.altKey && + !originalEvent.altKey && !(originalEvent.metaKey || originalEvent.ctrlKey) && originalEvent.shiftKey); }; @@ -191,7 +191,7 @@ ol.events.condition.targetNotEditable = function(mapBrowserEvent) { var target = mapBrowserEvent.originalEvent.target; var tagName = target.tagName; return ( - tagName !== 'INPUT' && + tagName !== 'INPUT' && tagName !== 'SELECT' && tagName !== 'TEXTAREA'); }; diff --git a/src/ol/events/event.js b/src/ol/events/event.js index c88f6de92d7..cee7aa9b612 100644 --- a/src/ol/events/event.js +++ b/src/ol/events/event.js @@ -53,9 +53,9 @@ ol.events.Event.prototype.preventDefault = * @override * @api */ -ol.events.Event.prototype.stopPropagation = function() { - this.propagationStopped = true; -}; + ol.events.Event.prototype.stopPropagation = function() { + this.propagationStopped = true; + }; /** diff --git a/src/ol/events/eventtarget.js b/src/ol/events/eventtarget.js index cb43899877f..5e13f711617 100644 --- a/src/ol/events/eventtarget.js +++ b/src/ol/events/eventtarget.js @@ -131,8 +131,8 @@ ol.events.EventTarget.prototype.getListeners = function(type) { */ ol.events.EventTarget.prototype.hasListener = function(opt_type) { return opt_type ? - opt_type in this.listeners_ : - Object.keys(this.listeners_).length > 0; + opt_type in this.listeners_ : + Object.keys(this.listeners_).length > 0; }; diff --git a/src/ol/feature.js b/src/ol/feature.js index 9ef74da41d2..66b371556f9 100644 --- a/src/ol/feature.js +++ b/src/ol/feature.js @@ -140,7 +140,7 @@ ol.Feature.prototype.clone = function() { */ ol.Feature.prototype.getGeometry = function() { return /** @type {ol.geom.Geometry|undefined} */ ( - this.get(this.geometryName_)); + this.get(this.geometryName_)); }; @@ -240,7 +240,7 @@ ol.Feature.prototype.setGeometry = function(geometry) { ol.Feature.prototype.setStyle = function(style) { this.style_ = style; this.styleFunction_ = !style ? - undefined : ol.Feature.createStyleFunction(style); + undefined : ol.Feature.createStyleFunction(style); this.changed(); }; diff --git a/src/ol/featureloader.js b/src/ol/featureloader.js index c605445b93c..45f46696aef 100644 --- a/src/ol/featureloader.js +++ b/src/ol/featureloader.js @@ -18,60 +18,60 @@ goog.require('ol.xml'); */ ol.featureloader.loadFeaturesXhr = function(url, format, success, failure) { return ( - /** + /** * @param {ol.Extent} extent Extent. * @param {number} resolution Resolution. * @param {ol.proj.Projection} projection Projection. * @this {ol.source.Vector|ol.VectorTile} */ - function(extent, resolution, projection) { - var xhr = new XMLHttpRequest(); - xhr.open('GET', - typeof url === 'function' ? url(extent, resolution, projection) : url, - true); - if (format.getType() == ol.format.FormatType.ARRAY_BUFFER) { - xhr.responseType = 'arraybuffer'; - } - /** + function(extent, resolution, projection) { + var xhr = new XMLHttpRequest(); + xhr.open('GET', + typeof url === 'function' ? url(extent, resolution, projection) : url, + true); + if (format.getType() == ol.format.FormatType.ARRAY_BUFFER) { + xhr.responseType = 'arraybuffer'; + } + /** * @param {Event} event Event. * @private */ - xhr.onload = function(event) { - // status will be 0 for file:// urls - if (!xhr.status || xhr.status >= 200 && xhr.status < 300) { - var type = format.getType(); - /** @type {Document|Node|Object|string|undefined} */ - var source; - if (type == ol.format.FormatType.JSON || + xhr.onload = function(event) { + // status will be 0 for file:// urls + if (!xhr.status || xhr.status >= 200 && xhr.status < 300) { + var type = format.getType(); + /** @type {Document|Node|Object|string|undefined} */ + var source; + if (type == ol.format.FormatType.JSON || type == ol.format.FormatType.TEXT) { - source = xhr.responseText; - } else if (type == ol.format.FormatType.XML) { - source = xhr.responseXML; - if (!source) { - source = ol.xml.parse(xhr.responseText); - } - } else if (type == ol.format.FormatType.ARRAY_BUFFER) { - source = /** @type {ArrayBuffer} */ (xhr.response); - } - if (source) { - success.call(this, format.readFeatures(source, - {featureProjection: projection}), - format.readProjection(source)); - } else { - failure.call(this); + source = xhr.responseText; + } else if (type == ol.format.FormatType.XML) { + source = xhr.responseXML; + if (!source) { + source = ol.xml.parse(xhr.responseText); } + } else if (type == ol.format.FormatType.ARRAY_BUFFER) { + source = /** @type {ArrayBuffer} */ (xhr.response); + } + if (source) { + success.call(this, format.readFeatures(source, + {featureProjection: projection}), + format.readProjection(source)); } else { failure.call(this); } - }.bind(this); - /** + } else { + failure.call(this); + } + }.bind(this); + /** * @private */ - xhr.onerror = function() { - failure.call(this); - }.bind(this); - xhr.send(); - }); + xhr.onerror = function() { + failure.call(this); + }.bind(this); + xhr.send(); + }); }; diff --git a/src/ol/format/esrijson.js b/src/ol/format/esrijson.js index ce0e5e6d1a3..474494eb990 100644 --- a/src/ol/format/esrijson.js +++ b/src/ol/format/esrijson.js @@ -83,8 +83,8 @@ ol.format.EsriJSON.readGeometry_ = function(object, opt_options) { } var geometryReader = ol.format.EsriJSON.GEOMETRY_READERS_[type]; return /** @type {ol.geom.Geometry} */ ( - ol.format.Feature.transformWithOptions( - geometryReader(object), false, opt_options)); + ol.format.Feature.transformWithOptions( + geometryReader(object), false, opt_options)); }; @@ -123,7 +123,7 @@ ol.format.EsriJSON.convertRings_ = function(rings, layout) { var outerRing = outerRings[i][0]; if (ol.extent.containsExtent(new ol.geom.LinearRing( outerRing).getExtent(), - new ol.geom.LinearRing(hole).getExtent())) { + new ol.geom.LinearRing(hole).getExtent())) { // the hole is contained push it into our polygon outerRings[i].push(hole); matched = true; @@ -468,7 +468,7 @@ ol.format.EsriJSON.prototype.readFeatureFromObject = function( if (opt_options && opt_options.idField && esriJSONFeature.attributes[opt_options.idField]) { feature.setId(/** @type {number} */( - esriJSONFeature.attributes[opt_options.idField])); + esriJSONFeature.attributes[opt_options.idField])); } if (esriJSONFeature.attributes) { feature.setProperties(esriJSONFeature.attributes); @@ -559,8 +559,8 @@ ol.format.EsriJSON.prototype.readProjectionFromObject = function(object) { ol.format.EsriJSON.writeGeometry_ = function(geometry, opt_options) { var geometryWriter = ol.format.EsriJSON.GEOMETRY_WRITERS_[geometry.getType()]; return geometryWriter(/** @type {ol.geom.Geometry} */ ( - ol.format.Feature.transformWithOptions(geometry, true, opt_options)), - opt_options); + ol.format.Feature.transformWithOptions(geometry, true, opt_options)), + opt_options); }; diff --git a/src/ol/format/feature.js b/src/ol/format/feature.js index 5887dcc1060..422d76434ab 100644 --- a/src/ol/format/feature.js +++ b/src/ol/format/feature.js @@ -47,7 +47,7 @@ ol.format.Feature.prototype.getReadOptions = function(source, opt_options) { if (opt_options) { options = { dataProjection: opt_options.dataProjection ? - opt_options.dataProjection : this.readProjection(source), + opt_options.dataProjection : this.readProjection(source), featureProjection: opt_options.featureProjection }; } @@ -166,9 +166,9 @@ ol.format.Feature.prototype.writeGeometry = function(geometry, opt_options) {}; ol.format.Feature.transformWithOptions = function( geometry, write, opt_options) { var featureProjection = opt_options ? - ol.proj.get(opt_options.featureProjection) : null; + ol.proj.get(opt_options.featureProjection) : null; var dataProjection = opt_options ? - ol.proj.get(opt_options.dataProjection) : null; + ol.proj.get(opt_options.dataProjection) : null; /** * @type {ol.geom.Geometry|ol.Extent} */ diff --git a/src/ol/format/filter.js b/src/ol/format/filter.js index 6d67dc6cb80..49649869d6c 100644 --- a/src/ol/format/filter.js +++ b/src/ol/format/filter.js @@ -229,7 +229,7 @@ ol.format.filter.between = function(propertyName, lowerBoundary, upperBoundary) ol.format.filter.like = function(propertyName, pattern, opt_wildCard, opt_singleChar, opt_escapeChar, opt_matchCase) { return new ol.format.filter.IsLike(propertyName, pattern, - opt_wildCard, opt_singleChar, opt_escapeChar, opt_matchCase); + opt_wildCard, opt_singleChar, opt_escapeChar, opt_matchCase); }; diff --git a/src/ol/format/geojson.js b/src/ol/format/geojson.js index 99a9750b96d..f3f18e386c5 100644 --- a/src/ol/format/geojson.js +++ b/src/ol/format/geojson.js @@ -39,7 +39,7 @@ ol.format.GeoJSON = function(opt_options) { */ this.defaultDataProjection = ol.proj.get( options.defaultDataProjection ? - options.defaultDataProjection : 'EPSG:4326'); + options.defaultDataProjection : 'EPSG:4326'); if (options.featureProjection) { @@ -69,8 +69,8 @@ ol.format.GeoJSON.readGeometry_ = function(object, opt_options) { } var geometryReader = ol.format.GeoJSON.GEOMETRY_READERS_[object.type]; return /** @type {ol.geom.Geometry} */ ( - ol.format.Feature.transformWithOptions( - geometryReader(object), false, opt_options)); + ol.format.Feature.transformWithOptions( + geometryReader(object), false, opt_options)); }; @@ -163,8 +163,8 @@ ol.format.GeoJSON.readPolygonGeometry_ = function(object) { ol.format.GeoJSON.writeGeometry_ = function(geometry, opt_options) { var geometryWriter = ol.format.GeoJSON.GEOMETRY_WRITERS_[geometry.getType()]; return geometryWriter(/** @type {ol.geom.Geometry} */ ( - ol.format.Feature.transformWithOptions(geometry, true, opt_options)), - opt_options); + ol.format.Feature.transformWithOptions(geometry, true, opt_options)), + opt_options); }; diff --git a/src/ol/format/gml2.js b/src/ol/format/gml2.js index b0552efa687..fb7661e5fde 100644 --- a/src/ol/format/gml2.js +++ b/src/ol/format/gml2.js @@ -35,7 +35,7 @@ ol.format.GML2 = function(opt_options) { * @inheritDoc */ this.schemaLocation = options.schemaLocation ? - options.schemaLocation : ol.format.GML2.schemaLocation_; + options.schemaLocation : ol.format.GML2.schemaLocation_; }; ol.inherits(ol.format.GML2, ol.format.GMLBase); @@ -469,8 +469,8 @@ ol.format.GML2.prototype.getCoords_ = function(point, opt_srsName, opt_hasZ) { axisOrientation = ol.proj.get(opt_srsName).getAxisOrientation(); } var coords = ((axisOrientation.substr(0, 2) === 'en') ? - point[0] + ',' + point[1] : - point[1] + ',' + point[0]); + point[0] + ',' + point[1] : + point[1] + ',' + point[0]); if (opt_hasZ) { // For newly created points, Z can be undefined. var z = point[2] || 0; diff --git a/src/ol/format/gml3.js b/src/ol/format/gml3.js index 429c7b0a12e..d2041ed356b 100644 --- a/src/ol/format/gml3.js +++ b/src/ol/format/gml3.js @@ -52,20 +52,20 @@ ol.format.GML3 = function(opt_options) { * @type {boolean} */ this.multiCurve_ = options.multiCurve !== undefined ? - options.multiCurve : true; + options.multiCurve : true; /** * @private * @type {boolean} */ this.multiSurface_ = options.multiSurface !== undefined ? - options.multiSurface : true; + options.multiSurface : true; /** * @inheritDoc */ this.schemaLocation = options.schemaLocation ? - options.schemaLocation : ol.format.GML3.schemaLocation_; + options.schemaLocation : ol.format.GML3.schemaLocation_; }; ol.inherits(ol.format.GML3, ol.format.GMLBase); @@ -601,8 +601,8 @@ ol.format.GML3.prototype.getCoords_ = function(point, opt_srsName, opt_hasZ) { axisOrientation = ol.proj.get(opt_srsName).getAxisOrientation(); } var coords = ((axisOrientation.substr(0, 2) === 'en') ? - point[0] + ' ' + point[1] : - point[1] + ' ' + point[0]); + point[0] + ' ' + point[1] : + point[1] + ' ' + point[0]); if (opt_hasZ) { // For newly created points, Z can be undefined. var z = point[2] || 0; diff --git a/src/ol/format/gmlbase.js b/src/ol/format/gmlbase.js index 4698654bca2..1371ffa453a 100644 --- a/src/ol/format/gmlbase.js +++ b/src/ol/format/gmlbase.js @@ -167,12 +167,12 @@ ol.format.GMLBase.prototype.readFeaturesInternal = function(node, objectStack) { var parsers = {}; for (i = 0, ii = featureTypes.length; i < ii; ++i) { var featurePrefix = featureTypes[i].indexOf(':') === -1 ? - defaultPrefix : featureTypes[i].split(':')[0]; + defaultPrefix : featureTypes[i].split(':')[0]; if (featurePrefix === p) { parsers[featureTypes[i].split(':').pop()] = (localName == 'featureMembers') ? - ol.xml.makeArrayPusher(this.readFeatureElement, this) : - ol.xml.makeReplacer(this.readFeatureElement, this); + ol.xml.makeArrayPusher(this.readFeatureElement, this) : + ol.xml.makeReplacer(this.readFeatureElement, this); } } parsersNS[featureNS[p]] = parsers; @@ -203,7 +203,7 @@ ol.format.GMLBase.prototype.readGeometryElement = function(node, objectStack) { this.GEOMETRY_PARSERS_, node, objectStack, this); if (geometry) { return /** @type {ol.geom.Geometry} */ ( - ol.format.Feature.transformWithOptions(geometry, false, context)); + ol.format.Feature.transformWithOptions(geometry, false, context)); } else { return undefined; } @@ -590,5 +590,5 @@ ol.format.GMLBase.prototype.readFeaturesFromNode = function(node, opt_options) { */ ol.format.GMLBase.prototype.readProjectionFromNode = function(node) { return ol.proj.get(this.srsName ? this.srsName : - node.firstElementChild.getAttribute('srsName')); + node.firstElementChild.getAttribute('srsName')); }; diff --git a/src/ol/format/gpx.js b/src/ol/format/gpx.js index ff96f29ab4d..d9ec341f26a 100644 --- a/src/ol/format/gpx.js +++ b/src/ol/format/gpx.js @@ -606,8 +606,8 @@ ol.format.GPX.writeWptType_ = function(node, coordinate, objectStack) { // pass } var orderedKeys = (node.nodeName == 'rtept') ? - ol.format.GPX.RTEPT_TYPE_SEQUENCE_[namespaceURI] : - ol.format.GPX.WPT_TYPE_SEQUENCE_[namespaceURI]; + ol.format.GPX.RTEPT_TYPE_SEQUENCE_[namespaceURI] : + ol.format.GPX.WPT_TYPE_SEQUENCE_[namespaceURI]; var values = ol.xml.makeSequence(properties, orderedKeys); ol.xml.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */ ({node: node, 'properties': properties}), @@ -629,7 +629,7 @@ ol.format.GPX.writeRte_ = function(node, feature, objectStack) { var geometry = feature.getGeometry(); if (geometry) { geometry = /** @type {ol.geom.LineString} */ - (ol.format.Feature.transformWithOptions(geometry, true, options)); + (ol.format.Feature.transformWithOptions(geometry, true, options)); context['geometryLayout'] = geometry.getLayout(); properties['rtept'] = geometry.getCoordinates(); } @@ -656,7 +656,7 @@ ol.format.GPX.writeTrk_ = function(node, feature, objectStack) { var geometry = feature.getGeometry(); if (geometry) { geometry = /** @type {ol.geom.MultiLineString} */ - (ol.format.Feature.transformWithOptions(geometry, true, options)); + (ol.format.Feature.transformWithOptions(geometry, true, options)); properties['trkseg'] = geometry.getLineStrings(); } var parentNode = objectStack[objectStack.length - 1].node; @@ -697,7 +697,7 @@ ol.format.GPX.writeWpt_ = function(node, feature, objectStack) { var geometry = feature.getGeometry(); if (geometry) { geometry = /** @type {ol.geom.Point} */ - (ol.format.Feature.transformWithOptions(geometry, true, options)); + (ol.format.Feature.transformWithOptions(geometry, true, options)); context['geometryLayout'] = geometry.getLayout(); ol.format.GPX.writeWptType_(node, geometry.getCoordinates(), objectStack); } diff --git a/src/ol/format/igc.js b/src/ol/format/igc.js index 19db22cf4df..f052b0ffa9c 100644 --- a/src/ol/format/igc.js +++ b/src/ol/format/igc.js @@ -35,7 +35,7 @@ ol.format.IGC = function(opt_options) { * @type {ol.format.IGCZ} */ this.altitudeMode_ = options.altitudeMode ? - options.altitudeMode : ol.format.IGCZ.NONE; + options.altitudeMode : ol.format.IGCZ.NONE; }; ol.inherits(ol.format.IGC, ol.format.TextFeature); @@ -158,7 +158,7 @@ ol.format.IGC.prototype.readFeatureFromText = function(text, opt_options) { } var lineString = new ol.geom.LineString(null); var layout = altitudeMode == ol.format.IGCZ.NONE ? - ol.geom.GeometryLayout.XYM : ol.geom.GeometryLayout.XYZM; + ol.geom.GeometryLayout.XYM : ol.geom.GeometryLayout.XYZM; lineString.setFlatCoordinates(layout, flatCoordinates); var feature = new ol.Feature(ol.format.Feature.transformWithOptions( lineString, false, opt_options)); diff --git a/src/ol/format/kml.js b/src/ol/format/kml.js index cefbde6d71c..881ebe04059 100644 --- a/src/ol/format/kml.js +++ b/src/ol/format/kml.js @@ -66,21 +66,21 @@ ol.format.KML = function(opt_options) { * @type {Array.} */ this.defaultStyle_ = options.defaultStyle ? - options.defaultStyle : ol.format.KML.DEFAULT_STYLE_ARRAY_; + options.defaultStyle : ol.format.KML.DEFAULT_STYLE_ARRAY_; /** * @private * @type {boolean} */ this.extractStyles_ = options.extractStyles !== undefined ? - options.extractStyles : true; + options.extractStyles : true; /** * @private * @type {boolean} */ this.writeStyles_ = options.writeStyles !== undefined ? - options.writeStyles : true; + options.writeStyles : true; /** * @private @@ -93,7 +93,7 @@ ol.format.KML = function(opt_options) { * @type {boolean} */ this.showPointNames_ = options.showPointNames !== undefined ? - options.showPointNames : true; + options.showPointNames : true; }; ol.inherits(ol.format.KML, ol.format.XMLFeature); @@ -353,53 +353,53 @@ ol.format.KML.createFeatureStyleFunction_ = function(style, styleUrl, defaultStyle, sharedStyles, showPointNames) { return ( - /** + /** * @param {number} resolution Resolution. * @return {Array.} Style. * @this {ol.Feature} */ - function(resolution) { - var drawName = showPointNames; - /** @type {ol.style.Style|undefined} */ - var nameStyle; - var name = ''; - if (drawName) { - if (this.getGeometry()) { - drawName = (this.getGeometry().getType() === + function(resolution) { + var drawName = showPointNames; + /** @type {ol.style.Style|undefined} */ + var nameStyle; + var name = ''; + if (drawName) { + if (this.getGeometry()) { + drawName = (this.getGeometry().getType() === ol.geom.GeometryType.POINT); - } } + } - if (drawName) { - name = /** @type {string} */ (this.get('name')); - drawName = drawName && name; - } + if (drawName) { + name = /** @type {string} */ (this.get('name')); + drawName = drawName && name; + } - if (style) { - if (drawName) { - nameStyle = ol.format.KML.createNameStyleFunction_(style[0], - name); - return style.concat(nameStyle); - } - return style; - } - if (styleUrl) { - var foundStyle = ol.format.KML.findStyle_(styleUrl, defaultStyle, - sharedStyles); - if (drawName) { - nameStyle = ol.format.KML.createNameStyleFunction_(foundStyle[0], - name); - return foundStyle.concat(nameStyle); - } - return foundStyle; + if (style) { + if (drawName) { + nameStyle = ol.format.KML.createNameStyleFunction_(style[0], + name); + return style.concat(nameStyle); } + return style; + } + if (styleUrl) { + var foundStyle = ol.format.KML.findStyle_(styleUrl, defaultStyle, + sharedStyles); if (drawName) { - nameStyle = ol.format.KML.createNameStyleFunction_(defaultStyle[0], + nameStyle = ol.format.KML.createNameStyleFunction_(foundStyle[0], name); - return defaultStyle.concat(nameStyle); + return foundStyle.concat(nameStyle); } - return defaultStyle; - }); + return foundStyle; + } + if (drawName) { + nameStyle = ol.format.KML.createNameStyleFunction_(defaultStyle[0], + name); + return defaultStyle.concat(nameStyle); + } + return defaultStyle; + }); }; @@ -549,7 +549,7 @@ ol.format.KML.readStyleMapValue_ = function(node, objectStack) { return ol.xml.pushParseAndPop(undefined, ol.format.KML.STYLE_MAP_PARSERS_, node, objectStack); }; - /** +/** * @param {Node} node Node. * @param {Array.<*>} objectStack Object stack. * @private @@ -807,7 +807,7 @@ ol.format.KML.readGxTrack_ = function(node, objectStack) { var whens = gxTrackObject.whens; var i, ii; for (i = 0, ii = Math.min(flatCoordinates.length, whens.length); i < ii; - ++i) { + ++i) { flatCoordinates[4 * i + 3] = whens[i]; } var lineString = new ol.geom.LineString(null); @@ -1021,23 +1021,23 @@ ol.format.KML.readStyle_ = function(node, objectStack) { } var fillStyle = /** @type {ol.style.Fill} */ ('fillStyle' in styleObject ? - styleObject['fillStyle'] : ol.format.KML.DEFAULT_FILL_STYLE_); + styleObject['fillStyle'] : ol.format.KML.DEFAULT_FILL_STYLE_); var fill = /** @type {boolean|undefined} */ (styleObject['fill']); if (fill !== undefined && !fill) { fillStyle = null; } var imageStyle = /** @type {ol.style.Image} */ ('imageStyle' in styleObject ? - styleObject['imageStyle'] : ol.format.KML.DEFAULT_IMAGE_STYLE_); + styleObject['imageStyle'] : ol.format.KML.DEFAULT_IMAGE_STYLE_); if (imageStyle == ol.format.KML.DEFAULT_NO_IMAGE_STYLE_) { imageStyle = undefined; } var textStyle = /** @type {ol.style.Text} */ ('textStyle' in styleObject ? - styleObject['textStyle'] : ol.format.KML.DEFAULT_TEXT_STYLE_); + styleObject['textStyle'] : ol.format.KML.DEFAULT_TEXT_STYLE_); var strokeStyle = /** @type {ol.style.Stroke} */ ('strokeStyle' in styleObject ? - styleObject['strokeStyle'] : ol.format.KML.DEFAULT_STROKE_STYLE_); + styleObject['strokeStyle'] : ol.format.KML.DEFAULT_STROKE_STYLE_); var outline = /** @type {boolean|undefined} */ (styleObject['outline']); if (outline !== undefined && !outline) { @@ -1093,7 +1093,7 @@ ol.format.KML.DataParser_ = function(node, objectStack) { var name = node.getAttribute('name'); ol.xml.parseNode(ol.format.KML.DATA_PARSERS_, node, objectStack); var featureObject = - /** @type {Object} */ (objectStack[objectStack.length - 1]); + /** @type {Object} */ (objectStack[objectStack.length - 1]); if (name !== null) { featureObject[name] = featureObject.value; } else if (featureObject.displayName !== null) { @@ -2144,16 +2144,16 @@ ol.format.KML.writeDataNode_ = function(node, pair, objectStack) { if (typeof value == 'object') { if (value !== null && value.displayName) { ol.xml.pushSerializeAndPop(context, ol.format.KML.EXTENDEDDATA_NODE_SERIALIZERS_, - ol.xml.OBJECT_PROPERTY_NODE_FACTORY, [value.displayName], objectStack, ['displayName']); + ol.xml.OBJECT_PROPERTY_NODE_FACTORY, [value.displayName], objectStack, ['displayName']); } if (value !== null && value.value) { ol.xml.pushSerializeAndPop(context, ol.format.KML.EXTENDEDDATA_NODE_SERIALIZERS_, - ol.xml.OBJECT_PROPERTY_NODE_FACTORY, [value.value], objectStack, ['value']); + ol.xml.OBJECT_PROPERTY_NODE_FACTORY, [value.value], objectStack, ['value']); } } else { ol.xml.pushSerializeAndPop(context, ol.format.KML.EXTENDEDDATA_NODE_SERIALIZERS_, - ol.xml.OBJECT_PROPERTY_NODE_FACTORY, [value], objectStack, ['value']); + ol.xml.OBJECT_PROPERTY_NODE_FACTORY, [value], objectStack, ['value']); } }; @@ -2206,7 +2206,7 @@ ol.format.KML.writeExtendedData_ = function(node, namesAndValues, objectStack) { for (var i = 0; i < length; i++) { ol.xml.pushSerializeAndPop(context, ol.format.KML.EXTENDEDDATA_NODE_SERIALIZERS_, - ol.format.KML.DATA_NODE_FACTORY_, [{name: names[i], value: values[i]}], objectStack); + ol.format.KML.DATA_NODE_FACTORY_, [{name: names[i], value: values[i]}], objectStack); } }; @@ -2420,7 +2420,7 @@ ol.format.KML.writePlacemark_ = function(node, feature, objectStack) { var sequence = ol.xml.makeSequence(properties, keys); var namesAndValues = {names: keys, values: sequence}; ol.xml.pushSerializeAndPop(context, ol.format.KML.PLACEMARK_SERIALIZERS_, - ol.format.KML.EXTENDEDDATA_NODE_FACTORY_, [namesAndValues], objectStack); + ol.format.KML.EXTENDEDDATA_NODE_FACTORY_, [namesAndValues], objectStack); } var styleFunction = feature.getStyleFunction(); diff --git a/src/ol/format/mvt.js b/src/ol/format/mvt.js index 599f65f895c..bc2a58ed2f2 100644 --- a/src/ol/format/mvt.js +++ b/src/ol/format/mvt.js @@ -49,7 +49,7 @@ ol.format.MVT = function(opt_options) { * (Array.|Array.>),Object.,number)} */ this.featureClass_ = options.featureClass ? - options.featureClass : ol.render.Feature; + options.featureClass : ol.render.Feature; /** * @private @@ -124,7 +124,7 @@ ol.format.MVT.prototype.readRenderFeature_ = function(rawFeature, layer) { var geometryType; if (type === 1) { geometryType = coords.length === 1 ? - ol.geom.GeometryType.POINT : ol.geom.GeometryType.MULTI_POINT; + ol.geom.GeometryType.POINT : ol.geom.GeometryType.MULTI_POINT; } else if (type === 2) { if (coords.length === 1) { geometryType = ol.geom.GeometryType.LINE_STRING; @@ -238,7 +238,7 @@ ol.format.MVT.readGeometry_ = function(rawFeature) { var geom; if (type === 1) { geom = coords.length === 1 ? - new ol.geom.Point(null) : new ol.geom.MultiPoint(null); + new ol.geom.Point(null) : new ol.geom.MultiPoint(null); } else if (type === 2) { if (coords.length === 1) { geom = new ol.geom.LineString(null); diff --git a/src/ol/format/ows.js b/src/ol/format/ows.js index 3ed2be4e834..57846e0d6e8 100644 --- a/src/ol/format/ows.js +++ b/src/ol/format/ows.js @@ -386,13 +386,13 @@ ol.format.OWS.REQUEST_METHOD_PARSERS_ = ol.xml.makeStructureNS( */ ol.format.OWS.SERVICE_CONTACT_PARSERS_ = ol.xml.makeStructureNS( - ol.format.OWS.NAMESPACE_URIS_, { - 'IndividualName': ol.xml.makeObjectPropertySetter( - ol.format.XSD.readString), - 'PositionName': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString), - 'ContactInfo': ol.xml.makeObjectPropertySetter( - ol.format.OWS.readContactInfo_) - }); + ol.format.OWS.NAMESPACE_URIS_, { + 'IndividualName': ol.xml.makeObjectPropertySetter( + ol.format.XSD.readString), + 'PositionName': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString), + 'ContactInfo': ol.xml.makeObjectPropertySetter( + ol.format.OWS.readContactInfo_) + }); /** @@ -402,12 +402,12 @@ ol.format.OWS.SERVICE_CONTACT_PARSERS_ = */ ol.format.OWS.SERVICE_IDENTIFICATION_PARSERS_ = ol.xml.makeStructureNS( - ol.format.OWS.NAMESPACE_URIS_, { - 'Title': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString), - 'ServiceTypeVersion': ol.xml.makeObjectPropertySetter( - ol.format.XSD.readString), - 'ServiceType': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString) - }); + ol.format.OWS.NAMESPACE_URIS_, { + 'Title': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString), + 'ServiceTypeVersion': ol.xml.makeObjectPropertySetter( + ol.format.XSD.readString), + 'ServiceType': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString) + }); /** @@ -417,9 +417,9 @@ ol.format.OWS.SERVICE_IDENTIFICATION_PARSERS_ = */ ol.format.OWS.SERVICE_PROVIDER_PARSERS_ = ol.xml.makeStructureNS( - ol.format.OWS.NAMESPACE_URIS_, { - 'ProviderName': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString), - 'ProviderSite': ol.xml.makeObjectPropertySetter(ol.format.XLink.readHref), - 'ServiceContact': ol.xml.makeObjectPropertySetter( - ol.format.OWS.readServiceContact_) - }); + ol.format.OWS.NAMESPACE_URIS_, { + 'ProviderName': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString), + 'ProviderSite': ol.xml.makeObjectPropertySetter(ol.format.XLink.readHref), + 'ServiceContact': ol.xml.makeObjectPropertySetter( + ol.format.OWS.readServiceContact_) + }); diff --git a/src/ol/format/polyline.js b/src/ol/format/polyline.js index a2b80929593..e7390ee75b9 100644 --- a/src/ol/format/polyline.js +++ b/src/ol/format/polyline.js @@ -46,7 +46,7 @@ ol.format.Polyline = function(opt_options) { * @type {ol.geom.GeometryLayout} */ this.geometryLayout_ = options.geometryLayout ? - options.geometryLayout : ol.geom.GeometryLayout.XY; + options.geometryLayout : ol.geom.GeometryLayout.XY; }; ol.inherits(ol.format.Polyline, ol.format.TextFeature); @@ -332,9 +332,9 @@ ol.format.Polyline.prototype.readGeometryFromText = function(text, opt_options) flatCoordinates, 0, flatCoordinates.length, stride); return /** @type {ol.geom.Geometry} */ ( - ol.format.Feature.transformWithOptions( - new ol.geom.LineString(coordinates, this.geometryLayout_), false, - this.adaptOptions(opt_options))); + ol.format.Feature.transformWithOptions( + new ol.geom.LineString(coordinates, this.geometryLayout_), false, + this.adaptOptions(opt_options))); }; @@ -388,8 +388,8 @@ ol.format.Polyline.prototype.writeGeometry; */ ol.format.Polyline.prototype.writeGeometryText = function(geometry, opt_options) { geometry = /** @type {ol.geom.LineString} */ - (ol.format.Feature.transformWithOptions( - geometry, true, this.adaptOptions(opt_options))); + (ol.format.Feature.transformWithOptions( + geometry, true, this.adaptOptions(opt_options))); var flatCoordinates = geometry.getFlatCoordinates(); var stride = geometry.getStride(); ol.geom.flat.flip.flipXY( diff --git a/src/ol/format/topojson.js b/src/ol/format/topojson.js index 5355c749b27..a498a48b02c 100644 --- a/src/ol/format/topojson.js +++ b/src/ol/format/topojson.js @@ -45,7 +45,7 @@ ol.format.TopoJSON = function(opt_options) { */ this.defaultDataProjection = ol.proj.get( options.defaultDataProjection ? - options.defaultDataProjection : 'EPSG:4326'); + options.defaultDataProjection : 'EPSG:4326'); }; ol.inherits(ol.format.TopoJSON, ol.format.JSONFeature); @@ -259,7 +259,7 @@ ol.format.TopoJSON.readFeatureFromGeometry_ = function(object, arcs, } var feature = new ol.Feature(); feature.setGeometry(/** @type {ol.geom.Geometry} */ ( - ol.format.Feature.transformWithOptions(geometry, false, opt_options))); + ol.format.Feature.transformWithOptions(geometry, false, opt_options))); if (object.id !== undefined) { feature.setId(object.id); } @@ -316,13 +316,13 @@ ol.format.TopoJSON.prototype.readFeaturesFromObject = function( } if (topoJSONFeatures[objectName].type === 'GeometryCollection') { feature = /** @type {TopoJSONGeometryCollection} */ - (topoJSONFeatures[objectName]); + (topoJSONFeatures[objectName]); features.push.apply(features, ol.format.TopoJSON.readFeaturesFromGeometryCollection_( feature, arcs, scale, translate, property, objectName, opt_options)); } else { feature = /** @type {TopoJSONGeometry} */ - (topoJSONFeatures[objectName]); + (topoJSONFeatures[objectName]); features.push(ol.format.TopoJSON.readFeatureFromGeometry_( feature, arcs, scale, translate, property, objectName, opt_options)); } diff --git a/src/ol/format/wfs.js b/src/ol/format/wfs.js index 098021b9434..acdcc371ad3 100644 --- a/src/ol/format/wfs.js +++ b/src/ol/format/wfs.js @@ -47,15 +47,15 @@ ol.format.WFS = function(opt_options) { * @type {ol.format.GMLBase} */ this.gmlFormat_ = options.gmlFormat ? - options.gmlFormat : new ol.format.GML3(); + options.gmlFormat : new ol.format.GML3(); /** * @private * @type {string} */ this.schemaLocation_ = options.schemaLocation ? - options.schemaLocation : - ol.format.WFS.SCHEMA_LOCATIONS[ol.format.WFS.DEFAULT_VERSION]; + options.schemaLocation : + ol.format.WFS.SCHEMA_LOCATIONS[ol.format.WFS.DEFAULT_VERSION]; ol.format.XMLFeature.call(this); }; @@ -414,7 +414,7 @@ ol.format.WFS.writeOgcFidFilter_ = function(node, fid, objectStack) { */ ol.format.WFS.getTypeName_ = function(featurePrefix, featureType) { featurePrefix = featurePrefix ? featurePrefix : - ol.format.WFS.FEATURE_PREFIX; + ol.format.WFS.FEATURE_PREFIX; var prefix = featurePrefix + ':'; // The featureType already contains the prefix. if (featureType.indexOf(prefix) === 0) { @@ -477,9 +477,9 @@ ol.format.WFS.writeUpdate_ = function(node, feature, objectStack) { ol.xml.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */ ( {'gmlVersion': context['gmlVersion'], node: node, 'hasZ': context['hasZ'], 'srsName': context['srsName']}), - ol.format.WFS.TRANSACTION_SERIALIZERS_, - ol.xml.makeSimpleNodeFactory('Property'), values, - objectStack); + ol.format.WFS.TRANSACTION_SERIALIZERS_, + ol.xml.makeSimpleNodeFactory('Property'), values, + objectStack); ol.format.WFS.writeOgcFidFilter_(node, fid, objectStack); } }; @@ -964,7 +964,7 @@ ol.format.WFS.prototype.writeTransaction = function(inserts, updates, deletes, var objectStack = []; var node = ol.xml.createElementNS(ol.format.WFS.WFSNS, 'Transaction'); var version = options.version ? - options.version : ol.format.WFS.DEFAULT_VERSION; + options.version : ol.format.WFS.DEFAULT_VERSION; var gmlVersion = version === '1.0.0' ? 2 : 3; node.setAttribute('service', 'WFS'); node.setAttribute('version', version); diff --git a/src/ol/format/wkt.js b/src/ol/format/wkt.js index 98da60283d1..819b4a1acd2 100644 --- a/src/ol/format/wkt.js +++ b/src/ol/format/wkt.js @@ -38,7 +38,7 @@ ol.format.WKT = function(opt_options) { * @private */ this.splitCollection_ = options.splitCollection !== undefined ? - options.splitCollection : false; + options.splitCollection : false; }; ol.inherits(ol.format.WKT, ol.format.TextFeature); @@ -330,7 +330,7 @@ ol.format.WKT.prototype.readGeometryFromText = function(text, opt_options) { var geometry = this.parse_(text); if (geometry) { return /** @type {ol.geom.Geometry} */ ( - ol.format.Feature.transformWithOptions(geometry, false, opt_options)); + ol.format.Feature.transformWithOptions(geometry, false, opt_options)); } else { return null; } @@ -405,7 +405,7 @@ ol.format.WKT.prototype.writeGeometry; */ ol.format.WKT.prototype.writeGeometryText = function(geometry, opt_options) { return ol.format.WKT.encode_(/** @type {ol.geom.Geometry} */ ( - ol.format.Feature.transformWithOptions(geometry, true, opt_options))); + ol.format.Feature.transformWithOptions(geometry, true, opt_options))); }; @@ -535,7 +535,7 @@ ol.format.WKT.Lexer.prototype.readNumber_ = function() { } c = this.nextChar_(); } while ( - this.isNumeric_(c, decimal) || + this.isNumeric_(c, decimal) || // if we haven't detected a scientific number before, 'e' or 'E' // hint that we should continue to read !scientificNotation && (c == 'e' || c == 'E') || diff --git a/src/ol/format/wmscapabilities.js b/src/ol/format/wmscapabilities.js index e7607ee62f1..97be7fa9152 100644 --- a/src/ol/format/wmscapabilities.js +++ b/src/ol/format/wmscapabilities.js @@ -71,7 +71,7 @@ ol.format.WMSCapabilities.prototype.readFromNode = function(node) { */ ol.format.WMSCapabilities.readAttribution_ = function(node, objectStack) { return ol.xml.pushParseAndPop( - {}, ol.format.WMSCapabilities.ATTRIBUTION_PARSERS_, node, objectStack); + {}, ol.format.WMSCapabilities.ATTRIBUTION_PARSERS_, node, objectStack); }; @@ -110,9 +110,9 @@ ol.format.WMSCapabilities.readBoundingBox_ = function(node, objectStack) { */ ol.format.WMSCapabilities.readEXGeographicBoundingBox_ = function(node, objectStack) { var geographicBoundingBox = ol.xml.pushParseAndPop( - {}, - ol.format.WMSCapabilities.EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS_, - node, objectStack); + {}, + ol.format.WMSCapabilities.EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS_, + node, objectStack); if (!geographicBoundingBox) { return undefined; } @@ -143,7 +143,7 @@ ol.format.WMSCapabilities.readEXGeographicBoundingBox_ = function(node, objectSt */ ol.format.WMSCapabilities.readCapability_ = function(node, objectStack) { return ol.xml.pushParseAndPop( - {}, ol.format.WMSCapabilities.CAPABILITY_PARSERS_, node, objectStack); + {}, ol.format.WMSCapabilities.CAPABILITY_PARSERS_, node, objectStack); }; @@ -155,7 +155,7 @@ ol.format.WMSCapabilities.readCapability_ = function(node, objectStack) { */ ol.format.WMSCapabilities.readService_ = function(node, objectStack) { return ol.xml.pushParseAndPop( - {}, ol.format.WMSCapabilities.SERVICE_PARSERS_, node, objectStack); + {}, ol.format.WMSCapabilities.SERVICE_PARSERS_, node, objectStack); }; @@ -167,8 +167,8 @@ ol.format.WMSCapabilities.readService_ = function(node, objectStack) { */ ol.format.WMSCapabilities.readContactInformation_ = function(node, objectStack) { return ol.xml.pushParseAndPop( - {}, ol.format.WMSCapabilities.CONTACT_INFORMATION_PARSERS_, - node, objectStack); + {}, ol.format.WMSCapabilities.CONTACT_INFORMATION_PARSERS_, + node, objectStack); }; @@ -180,8 +180,8 @@ ol.format.WMSCapabilities.readContactInformation_ = function(node, objectStack) */ ol.format.WMSCapabilities.readContactPersonPrimary_ = function(node, objectStack) { return ol.xml.pushParseAndPop( - {}, ol.format.WMSCapabilities.CONTACT_PERSON_PARSERS_, - node, objectStack); + {}, ol.format.WMSCapabilities.CONTACT_PERSON_PARSERS_, + node, objectStack); }; @@ -193,8 +193,8 @@ ol.format.WMSCapabilities.readContactPersonPrimary_ = function(node, objectStack */ ol.format.WMSCapabilities.readContactAddress_ = function(node, objectStack) { return ol.xml.pushParseAndPop( - {}, ol.format.WMSCapabilities.CONTACT_ADDRESS_PARSERS_, - node, objectStack); + {}, ol.format.WMSCapabilities.CONTACT_ADDRESS_PARSERS_, + node, objectStack); }; @@ -206,7 +206,7 @@ ol.format.WMSCapabilities.readContactAddress_ = function(node, objectStack) { */ ol.format.WMSCapabilities.readException_ = function(node, objectStack) { return ol.xml.pushParseAndPop( - [], ol.format.WMSCapabilities.EXCEPTION_PARSERS_, node, objectStack); + [], ol.format.WMSCapabilities.EXCEPTION_PARSERS_, node, objectStack); }; @@ -218,7 +218,7 @@ ol.format.WMSCapabilities.readException_ = function(node, objectStack) { */ ol.format.WMSCapabilities.readCapabilityLayer_ = function(node, objectStack) { return ol.xml.pushParseAndPop( - {}, ol.format.WMSCapabilities.LAYER_PARSERS_, node, objectStack); + {}, ol.format.WMSCapabilities.LAYER_PARSERS_, node, objectStack); }; @@ -233,7 +233,7 @@ ol.format.WMSCapabilities.readLayer_ = function(node, objectStack) { (objectStack[objectStack.length - 1]); var layerObject = ol.xml.pushParseAndPop( - {}, ol.format.WMSCapabilities.LAYER_PARSERS_, node, objectStack); + {}, ol.format.WMSCapabilities.LAYER_PARSERS_, node, objectStack); if (!layerObject) { return undefined; @@ -246,7 +246,7 @@ ol.format.WMSCapabilities.readLayer_ = function(node, objectStack) { layerObject['queryable'] = queryable !== undefined ? queryable : false; var cascaded = ol.format.XSD.readNonNegativeIntegerString( - node.getAttribute('cascaded')); + node.getAttribute('cascaded')); if (cascaded === undefined) { cascaded = parentLayerObject['cascaded']; } @@ -279,7 +279,7 @@ ol.format.WMSCapabilities.readLayer_ = function(node, objectStack) { } layerObject['fixedHeight'] = fixedHeight; - // See 7.2.4.8 + // See 7.2.4.8 var addKeys = ['Style', 'CRS', 'AuthorityURL']; addKeys.forEach(function(key) { if (key in parentLayerObject) { @@ -314,9 +314,9 @@ ol.format.WMSCapabilities.readDimension_ = function(node, objectStack) { 'unitSymbol': node.getAttribute('unitSymbol'), 'default': node.getAttribute('default'), 'multipleValues': ol.format.XSD.readBooleanString( - node.getAttribute('multipleValues')), + node.getAttribute('multipleValues')), 'nearestValue': ol.format.XSD.readBooleanString( - node.getAttribute('nearestValue')), + node.getAttribute('nearestValue')), 'current': ol.format.XSD.readBooleanString(node.getAttribute('current')), 'values': ol.format.XSD.readString(node) }; @@ -332,8 +332,8 @@ ol.format.WMSCapabilities.readDimension_ = function(node, objectStack) { */ ol.format.WMSCapabilities.readFormatOnlineresource_ = function(node, objectStack) { return ol.xml.pushParseAndPop( - {}, ol.format.WMSCapabilities.FORMAT_ONLINERESOURCE_PARSERS_, - node, objectStack); + {}, ol.format.WMSCapabilities.FORMAT_ONLINERESOURCE_PARSERS_, + node, objectStack); }; @@ -345,7 +345,7 @@ ol.format.WMSCapabilities.readFormatOnlineresource_ = function(node, objectStack */ ol.format.WMSCapabilities.readRequest_ = function(node, objectStack) { return ol.xml.pushParseAndPop( - {}, ol.format.WMSCapabilities.REQUEST_PARSERS_, node, objectStack); + {}, ol.format.WMSCapabilities.REQUEST_PARSERS_, node, objectStack); }; @@ -357,7 +357,7 @@ ol.format.WMSCapabilities.readRequest_ = function(node, objectStack) { */ ol.format.WMSCapabilities.readDCPType_ = function(node, objectStack) { return ol.xml.pushParseAndPop( - {}, ol.format.WMSCapabilities.DCPTYPE_PARSERS_, node, objectStack); + {}, ol.format.WMSCapabilities.DCPTYPE_PARSERS_, node, objectStack); }; @@ -369,7 +369,7 @@ ol.format.WMSCapabilities.readDCPType_ = function(node, objectStack) { */ ol.format.WMSCapabilities.readHTTP_ = function(node, objectStack) { return ol.xml.pushParseAndPop( - {}, ol.format.WMSCapabilities.HTTP_PARSERS_, node, objectStack); + {}, ol.format.WMSCapabilities.HTTP_PARSERS_, node, objectStack); }; @@ -381,7 +381,7 @@ ol.format.WMSCapabilities.readHTTP_ = function(node, objectStack) { */ ol.format.WMSCapabilities.readOperationType_ = function(node, objectStack) { return ol.xml.pushParseAndPop( - {}, ol.format.WMSCapabilities.OPERATIONTYPE_PARSERS_, node, objectStack); + {}, ol.format.WMSCapabilities.OPERATIONTYPE_PARSERS_, node, objectStack); }; @@ -448,7 +448,7 @@ ol.format.WMSCapabilities.readMetadataURL_ = function(node, objectStack) { */ ol.format.WMSCapabilities.readStyle_ = function(node, objectStack) { return ol.xml.pushParseAndPop( - {}, ol.format.WMSCapabilities.STYLE_PARSERS_, node, objectStack); + {}, ol.format.WMSCapabilities.STYLE_PARSERS_, node, objectStack); }; @@ -460,7 +460,7 @@ ol.format.WMSCapabilities.readStyle_ = function(node, objectStack) { */ ol.format.WMSCapabilities.readKeywordList_ = function(node, objectStack) { return ol.xml.pushParseAndPop( - [], ol.format.WMSCapabilities.KEYWORDLIST_PARSERS_, node, objectStack); + [], ol.format.WMSCapabilities.KEYWORDLIST_PARSERS_, node, objectStack); }; diff --git a/src/ol/format/wmtscapabilities.js b/src/ol/format/wmtscapabilities.js index 02d2c32fda2..7022911ec11 100644 --- a/src/ol/format/wmtscapabilities.js +++ b/src/ol/format/wmtscapabilities.js @@ -64,7 +64,7 @@ ol.format.WMTSCapabilities.prototype.readFromNode = function(node) { } WMTSCapabilityObject['version'] = version; WMTSCapabilityObject = ol.xml.pushParseAndPop(WMTSCapabilityObject, - ol.format.WMTSCapabilities.PARSERS_, node, []); + ol.format.WMTSCapabilities.PARSERS_, node, []); return WMTSCapabilityObject ? WMTSCapabilityObject : null; }; @@ -77,7 +77,7 @@ ol.format.WMTSCapabilities.prototype.readFromNode = function(node) { */ ol.format.WMTSCapabilities.readContents_ = function(node, objectStack) { return ol.xml.pushParseAndPop({}, - ol.format.WMTSCapabilities.CONTENTS_PARSERS_, node, objectStack); + ol.format.WMTSCapabilities.CONTENTS_PARSERS_, node, objectStack); }; @@ -89,7 +89,7 @@ ol.format.WMTSCapabilities.readContents_ = function(node, objectStack) { */ ol.format.WMTSCapabilities.readLayer_ = function(node, objectStack) { return ol.xml.pushParseAndPop({}, - ol.format.WMTSCapabilities.LAYER_PARSERS_, node, objectStack); + ol.format.WMTSCapabilities.LAYER_PARSERS_, node, objectStack); }; diff --git a/src/ol/geolocation.js b/src/ol/geolocation.js index c9d36352671..202c7a63343 100644 --- a/src/ol/geolocation.js +++ b/src/ol/geolocation.js @@ -140,9 +140,9 @@ ol.Geolocation.prototype.positionChange_ = function(position) { coords.altitude === null ? undefined : coords.altitude); this.set(ol.GeolocationProperty.ALTITUDE_ACCURACY, coords.altitudeAccuracy === null ? - undefined : coords.altitudeAccuracy); + undefined : coords.altitudeAccuracy); this.set(ol.GeolocationProperty.HEADING, coords.heading === null ? - undefined : ol.math.toRadians(coords.heading)); + undefined : ol.math.toRadians(coords.heading)); if (!this.position_) { this.position_ = [coords.longitude, coords.latitude]; } else { @@ -186,7 +186,7 @@ ol.Geolocation.prototype.positionError_ = function(error) { */ ol.Geolocation.prototype.getAccuracy = function() { return /** @type {number|undefined} */ ( - this.get(ol.GeolocationProperty.ACCURACY)); + this.get(ol.GeolocationProperty.ACCURACY)); }; @@ -198,7 +198,7 @@ ol.Geolocation.prototype.getAccuracy = function() { */ ol.Geolocation.prototype.getAccuracyGeometry = function() { return /** @type {?ol.geom.Polygon} */ ( - this.get(ol.GeolocationProperty.ACCURACY_GEOMETRY) || null); + this.get(ol.GeolocationProperty.ACCURACY_GEOMETRY) || null); }; @@ -211,7 +211,7 @@ ol.Geolocation.prototype.getAccuracyGeometry = function() { */ ol.Geolocation.prototype.getAltitude = function() { return /** @type {number|undefined} */ ( - this.get(ol.GeolocationProperty.ALTITUDE)); + this.get(ol.GeolocationProperty.ALTITUDE)); }; @@ -224,7 +224,7 @@ ol.Geolocation.prototype.getAltitude = function() { */ ol.Geolocation.prototype.getAltitudeAccuracy = function() { return /** @type {number|undefined} */ ( - this.get(ol.GeolocationProperty.ALTITUDE_ACCURACY)); + this.get(ol.GeolocationProperty.ALTITUDE_ACCURACY)); }; @@ -236,7 +236,7 @@ ol.Geolocation.prototype.getAltitudeAccuracy = function() { */ ol.Geolocation.prototype.getHeading = function() { return /** @type {number|undefined} */ ( - this.get(ol.GeolocationProperty.HEADING)); + this.get(ol.GeolocationProperty.HEADING)); }; @@ -249,7 +249,7 @@ ol.Geolocation.prototype.getHeading = function() { */ ol.Geolocation.prototype.getPosition = function() { return /** @type {ol.Coordinate|undefined} */ ( - this.get(ol.GeolocationProperty.POSITION)); + this.get(ol.GeolocationProperty.POSITION)); }; @@ -262,7 +262,7 @@ ol.Geolocation.prototype.getPosition = function() { */ ol.Geolocation.prototype.getProjection = function() { return /** @type {ol.proj.Projection|undefined} */ ( - this.get(ol.GeolocationProperty.PROJECTION)); + this.get(ol.GeolocationProperty.PROJECTION)); }; @@ -275,7 +275,7 @@ ol.Geolocation.prototype.getProjection = function() { */ ol.Geolocation.prototype.getSpeed = function() { return /** @type {number|undefined} */ ( - this.get(ol.GeolocationProperty.SPEED)); + this.get(ol.GeolocationProperty.SPEED)); }; @@ -287,7 +287,7 @@ ol.Geolocation.prototype.getSpeed = function() { */ ol.Geolocation.prototype.getTracking = function() { return /** @type {boolean} */ ( - this.get(ol.GeolocationProperty.TRACKING)); + this.get(ol.GeolocationProperty.TRACKING)); }; @@ -302,7 +302,7 @@ ol.Geolocation.prototype.getTracking = function() { */ ol.Geolocation.prototype.getTrackingOptions = function() { return /** @type {GeolocationPositionOptions|undefined} */ ( - this.get(ol.GeolocationProperty.TRACKING_OPTIONS)); + this.get(ol.GeolocationProperty.TRACKING_OPTIONS)); }; diff --git a/src/ol/geom/flat/geodesic.js b/src/ol/geom/flat/geodesic.js index 29b625bbf1b..ed342d5ca80 100644 --- a/src/ol/geom/flat/geodesic.js +++ b/src/ol/geom/flat/geodesic.js @@ -119,7 +119,7 @@ ol.geom.flat.geodesic.greatCircleArc = function( var lat = Math.asin(sinLat1 * cosD + cosLat1 * sinD * Math.cos(theta)); var lon = ol.math.toRadians(lon1) + Math.atan2(Math.sin(theta) * sinD * cosLat1, - cosD - sinLat1 * Math.sin(lat)); + cosD - sinLat1 * Math.sin(lat)); return [ol.math.toDegrees(lon), ol.math.toDegrees(lat)]; }, ol.proj.getTransform(geoProjection, projection), squaredTolerance); }; diff --git a/src/ol/geom/flat/orient.js b/src/ol/geom/flat/orient.js index 3f410034d98..79aaf2e8034 100644 --- a/src/ol/geom/flat/orient.js +++ b/src/ol/geom/flat/orient.js @@ -108,8 +108,8 @@ ol.geom.flat.orient.orientLinearRings = function(flatCoordinates, offset, ends, var isClockwise = ol.geom.flat.orient.linearRingIsClockwise( flatCoordinates, offset, end, stride); var reverse = i === 0 ? - (right && isClockwise) || (!right && !isClockwise) : - (right && !isClockwise) || (!right && isClockwise); + (right && isClockwise) || (!right && !isClockwise) : + (right && !isClockwise) || (!right && isClockwise); if (reverse) { ol.geom.flat.reverse.coordinates(flatCoordinates, offset, end, stride); } diff --git a/src/ol/geom/flat/simplify.js b/src/ol/geom/flat/simplify.js index 9e1c45cc9db..7823faaaa5b 100644 --- a/src/ol/geom/flat/simplify.js +++ b/src/ol/geom/flat/simplify.js @@ -43,7 +43,7 @@ goog.require('ol.math'); ol.geom.flat.simplify.lineString = function(flatCoordinates, offset, end, stride, squaredTolerance, highQuality, opt_simplifiedFlatCoordinates) { var simplifiedFlatCoordinates = opt_simplifiedFlatCoordinates !== undefined ? - opt_simplifiedFlatCoordinates : []; + opt_simplifiedFlatCoordinates : []; if (!highQuality) { end = ol.geom.flat.simplify.radialDistance(flatCoordinates, offset, end, stride, squaredTolerance, diff --git a/src/ol/geom/multipoint.js b/src/ol/geom/multipoint.js index 15c4e5bdd20..cfb7f377e3b 100644 --- a/src/ol/geom/multipoint.js +++ b/src/ol/geom/multipoint.js @@ -103,7 +103,7 @@ ol.geom.MultiPoint.prototype.getCoordinates = function() { */ ol.geom.MultiPoint.prototype.getPoint = function(index) { var n = !this.flatCoordinates ? - 0 : this.flatCoordinates.length / this.stride; + 0 : this.flatCoordinates.length / this.stride; if (index < 0 || n <= index) { return null; } diff --git a/src/ol/geom/multipolygon.js b/src/ol/geom/multipolygon.js index 6411530b00d..7f2f9c15890 100644 --- a/src/ol/geom/multipolygon.js +++ b/src/ol/geom/multipolygon.js @@ -375,7 +375,7 @@ ol.geom.MultiPolygon.prototype.setCoordinates = function(coordinates, opt_layout } else { var lastEnds = endss[endss.length - 1]; this.flatCoordinates.length = lastEnds.length === 0 ? - 0 : lastEnds[lastEnds.length - 1]; + 0 : lastEnds[lastEnds.length - 1]; } this.changed(); } diff --git a/src/ol/graticule.js b/src/ol/graticule.js index c2fe312cb77..e31668dd0a3 100644 --- a/src/ol/graticule.js +++ b/src/ol/graticule.js @@ -23,86 +23,86 @@ goog.require('ol.style.Text'); ol.Graticule = function(opt_options) { var options = opt_options || {}; - /** + /** * @type {ol.Map} * @private */ this.map_ = null; - /** + /** * @type {ol.proj.Projection} * @private */ this.projection_ = null; - /** + /** * @type {number} * @private */ this.maxLat_ = Infinity; - /** + /** * @type {number} * @private */ this.maxLon_ = Infinity; - /** + /** * @type {number} * @private */ this.minLat_ = -Infinity; - /** + /** * @type {number} * @private */ this.minLon_ = -Infinity; - /** + /** * @type {number} * @private */ this.maxLatP_ = Infinity; - /** + /** * @type {number} * @private */ this.maxLonP_ = Infinity; - /** + /** * @type {number} * @private */ this.minLatP_ = -Infinity; - /** + /** * @type {number} * @private */ this.minLonP_ = -Infinity; - /** + /** * @type {number} * @private */ this.targetSize_ = options.targetSize !== undefined ? - options.targetSize : 100; + options.targetSize : 100; - /** + /** * @type {number} * @private */ this.maxLines_ = options.maxLines !== undefined ? options.maxLines : 100; - /** + /** * @type {Array.} * @private */ this.meridians_ = []; - /** + /** * @type {Array.} * @private */ @@ -113,7 +113,7 @@ ol.Graticule = function(opt_options) { * @private */ this.strokeStyle_ = options.strokeStyle !== undefined ? - options.strokeStyle : ol.Graticule.DEFAULT_STROKE_STYLE_; + options.strokeStyle : ol.Graticule.DEFAULT_STROKE_STYLE_; /** * @type {ol.TransformFunction|undefined} @@ -153,14 +153,14 @@ ol.Graticule = function(opt_options) { * @private */ this.lonLabelFormatter_ = options.lonLabelFormatter == undefined ? - degreesToString.bind(this, 'EW') : options.lonLabelFormatter; + degreesToString.bind(this, 'EW') : options.lonLabelFormatter; /** * @type {function(number):string} * @private */ this.latLabelFormatter_ = options.latLabelFormatter == undefined ? - degreesToString.bind(this, 'NS') : options.latLabelFormatter; + degreesToString.bind(this, 'NS') : options.latLabelFormatter; /** * Longitude label position in fractions (0..1) of view extent. 0 means @@ -169,7 +169,7 @@ ol.Graticule = function(opt_options) { * @private */ this.lonLabelPosition_ = options.lonLabelPosition == undefined ? 0 : - options.lonLabelPosition; + options.lonLabelPosition; /** * Latitude Label position in fractions (0..1) of view extent. 0 means left, 1 @@ -178,41 +178,41 @@ ol.Graticule = function(opt_options) { * @private */ this.latLabelPosition_ = options.latLabelPosition == undefined ? 1 : - options.latLabelPosition; + options.latLabelPosition; /** * @type {ol.style.Text} * @private */ this.lonLabelStyle_ = options.lonLabelStyle !== undefined ? options.lonLabelStyle : - new ol.style.Text({ - font: '12px Calibri,sans-serif', - textBaseline: 'bottom', - fill: new ol.style.Fill({ - color: 'rgba(0,0,0,1)' - }), - stroke: new ol.style.Stroke({ - color: 'rgba(255,255,255,1)', - width: 3 - }) - }); + new ol.style.Text({ + font: '12px Calibri,sans-serif', + textBaseline: 'bottom', + fill: new ol.style.Fill({ + color: 'rgba(0,0,0,1)' + }), + stroke: new ol.style.Stroke({ + color: 'rgba(255,255,255,1)', + width: 3 + }) + }); /** * @type {ol.style.Text} * @private */ this.latLabelStyle_ = options.latLabelStyle !== undefined ? options.latLabelStyle : - new ol.style.Text({ - font: '12px Calibri,sans-serif', - textAlign: 'end', - fill: new ol.style.Fill({ - color: 'rgba(0,0,0,1)' - }), - stroke: new ol.style.Stroke({ - color: 'rgba(255,255,255,1)', - width: 3 - }) - }); + new ol.style.Text({ + font: '12px Calibri,sans-serif', + textAlign: 'end', + fill: new ol.style.Fill({ + color: 'rgba(0,0,0,1)' + }), + stroke: new ol.style.Stroke({ + color: 'rgba(255,255,255,1)', + width: 3 + }) + }); this.meridiansLabels_ = []; this.parallelsLabels_ = []; @@ -283,7 +283,7 @@ ol.Graticule.prototype.getMeridianPoint_ = function(lineString, extent, index) { clampedBottom, clampedTop); var coordinate = [flatCoordinates[0], lat]; var point = this.meridiansLabels_[index] !== undefined ? - this.meridiansLabels_[index].geom : new ol.geom.Point(null); + this.meridiansLabels_[index].geom : new ol.geom.Point(null); point.setCoordinates(coordinate); return point; }; @@ -332,7 +332,7 @@ ol.Graticule.prototype.getParallelPoint_ = function(lineString, extent, index) { clampedLeft, clampedRight); var coordinate = [lon, flatCoordinates[1]]; var point = this.parallelsLabels_[index] !== undefined ? - this.parallelsLabels_[index].geom : new ol.geom.Point(null); + this.parallelsLabels_[index].geom : new ol.geom.Point(null); point.setCoordinates(coordinate); return point; }; @@ -487,11 +487,11 @@ ol.Graticule.prototype.getMap = function() { * @private */ ol.Graticule.prototype.getMeridian_ = function(lon, minLat, maxLat, - squaredTolerance, index) { + squaredTolerance, index) { var flatCoordinates = ol.geom.flat.geodesic.meridian(lon, - minLat, maxLat, this.projection_, squaredTolerance); + minLat, maxLat, this.projection_, squaredTolerance); var lineString = this.meridians_[index] !== undefined ? - this.meridians_[index] : new ol.geom.LineString(null); + this.meridians_[index] : new ol.geom.LineString(null); lineString.setFlatCoordinates(ol.geom.GeometryLayout.XY, flatCoordinates); return lineString; }; @@ -517,11 +517,11 @@ ol.Graticule.prototype.getMeridians = function() { * @private */ ol.Graticule.prototype.getParallel_ = function(lat, minLon, maxLon, - squaredTolerance, index) { + squaredTolerance, index) { var flatCoordinates = ol.geom.flat.geodesic.parallel(lat, - this.minLon_, this.maxLon_, this.projection_, squaredTolerance); + this.minLon_, this.maxLon_, this.projection_, squaredTolerance); var lineString = this.parallels_[index] !== undefined ? - this.parallels_[index] : new ol.geom.LineString(null); + this.parallels_[index] : new ol.geom.LineString(null); lineString.setFlatCoordinates(ol.geom.GeometryLayout.XY, flatCoordinates); return lineString; }; @@ -620,7 +620,7 @@ ol.Graticule.prototype.updateProjectionInfo_ = function(projection) { var extent = projection.getExtent(); var worldExtent = projection.getWorldExtent(); var worldExtentP = ol.proj.transformExtent(worldExtent, - epsg4326Projection, projection); + epsg4326Projection, projection); var maxLat = worldExtent[3]; var maxLon = worldExtent[2]; @@ -644,13 +644,13 @@ ol.Graticule.prototype.updateProjectionInfo_ = function(projection) { this.fromLonLatTransform_ = ol.proj.getTransform( - epsg4326Projection, projection); + epsg4326Projection, projection); this.toLonLatTransform_ = ol.proj.getTransform( - projection, epsg4326Projection); + projection, epsg4326Projection); this.projectionCenterLonLat_ = this.toLonLatTransform_( - ol.extent.getCenter(extent)); + ol.extent.getCenter(extent)); this.projection_ = projection; }; diff --git a/src/ol/has.js b/src/ol/has.js index 9b0aebef72a..e70c4a07981 100644 --- a/src/ol/has.js +++ b/src/ol/has.js @@ -4,7 +4,7 @@ goog.require('ol'); goog.require('ol.webgl'); var ua = typeof navigator !== 'undefined' ? - navigator.userAgent.toLowerCase() : ''; + navigator.userAgent.toLowerCase() : ''; /** * User agent string says we are dealing with Firefox as browser. @@ -56,27 +56,27 @@ ol.has.CANVAS_LINE_DASH = false; * @api */ ol.has.CANVAS = ol.ENABLE_CANVAS && ( - /** + /** * @return {boolean} Canvas supported. */ - function() { - if (!('HTMLCanvasElement' in window)) { + function() { + if (!('HTMLCanvasElement' in window)) { + return false; + } + try { + var context = document.createElement('CANVAS').getContext('2d'); + if (!context) { return false; - } - try { - var context = document.createElement('CANVAS').getContext('2d'); - if (!context) { - return false; - } else { - if (context.setLineDash !== undefined) { - ol.has.CANVAS_LINE_DASH = true; - } - return true; + } else { + if (context.setLineDash !== undefined) { + ol.has.CANVAS_LINE_DASH = true; } - } catch (e) { - return false; + return true; } - })(); + } catch (e) { + return false; + } + })(); /** @@ -148,7 +148,7 @@ ol.has.WEBGL; if (gl) { hasWebGL = true; textureSize = /** @type {number} */ - (gl.getParameter(gl.MAX_TEXTURE_SIZE)); + (gl.getParameter(gl.MAX_TEXTURE_SIZE)); extensions = gl.getSupportedExtensions(); } } catch (e) { diff --git a/src/ol/imagecanvas.js b/src/ol/imagecanvas.js index 6d5d25985c3..6f9053a421f 100644 --- a/src/ol/imagecanvas.js +++ b/src/ol/imagecanvas.js @@ -27,7 +27,7 @@ ol.ImageCanvas = function(extent, resolution, pixelRatio, attributions, this.loader_ = opt_loader !== undefined ? opt_loader : null; var state = opt_loader !== undefined ? - ol.ImageState.IDLE : ol.ImageState.LOADED; + ol.ImageState.IDLE : ol.ImageState.LOADED; ol.ImageBase.call(this, extent, resolution, pixelRatio, state, attributions); diff --git a/src/ol/interaction.js b/src/ol/interaction.js index 4e4bb4363ac..b759771d95a 100644 --- a/src/ol/interaction.js +++ b/src/ol/interaction.js @@ -45,13 +45,13 @@ ol.interaction.defaults = function(opt_options) { var kinetic = new ol.Kinetic(-0.005, 0.05, 100); var altShiftDragRotate = options.altShiftDragRotate !== undefined ? - options.altShiftDragRotate : true; + options.altShiftDragRotate : true; if (altShiftDragRotate) { interactions.push(new ol.interaction.DragRotate()); } var doubleClickZoom = options.doubleClickZoom !== undefined ? - options.doubleClickZoom : true; + options.doubleClickZoom : true; if (doubleClickZoom) { interactions.push(new ol.interaction.DoubleClickZoom({ delta: options.zoomDelta, @@ -67,7 +67,7 @@ ol.interaction.defaults = function(opt_options) { } var pinchRotate = options.pinchRotate !== undefined ? options.pinchRotate : - true; + true; if (pinchRotate) { interactions.push(new ol.interaction.PinchRotate()); } @@ -90,7 +90,7 @@ ol.interaction.defaults = function(opt_options) { } var mouseWheelZoom = options.mouseWheelZoom !== undefined ? - options.mouseWheelZoom : true; + options.mouseWheelZoom : true; if (mouseWheelZoom) { interactions.push(new ol.interaction.MouseWheelZoom({ constrainResolution: options.constrainResolution, @@ -99,7 +99,7 @@ ol.interaction.defaults = function(opt_options) { } var shiftDragZoom = options.shiftDragZoom !== undefined ? - options.shiftDragZoom : true; + options.shiftDragZoom : true; if (shiftDragZoom) { interactions.push(new ol.interaction.DragZoom({ duration: options.zoomDuration diff --git a/src/ol/interaction/draganddrop.js b/src/ol/interaction/draganddrop.js index ffdfe7040be..7d2d44be558 100644 --- a/src/ol/interaction/draganddrop.js +++ b/src/ol/interaction/draganddrop.js @@ -34,14 +34,14 @@ ol.interaction.DragAndDrop = function(opt_options) { * @type {Array.} */ this.formatConstructors_ = options.formatConstructors ? - options.formatConstructors : []; + options.formatConstructors : []; /** * @private * @type {ol.proj.Projection} */ this.projection_ = options.projection ? - ol.proj.get(options.projection) : null; + ol.proj.get(options.projection) : null; /** * @private diff --git a/src/ol/interaction/dragbox.js b/src/ol/interaction/dragbox.js index 870016d8107..e22304a48cc 100644 --- a/src/ol/interaction/dragbox.js +++ b/src/ol/interaction/dragbox.js @@ -58,14 +58,14 @@ ol.interaction.DragBox = function(opt_options) { * @type {ol.EventsConditionType} */ this.condition_ = options.condition ? - options.condition : ol.events.condition.always; + options.condition : ol.events.condition.always; /** * @private * @type {ol.DragBoxEndConditionType} */ this.boxEndCondition_ = options.boxEndCondition ? - options.boxEndCondition : ol.interaction.DragBox.defaultBoxEndCondition; + options.boxEndCondition : ol.interaction.DragBox.defaultBoxEndCondition; }; ol.inherits(ol.interaction.DragBox, ol.interaction.Pointer); @@ -100,7 +100,7 @@ ol.interaction.DragBox.handleDragEvent_ = function(mapBrowserEvent) { this.box_.setPixels(this.startPixel_, mapBrowserEvent.pixel); this.dispatchEvent(new ol.interaction.DragBox.Event(ol.interaction.DragBox.EventType_.BOXDRAG, - mapBrowserEvent.coordinate, mapBrowserEvent)); + mapBrowserEvent.coordinate, mapBrowserEvent)); }; diff --git a/src/ol/interaction/dragpan.js b/src/ol/interaction/dragpan.js index 9ac60529943..10ecb8e87cc 100644 --- a/src/ol/interaction/dragpan.js +++ b/src/ol/interaction/dragpan.js @@ -49,7 +49,7 @@ ol.interaction.DragPan = function(opt_options) { * @type {ol.EventsConditionType} */ this.condition_ = options.condition ? - options.condition : ol.events.condition.noModifierKeys; + options.condition : ol.events.condition.noModifierKeys; /** * @private diff --git a/src/ol/interaction/dragrotate.js b/src/ol/interaction/dragrotate.js index c5114e4f592..c830822d99c 100644 --- a/src/ol/interaction/dragrotate.js +++ b/src/ol/interaction/dragrotate.js @@ -37,7 +37,7 @@ ol.interaction.DragRotate = function(opt_options) { * @type {ol.EventsConditionType} */ this.condition_ = options.condition ? - options.condition : ol.events.condition.altShiftKeysOnly; + options.condition : ol.events.condition.altShiftKeysOnly; /** * @private diff --git a/src/ol/interaction/dragrotateandzoom.js b/src/ol/interaction/dragrotateandzoom.js index a8c8eb12ebc..a2bb054aa13 100644 --- a/src/ol/interaction/dragrotateandzoom.js +++ b/src/ol/interaction/dragrotateandzoom.js @@ -38,7 +38,7 @@ ol.interaction.DragRotateAndZoom = function(opt_options) { * @type {ol.EventsConditionType} */ this.condition_ = options.condition ? - options.condition : ol.events.condition.shiftKeyOnly; + options.condition : ol.events.condition.shiftKeyOnly; /** * @private diff --git a/src/ol/interaction/dragzoom.js b/src/ol/interaction/dragzoom.js index c5fbc370b66..d3c139df120 100644 --- a/src/ol/interaction/dragzoom.js +++ b/src/ol/interaction/dragzoom.js @@ -25,7 +25,7 @@ ol.interaction.DragZoom = function(opt_options) { var options = opt_options ? opt_options : {}; var condition = options.condition ? - options.condition : ol.events.condition.shiftKeyOnly; + options.condition : ol.events.condition.shiftKeyOnly; /** * @private diff --git a/src/ol/interaction/draw.js b/src/ol/interaction/draw.js index 735d74482eb..e3afab2338c 100644 --- a/src/ol/interaction/draw.js +++ b/src/ol/interaction/draw.js @@ -105,8 +105,8 @@ ol.interaction.Draw = function(options) { * @private */ this.minPoints_ = options.minPoints ? - options.minPoints : - (this.mode_ === ol.interaction.Draw.Mode_.POLYGON ? 3 : 2); + options.minPoints : + (this.mode_ === ol.interaction.Draw.Mode_.POLYGON ? 3 : 2); /** * The number of points that can be drawn before a polygon ring or line string @@ -134,7 +134,7 @@ ol.interaction.Draw = function(options) { */ geometryFunction = function(coordinates, opt_geometry) { var circle = opt_geometry ? /** @type {ol.geom.Circle} */ (opt_geometry) : - new ol.geom.Circle([NaN, NaN]); + new ol.geom.Circle([NaN, NaN]); var squaredLength = ol.coordinate.squaredDistance( coordinates[0], coordinates[1]); circle.setCenterAndRadius(coordinates[0], Math.sqrt(squaredLength)); @@ -229,7 +229,7 @@ ol.interaction.Draw = function(options) { * @private */ this.squaredClickTolerance_ = options.clickTolerance ? - options.clickTolerance * options.clickTolerance : 36; + options.clickTolerance * options.clickTolerance : 36; /** * Draw overlay where our sketch features are drawn. @@ -242,7 +242,7 @@ ol.interaction.Draw = function(options) { wrapX: options.wrapX ? options.wrapX : false }), style: options.style ? options.style : - ol.interaction.Draw.getDefaultStyleFunction() + ol.interaction.Draw.getDefaultStyleFunction() }); /** @@ -257,7 +257,7 @@ ol.interaction.Draw = function(options) { * @type {ol.EventsConditionType} */ this.condition_ = options.condition ? - options.condition : ol.events.condition.noModifierKeys; + options.condition : ol.events.condition.noModifierKeys; /** * @private @@ -268,7 +268,7 @@ ol.interaction.Draw = function(options) { this.freehandCondition_ = ol.events.condition.always; } else { this.freehandCondition_ = options.freehandCondition ? - options.freehandCondition : ol.events.condition.shiftKeyOnly; + options.freehandCondition : ol.events.condition.shiftKeyOnly; } ol.events.listen(this, @@ -401,8 +401,8 @@ ol.interaction.Draw.prototype.handlePointerMove_ = function(event) { var dy = downPx[1] - clickPx[1]; var squaredDistance = dx * dx + dy * dy; this.shouldHandle_ = this.freehand_ ? - squaredDistance > this.squaredClickTolerance_ : - squaredDistance <= this.squaredClickTolerance_; + squaredDistance > this.squaredClickTolerance_ : + squaredDistance <= this.squaredClickTolerance_; } if (this.finishCoordinate_) { @@ -767,23 +767,23 @@ ol.interaction.Draw.prototype.updateState_ = function() { */ ol.interaction.Draw.createRegularPolygon = function(opt_sides, opt_angle) { return ( - /** + /** * @param {ol.Coordinate|Array.|Array.>} coordinates * @param {ol.geom.SimpleGeometry=} opt_geometry * @return {ol.geom.SimpleGeometry} */ - function(coordinates, opt_geometry) { - var center = coordinates[0]; - var end = coordinates[1]; - var radius = Math.sqrt( - ol.coordinate.squaredDistance(center, end)); - var geometry = opt_geometry ? /** @type {ol.geom.Polygon} */ (opt_geometry) : - ol.geom.Polygon.fromCircle(new ol.geom.Circle(center), opt_sides); - var angle = opt_angle ? opt_angle : - Math.atan((end[1] - center[1]) / (end[0] - center[0])); - ol.geom.Polygon.makeRegular(geometry, center, radius, angle); - return geometry; - } + function(coordinates, opt_geometry) { + var center = coordinates[0]; + var end = coordinates[1]; + var radius = Math.sqrt( + ol.coordinate.squaredDistance(center, end)); + var geometry = opt_geometry ? /** @type {ol.geom.Polygon} */ (opt_geometry) : + ol.geom.Polygon.fromCircle(new ol.geom.Circle(center), opt_sides); + var angle = opt_angle ? opt_angle : + Math.atan((end[1] - center[1]) / (end[0] - center[0])); + ol.geom.Polygon.makeRegular(geometry, center, radius, angle); + return geometry; + } ); }; diff --git a/src/ol/interaction/extent.js b/src/ol/interaction/extent.js index 8579fc7a686..29508517532 100644 --- a/src/ol/interaction/extent.js +++ b/src/ol/interaction/extent.js @@ -183,13 +183,13 @@ ol.interaction.Extent.handleDownEvent_ = function(mapBrowserEvent) { //snap to edge } else if (x !== null) { this.pointerHandler_ = ol.interaction.Extent.getEdgeHandler_( - getOpposingPoint([x, extent[1]]), - getOpposingPoint([x, extent[3]]) + getOpposingPoint([x, extent[1]]), + getOpposingPoint([x, extent[3]]) ); } else if (y !== null) { this.pointerHandler_ = ol.interaction.Extent.getEdgeHandler_( - getOpposingPoint([extent[0], y]), - getOpposingPoint([extent[2], y]) + getOpposingPoint([extent[0], y]), + getOpposingPoint([extent[2], y]) ); } //no snap - new bbox @@ -337,7 +337,7 @@ ol.interaction.Extent.prototype.snapToVertex_ = function(pixel, map) { this.snappedToVertex_ = dist <= this.pixelTolerance_; if (this.snappedToVertex_) { vertex = squaredDist1 > squaredDist2 ? - closestSegment[1] : closestSegment[0]; + closestSegment[1] : closestSegment[0]; } return vertex; } diff --git a/src/ol/interaction/interaction.js b/src/ol/interaction/interaction.js index ffe39ca86b3..ace0c1307d3 100644 --- a/src/ol/interaction/interaction.js +++ b/src/ol/interaction/interaction.js @@ -54,7 +54,7 @@ ol.inherits(ol.interaction.Interaction, ol.Object); */ ol.interaction.Interaction.prototype.getActive = function() { return /** @type {boolean} */ ( - this.get(ol.interaction.Property.ACTIVE)); + this.get(ol.interaction.Property.ACTIVE)); }; diff --git a/src/ol/interaction/keyboardpan.js b/src/ol/interaction/keyboardpan.js index 6afb9acde7d..603c682c50c 100644 --- a/src/ol/interaction/keyboardpan.js +++ b/src/ol/interaction/keyboardpan.js @@ -48,7 +48,7 @@ ol.interaction.KeyboardPan = function(opt_options) { * @type {ol.EventsConditionType} */ this.condition_ = options.condition !== undefined ? - options.condition : this.defaultCondition_; + options.condition : this.defaultCondition_; /** * @private @@ -61,7 +61,7 @@ ol.interaction.KeyboardPan = function(opt_options) { * @type {number} */ this.pixelDelta_ = options.pixelDelta !== undefined ? - options.pixelDelta : 128; + options.pixelDelta : 128; }; ol.inherits(ol.interaction.KeyboardPan, ol.interaction.Interaction); diff --git a/src/ol/interaction/keyboardzoom.js b/src/ol/interaction/keyboardzoom.js index 5bd875535d2..c5667a800a0 100644 --- a/src/ol/interaction/keyboardzoom.js +++ b/src/ol/interaction/keyboardzoom.js @@ -36,7 +36,7 @@ ol.interaction.KeyboardZoom = function(opt_options) { * @type {ol.EventsConditionType} */ this.condition_ = options.condition ? options.condition : - ol.events.condition.targetNotEditable; + ol.events.condition.targetNotEditable; /** * @private diff --git a/src/ol/interaction/modify.js b/src/ol/interaction/modify.js index 54b9b79afe8..5d93e16e134 100644 --- a/src/ol/interaction/modify.js +++ b/src/ol/interaction/modify.js @@ -47,7 +47,7 @@ ol.interaction.Modify = function(options) { * @type {ol.EventsConditionType} */ this.condition_ = options.condition ? - options.condition : ol.events.condition.primaryAction; + options.condition : ol.events.condition.primaryAction; /** @@ -65,14 +65,14 @@ ol.interaction.Modify = function(options) { * @private */ this.deleteCondition_ = options.deleteCondition ? - options.deleteCondition : this.defaultDeleteCondition_; + options.deleteCondition : this.defaultDeleteCondition_; /** * @type {ol.EventsConditionType} * @private */ this.insertVertexCondition_ = options.insertVertexCondition ? - options.insertVertexCondition : ol.events.condition.always; + options.insertVertexCondition : ol.events.condition.always; /** * Editing vertex. @@ -120,7 +120,7 @@ ol.interaction.Modify = function(options) { * @private */ this.pixelTolerance_ = options.pixelTolerance !== undefined ? - options.pixelTolerance : 10; + options.pixelTolerance : 10; /** * @type {boolean} @@ -153,7 +153,7 @@ ol.interaction.Modify = function(options) { wrapX: !!options.wrapX }), style: options.style ? options.style : - ol.interaction.Modify.getDefaultStyleFunction(), + ol.interaction.Modify.getDefaultStyleFunction(), updateWhileAnimating: true, updateWhileInteracting: true }); @@ -825,7 +825,7 @@ ol.interaction.Modify.prototype.handlePointerAtPixel_ = function(pixel, map) { this.snappedToVertex_ = dist <= this.pixelTolerance_; if (this.snappedToVertex_) { vertex = squaredDist1 > squaredDist2 ? - closestSegment[1] : closestSegment[0]; + closestSegment[1] : closestSegment[0]; } this.createOrUpdateVertexFeature_(vertex); var segment; diff --git a/src/ol/interaction/mousewheelzoom.js b/src/ol/interaction/mousewheelzoom.js index 80680754090..ca3d7930a85 100644 --- a/src/ol/interaction/mousewheelzoom.js +++ b/src/ol/interaction/mousewheelzoom.js @@ -164,8 +164,8 @@ ol.interaction.MouseWheelZoom.handleEvent = function(mapBrowserEvent) { if (!this.mode_ || now - this.startTime_ > this.trackpadEventGap_) { this.mode_ = Math.abs(delta) < 4 ? - ol.interaction.MouseWheelZoom.Mode_.TRACKPAD : - ol.interaction.MouseWheelZoom.Mode_.WHEEL; + ol.interaction.MouseWheelZoom.Mode_.TRACKPAD : + ol.interaction.MouseWheelZoom.Mode_.WHEEL; } if (this.mode_ === ol.interaction.MouseWheelZoom.Mode_.TRACKPAD) { diff --git a/src/ol/interaction/pointer.js b/src/ol/interaction/pointer.js index f61e76ffe6a..6632a7f5553 100644 --- a/src/ol/interaction/pointer.js +++ b/src/ol/interaction/pointer.js @@ -28,7 +28,7 @@ ol.interaction.Pointer = function(opt_options) { var options = opt_options ? opt_options : {}; var handleEvent = options.handleEvent ? - options.handleEvent : ol.interaction.Pointer.handleEvent; + options.handleEvent : ol.interaction.Pointer.handleEvent; ol.interaction.Interaction.call(this, { handleEvent: handleEvent @@ -39,28 +39,28 @@ ol.interaction.Pointer = function(opt_options) { * @private */ this.handleDownEvent_ = options.handleDownEvent ? - options.handleDownEvent : ol.interaction.Pointer.handleDownEvent; + options.handleDownEvent : ol.interaction.Pointer.handleDownEvent; /** * @type {function(ol.MapBrowserPointerEvent)} * @private */ this.handleDragEvent_ = options.handleDragEvent ? - options.handleDragEvent : ol.interaction.Pointer.handleDragEvent; + options.handleDragEvent : ol.interaction.Pointer.handleDragEvent; /** * @type {function(ol.MapBrowserPointerEvent)} * @private */ this.handleMoveEvent_ = options.handleMoveEvent ? - options.handleMoveEvent : ol.interaction.Pointer.handleMoveEvent; + options.handleMoveEvent : ol.interaction.Pointer.handleMoveEvent; /** * @type {function(ol.MapBrowserPointerEvent):boolean} * @private */ this.handleUpEvent_ = options.handleUpEvent ? - options.handleUpEvent : ol.interaction.Pointer.handleUpEvent; + options.handleUpEvent : ol.interaction.Pointer.handleUpEvent; /** * @type {boolean} @@ -109,7 +109,7 @@ ol.interaction.Pointer.centroid = function(pointerEvents) { ol.interaction.Pointer.prototype.isPointerDraggingEvent_ = function(mapBrowserEvent) { var type = mapBrowserEvent.type; return ( - type === ol.MapBrowserEventType.POINTERDOWN || + type === ol.MapBrowserEventType.POINTERDOWN || type === ol.MapBrowserEventType.POINTERDRAG || type === ol.MapBrowserEventType.POINTERUP); }; diff --git a/src/ol/interaction/select.js b/src/ol/interaction/select.js index c616d7119d1..a55a5fad557 100644 --- a/src/ol/interaction/select.js +++ b/src/ol/interaction/select.js @@ -46,28 +46,28 @@ ol.interaction.Select = function(opt_options) { * @type {ol.EventsConditionType} */ this.condition_ = options.condition ? - options.condition : ol.events.condition.singleClick; + options.condition : ol.events.condition.singleClick; /** * @private * @type {ol.EventsConditionType} */ this.addCondition_ = options.addCondition ? - options.addCondition : ol.events.condition.never; + options.addCondition : ol.events.condition.never; /** * @private * @type {ol.EventsConditionType} */ this.removeCondition_ = options.removeCondition ? - options.removeCondition : ol.events.condition.never; + options.removeCondition : ol.events.condition.never; /** * @private * @type {ol.EventsConditionType} */ this.toggleCondition_ = options.toggleCondition ? - options.toggleCondition : ol.events.condition.shiftKeyOnly; + options.toggleCondition : ol.events.condition.shiftKeyOnly; /** * @private @@ -80,7 +80,7 @@ ol.interaction.Select = function(opt_options) { * @type {ol.SelectFilterFunction} */ this.filter_ = options.filter ? options.filter : - ol.functions.TRUE; + ol.functions.TRUE; /** * @private @@ -95,7 +95,7 @@ ol.interaction.Select = function(opt_options) { wrapX: options.wrapX }), style: options.style ? options.style : - ol.interaction.Select.getDefaultStyleFunction(), + ol.interaction.Select.getDefaultStyleFunction(), updateWhileAnimating: true, updateWhileInteracting: true }); @@ -217,18 +217,18 @@ ol.interaction.Select.handleEvent = function(mapBrowserEvent) { // the pixel. ol.obj.clear(this.featureLayerAssociation_); map.forEachFeatureAtPixel(mapBrowserEvent.pixel, - (/** + (/** * @param {ol.Feature|ol.render.Feature} feature Feature. * @param {ol.layer.Layer} layer Layer. * @return {boolean|undefined} Continue to iterate over the features. */ - function(feature, layer) { - if (this.filter_(feature, layer)) { - selected.push(feature); - this.addFeatureLayerAssociation_(feature, layer); - return !this.multi_; - } - }).bind(this), { + function(feature, layer) { + if (this.filter_(feature, layer)) { + selected.push(feature); + this.addFeatureLayerAssociation_(feature, layer); + return !this.multi_; + } + }).bind(this), { layerFilter: this.layerFilter_, hitTolerance: this.hitTolerance_ }); @@ -250,25 +250,25 @@ ol.interaction.Select.handleEvent = function(mapBrowserEvent) { } else { // Modify the currently selected feature(s). map.forEachFeatureAtPixel(mapBrowserEvent.pixel, - (/** + (/** * @param {ol.Feature|ol.render.Feature} feature Feature. * @param {ol.layer.Layer} layer Layer. * @return {boolean|undefined} Continue to iterate over the features. */ - function(feature, layer) { - if (this.filter_(feature, layer)) { - if ((add || toggle) && + function(feature, layer) { + if (this.filter_(feature, layer)) { + if ((add || toggle) && !ol.array.includes(features.getArray(), feature)) { - selected.push(feature); - this.addFeatureLayerAssociation_(feature, layer); - } else if ((remove || toggle) && + selected.push(feature); + this.addFeatureLayerAssociation_(feature, layer); + } else if ((remove || toggle) && ol.array.includes(features.getArray(), feature)) { - deselected.push(feature); - this.removeFeatureLayerAssociation_(feature); + deselected.push(feature); + this.removeFeatureLayerAssociation_(feature); + } + return !this.multi_; } - return !this.multi_; - } - }).bind(this), { + }).bind(this), { layerFilter: this.layerFilter_, hitTolerance: this.hitTolerance_ }); diff --git a/src/ol/interaction/snap.js b/src/ol/interaction/snap.js index 50344ee36d5..f4756c8b3aa 100644 --- a/src/ol/interaction/snap.js +++ b/src/ol/interaction/snap.js @@ -114,7 +114,7 @@ ol.interaction.Snap = function(opt_options) { * @private */ this.pixelTolerance_ = options.pixelTolerance !== undefined ? - options.pixelTolerance : 10; + options.pixelTolerance : 10; /** * @type {function(ol.SnapSegmentDataType, ol.SnapSegmentDataType): number} @@ -309,17 +309,17 @@ ol.interaction.Snap.prototype.setMap = function(map) { if (map) { if (this.features_) { keys.push( - ol.events.listen(this.features_, ol.CollectionEventType.ADD, - this.handleFeatureAdd_, this), - ol.events.listen(this.features_, ol.CollectionEventType.REMOVE, - this.handleFeatureRemove_, this) + ol.events.listen(this.features_, ol.CollectionEventType.ADD, + this.handleFeatureAdd_, this), + ol.events.listen(this.features_, ol.CollectionEventType.REMOVE, + this.handleFeatureRemove_, this) ); } else if (this.source_) { keys.push( - ol.events.listen(this.source_, ol.source.VectorEventType.ADDFEATURE, - this.handleFeatureAdd_, this), - ol.events.listen(this.source_, ol.source.VectorEventType.REMOVEFEATURE, - this.handleFeatureRemove_, this) + ol.events.listen(this.source_, ol.source.VectorEventType.ADDFEATURE, + this.handleFeatureAdd_, this), + ol.events.listen(this.source_, ol.source.VectorEventType.REMOVEFEATURE, + this.handleFeatureRemove_, this) ); } features.forEach(this.forEachFeatureAdd_, this); @@ -378,7 +378,7 @@ ol.interaction.Snap.prototype.snapTo = function(pixel, pixelCoordinate, map) { if (snappedToVertex) { snapped = true; vertex = squaredDist1 > squaredDist2 ? - closestSegment[1] : closestSegment[0]; + closestSegment[1] : closestSegment[0]; vertexPixel = map.getPixelFromCoordinate(vertex); } } else if (this.edge_) { @@ -401,7 +401,7 @@ ol.interaction.Snap.prototype.snapTo = function(pixel, pixelCoordinate, map) { snappedToVertex = dist <= this.pixelTolerance_; if (snappedToVertex) { vertex = squaredDist1 > squaredDist2 ? - closestSegment[1] : closestSegment[0]; + closestSegment[1] : closestSegment[0]; vertexPixel = map.getPixelFromCoordinate(vertex); } } @@ -631,5 +631,5 @@ ol.interaction.Snap.sortByDistance = function(a, b) { return ol.coordinate.squaredDistanceToSegment( this.pixelCoordinate_, a.segment) - ol.coordinate.squaredDistanceToSegment( - this.pixelCoordinate_, b.segment); + this.pixelCoordinate_, b.segment); }; diff --git a/src/ol/layer/base.js b/src/ol/layer/base.js index 97f177e3d09..62006d51e32 100644 --- a/src/ol/layer/base.js +++ b/src/ol/layer/base.js @@ -107,7 +107,7 @@ ol.layer.Base.prototype.getLayerStatesArray = function(opt_states) {}; */ ol.layer.Base.prototype.getExtent = function() { return /** @type {ol.Extent|undefined} */ ( - this.get(ol.layer.Property.EXTENT)); + this.get(ol.layer.Property.EXTENT)); }; @@ -119,7 +119,7 @@ ol.layer.Base.prototype.getExtent = function() { */ ol.layer.Base.prototype.getMaxResolution = function() { return /** @type {number} */ ( - this.get(ol.layer.Property.MAX_RESOLUTION)); + this.get(ol.layer.Property.MAX_RESOLUTION)); }; @@ -131,7 +131,7 @@ ol.layer.Base.prototype.getMaxResolution = function() { */ ol.layer.Base.prototype.getMinResolution = function() { return /** @type {number} */ ( - this.get(ol.layer.Property.MIN_RESOLUTION)); + this.get(ol.layer.Property.MIN_RESOLUTION)); }; diff --git a/src/ol/layer/heatmap.js b/src/ol/layer/heatmap.js index e2bf99954f7..6d41d8f72dd 100644 --- a/src/ol/layer/heatmap.js +++ b/src/ol/layer/heatmap.js @@ -66,7 +66,7 @@ ol.layer.Heatmap = function(opt_options) { this.handleGradientChanged_, this); this.setGradient(options.gradient ? - options.gradient : ol.layer.Heatmap.DEFAULT_GRADIENT); + options.gradient : ol.layer.Heatmap.DEFAULT_GRADIENT); this.setBlur(options.blur !== undefined ? options.blur : 15); @@ -190,7 +190,7 @@ ol.layer.Heatmap.prototype.getBlur = function() { */ ol.layer.Heatmap.prototype.getGradient = function() { return /** @type {Array.} */ ( - this.get(ol.layer.Heatmap.Property_.GRADIENT)); + this.get(ol.layer.Heatmap.Property_.GRADIENT)); }; diff --git a/src/ol/layer/tile.js b/src/ol/layer/tile.js index 0539a7e1f1e..6a1306575fb 100644 --- a/src/ol/layer/tile.js +++ b/src/ol/layer/tile.js @@ -34,7 +34,7 @@ ol.layer.Tile = function(opt_options) { this.setPreload(options.preload !== undefined ? options.preload : 0); this.setUseInterimTilesOnError(options.useInterimTilesOnError !== undefined ? - options.useInterimTilesOnError : true); + options.useInterimTilesOnError : true); }; ol.inherits(ol.layer.Tile, ol.layer.Layer); @@ -93,7 +93,7 @@ ol.layer.Tile.prototype.setPreload = function(preload) { */ ol.layer.Tile.prototype.getUseInterimTilesOnError = function() { return /** @type {boolean} */ ( - this.get(ol.layer.TileProperty.USE_INTERIM_TILES_ON_ERROR)); + this.get(ol.layer.TileProperty.USE_INTERIM_TILES_ON_ERROR)); }; diff --git a/src/ol/layer/vector.js b/src/ol/layer/vector.js index 053e00e5000..3882958e365 100644 --- a/src/ol/layer/vector.js +++ b/src/ol/layer/vector.js @@ -24,7 +24,7 @@ goog.require('ol.style.Style'); */ ol.layer.Vector = function(opt_options) { var options = opt_options ? - opt_options : /** @type {olx.layer.VectorOptions} */ ({}); + opt_options : /** @type {olx.layer.VectorOptions} */ ({}); var baseOptions = ol.obj.assign({}, options); @@ -34,21 +34,21 @@ ol.layer.Vector = function(opt_options) { delete baseOptions.updateWhileInteracting; ol.layer.Layer.call(this, /** @type {olx.layer.LayerOptions} */ (baseOptions)); - /** + /** * @type {number} * @private */ this.renderBuffer_ = options.renderBuffer !== undefined ? - options.renderBuffer : 100; + options.renderBuffer : 100; - /** + /** * User provided style. * @type {ol.style.Style|Array.|ol.StyleFunction} * @private */ this.style_ = null; - /** + /** * Style function for use within the library. * @type {ol.StyleFunction|undefined} * @private @@ -57,19 +57,19 @@ ol.layer.Vector = function(opt_options) { this.setStyle(options.style); - /** + /** * @type {boolean} * @private */ this.updateWhileAnimating_ = options.updateWhileAnimating !== undefined ? - options.updateWhileAnimating : false; + options.updateWhileAnimating : false; - /** + /** * @type {boolean} * @private */ this.updateWhileInteracting_ = options.updateWhileInteracting !== undefined ? - options.updateWhileInteracting : false; + options.updateWhileInteracting : false; }; ol.inherits(ol.layer.Vector, ol.layer.Layer); @@ -103,7 +103,7 @@ ol.layer.Vector.prototype.getRenderBuffer = function() { */ ol.layer.Vector.prototype.getRenderOrder = function() { return /** @type {ol.RenderOrderFunction|null|undefined} */ ( - this.get(ol.layer.Vector.Property_.RENDER_ORDER)); + this.get(ol.layer.Vector.Property_.RENDER_ORDER)); }; @@ -179,7 +179,7 @@ ol.layer.Vector.prototype.setRenderOrder = function(renderOrder) { ol.layer.Vector.prototype.setStyle = function(style) { this.style_ = style !== undefined ? style : ol.style.Style.defaultFunction; this.styleFunction_ = style === null ? - undefined : ol.style.Style.createFunction(this.style_); + undefined : ol.style.Style.createFunction(this.style_); this.changed(); }; diff --git a/src/ol/layer/vectortile.js b/src/ol/layer/vectortile.js index 3e06a8176f9..0e001e882f4 100644 --- a/src/ol/layer/vectortile.js +++ b/src/ol/layer/vectortile.js @@ -33,13 +33,13 @@ ol.layer.VectorTile = function(opt_options) { this.setPreload(options.preload ? options.preload : 0); this.setUseInterimTilesOnError(options.useInterimTilesOnError ? - options.useInterimTilesOnError : true); + options.useInterimTilesOnError : true); ol.asserts.assert(options.renderMode == undefined || options.renderMode == ol.layer.VectorTileRenderType.IMAGE || options.renderMode == ol.layer.VectorTileRenderType.HYBRID || options.renderMode == ol.layer.VectorTileRenderType.VECTOR, - 28); // `renderMode` must be `'image'`, `'hybrid'` or `'vector'` + 28); // `renderMode` must be `'image'`, `'hybrid'` or `'vector'` /** * @private @@ -91,7 +91,7 @@ ol.layer.VectorTile.prototype.getRenderMode = function() { */ ol.layer.VectorTile.prototype.getUseInterimTilesOnError = function() { return /** @type {boolean} */ ( - this.get(ol.layer.TileProperty.USE_INTERIM_TILES_ON_ERROR)); + this.get(ol.layer.TileProperty.USE_INTERIM_TILES_ON_ERROR)); }; diff --git a/src/ol/loadingstrategy.js b/src/ol/loadingstrategy.js index cdd5f4fde94..c545d791f72 100644 --- a/src/ol/loadingstrategy.js +++ b/src/ol/loadingstrategy.js @@ -34,25 +34,25 @@ ol.loadingstrategy.bbox = function(extent, resolution) { */ ol.loadingstrategy.tile = function(tileGrid) { return ( - /** + /** * @param {ol.Extent} extent Extent. * @param {number} resolution Resolution. * @return {Array.} Extents. */ - function(extent, resolution) { - var z = tileGrid.getZForResolution(resolution); - var tileRange = tileGrid.getTileRangeForExtentAndZ(extent, z); - /** @type {Array.} */ - var extents = []; - /** @type {ol.TileCoord} */ - var tileCoord = [z, 0, 0]; - for (tileCoord[1] = tileRange.minX; tileCoord[1] <= tileRange.maxX; - ++tileCoord[1]) { - for (tileCoord[2] = tileRange.minY; tileCoord[2] <= tileRange.maxY; - ++tileCoord[2]) { - extents.push(tileGrid.getTileCoordExtent(tileCoord)); - } + function(extent, resolution) { + var z = tileGrid.getZForResolution(resolution); + var tileRange = tileGrid.getTileRangeForExtentAndZ(extent, z); + /** @type {Array.} */ + var extents = []; + /** @type {ol.TileCoord} */ + var tileCoord = [z, 0, 0]; + for (tileCoord[1] = tileRange.minX; tileCoord[1] <= tileRange.maxX; + ++tileCoord[1]) { + for (tileCoord[2] = tileRange.minY; tileCoord[2] <= tileRange.maxY; + ++tileCoord[2]) { + extents.push(tileGrid.getTileCoordExtent(tileCoord)); } - return extents; - }); + } + return extents; + }); }; diff --git a/src/ol/map.js b/src/ol/map.js index 5a319c49651..e5922d24b33 100644 --- a/src/ol/map.js +++ b/src/ol/map.js @@ -144,7 +144,7 @@ ol.Map = function(options) { */ this.loadTilesWhileAnimating_ = options.loadTilesWhileAnimating !== undefined ? - options.loadTilesWhileAnimating : false; + options.loadTilesWhileAnimating : false; /** * @type {boolean} @@ -152,14 +152,14 @@ ol.Map = function(options) { */ this.loadTilesWhileInteracting_ = options.loadTilesWhileInteracting !== undefined ? - options.loadTilesWhileInteracting : false; + options.loadTilesWhileInteracting : false; /** * @private * @type {number} */ this.pixelRatio_ = options.pixelRatio !== undefined ? - options.pixelRatio : ol.has.DEVICE_PIXEL_RATIO; + options.pixelRatio : ol.has.DEVICE_PIXEL_RATIO; /** * @private @@ -603,7 +603,7 @@ ol.Map.prototype.forEachLayerAtPixel = function(pixel, callback, opt_this, opt_l } var thisArg = opt_this !== undefined ? opt_this : null; var layerFilter = opt_layerFilter !== undefined ? - opt_layerFilter : ol.functions.TRUE; + opt_layerFilter : ol.functions.TRUE; var thisArg2 = opt_this2 !== undefined ? opt_this2 : null; return this.renderer_.forEachLayerAtPixel( pixel, this.frameState_, callback, thisArg, @@ -627,7 +627,7 @@ ol.Map.prototype.hasFeatureAtPixel = function(pixel, opt_options) { var coordinate = this.getCoordinateFromPixel(pixel); opt_options = opt_options !== undefined ? opt_options : {}; var layerFilter = opt_options.layerFilter !== undefined ? - opt_options.layerFilter : ol.functions.TRUE; + opt_options.layerFilter : ol.functions.TRUE; var hitTolerance = opt_options.hitTolerance !== undefined ? opt_options.hitTolerance * this.frameState_.pixelRatio : 0; return this.renderer_.hasFeatureAtCoordinate( @@ -673,7 +673,7 @@ ol.Map.prototype.getEventPixel = function(event) { */ ol.Map.prototype.getTarget = function() { return /** @type {Element|string|undefined} */ ( - this.get(ol.MapProperty.TARGET)); + this.get(ol.MapProperty.TARGET)); }; @@ -1023,7 +1023,7 @@ ol.Map.prototype.handleTargetChanged_ = function() { targetElement.appendChild(this.viewport_); var keyboardEventTarget = !this.keyboardEventTarget_ ? - targetElement : this.keyboardEventTarget_; + targetElement : this.keyboardEventTarget_; this.keyHandlerKeys_ = [ ol.events.listen(keyboardEventTarget, ol.events.EventType.KEYDOWN, this.handleBrowserEvent, this), @@ -1387,8 +1387,8 @@ ol.Map.createOptionsInternal = function(options) { var keyboardEventTarget = null; if (options.keyboardEventTarget !== undefined) { keyboardEventTarget = typeof options.keyboardEventTarget === 'string' ? - document.getElementById(options.keyboardEventTarget) : - options.keyboardEventTarget; + document.getElementById(options.keyboardEventTarget) : + options.keyboardEventTarget; } /** @@ -1414,13 +1414,13 @@ ol.Map.createOptionsInternal = function(options) { } var layerGroup = (options.layers instanceof ol.layer.Group) ? - options.layers : new ol.layer.Group({layers: options.layers}); + options.layers : new ol.layer.Group({layers: options.layers}); values[ol.MapProperty.LAYERGROUP] = layerGroup; values[ol.MapProperty.TARGET] = options.target; values[ol.MapProperty.VIEW] = options.view !== undefined ? - options.view : new ol.View(); + options.view : new ol.View(); /** * @type {function(new: ol.renderer.Map, Element, ol.Map)} diff --git a/src/ol/mapbrowsereventhandler.js b/src/ol/mapbrowsereventhandler.js index ffab7855b3a..72394f63290 100644 --- a/src/ol/mapbrowsereventhandler.js +++ b/src/ol/mapbrowsereventhandler.js @@ -50,7 +50,7 @@ ol.MapBrowserEventHandler = function(map, moveTolerance) { * @private */ this.moveTolerance_ = moveTolerance ? - moveTolerance * ol.has.DEVICE_PIXEL_RATIO : ol.has.DEVICE_PIXEL_RATIO; + moveTolerance * ol.has.DEVICE_PIXEL_RATIO : ol.has.DEVICE_PIXEL_RATIO; /** * The most recent "down" type event (or null if none have occurred). @@ -165,13 +165,13 @@ ol.MapBrowserEventHandler.prototype.updateActivePointers_ = function(pointerEven ol.MapBrowserEventHandler.prototype.handlePointerUp_ = function(pointerEvent) { this.updateActivePointers_(pointerEvent); var newEvent = new ol.MapBrowserPointerEvent( - ol.MapBrowserEventType.POINTERUP, this.map_, pointerEvent); + ol.MapBrowserEventType.POINTERUP, this.map_, pointerEvent); this.dispatchEvent(newEvent); - // We emulate click events on left mouse button click, touch contact, and pen - // contact. isMouseActionButton returns true in these cases (evt.button is set - // to 0). - // See http://www.w3.org/TR/pointerevents/#button-states + // We emulate click events on left mouse button click, touch contact, and pen + // contact. isMouseActionButton returns true in these cases (evt.button is set + // to 0). + // See http://www.w3.org/TR/pointerevents/#button-states if (!this.dragging_ && this.isMouseActionButton_(pointerEvent)) { this.emulateClick_(this.down_); } @@ -218,13 +218,13 @@ ol.MapBrowserEventHandler.prototype.handlePointerDown_ = function(pointerEvent) new ol.pointer.PointerEventHandler(document); this.dragListenerKeys_.push( - ol.events.listen(this.documentPointerEventHandler_, - ol.MapBrowserEventType.POINTERMOVE, - this.handlePointerMove_, this), - ol.events.listen(this.documentPointerEventHandler_, - ol.MapBrowserEventType.POINTERUP, - this.handlePointerUp_, this), - /* Note that the listener for `pointercancel is set up on + ol.events.listen(this.documentPointerEventHandler_, + ol.MapBrowserEventType.POINTERMOVE, + this.handlePointerMove_, this), + ol.events.listen(this.documentPointerEventHandler_, + ol.MapBrowserEventType.POINTERUP, + this.handlePointerUp_, this), + /* Note that the listener for `pointercancel is set up on * `pointerEventHandler_` and not `documentPointerEventHandler_` like * the `pointerup` and `pointermove` listeners. * @@ -237,9 +237,9 @@ ol.MapBrowserEventHandler.prototype.handlePointerDown_ = function(pointerEvent) * only receive a `touchcancel` from `pointerEventHandler_`, because it is * only registered there. */ - ol.events.listen(this.pointerEventHandler_, - ol.MapBrowserEventType.POINTERCANCEL, - this.handlePointerUp_, this) + ol.events.listen(this.pointerEventHandler_, + ol.MapBrowserEventType.POINTERCANCEL, + this.handlePointerUp_, this) ); } }; diff --git a/src/ol/object.js b/src/ol/object.js index f3d14bdff53..2c9f04ae5e8 100644 --- a/src/ol/object.js +++ b/src/ol/object.js @@ -87,8 +87,8 @@ ol.Object.changeEventTypeCache_ = {}; */ ol.Object.getChangeEventType = function(key) { return ol.Object.changeEventTypeCache_.hasOwnProperty(key) ? - ol.Object.changeEventTypeCache_[key] : - (ol.Object.changeEventTypeCache_[key] = 'change:' + key); + ol.Object.changeEventTypeCache_[key] : + (ol.Object.changeEventTypeCache_[key] = 'change:' + key); }; diff --git a/src/ol/overlay.js b/src/ol/overlay.js index f69f4dd808b..2f899371946 100644 --- a/src/ol/overlay.js +++ b/src/ol/overlay.js @@ -46,7 +46,7 @@ ol.Overlay = function(options) { * @type {boolean} */ this.insertFirst_ = options.insertFirst !== undefined ? - options.insertFirst : true; + options.insertFirst : true; /** * @private @@ -73,14 +73,14 @@ ol.Overlay = function(options) { * @type {olx.OverlayPanOptions} */ this.autoPanAnimation_ = options.autoPanAnimation || - /** @type {olx.OverlayPanOptions} */ ({}); + /** @type {olx.OverlayPanOptions} */ ({}); /** * @private * @type {number} */ this.autoPanMargin_ = options.autoPanMargin !== undefined ? - options.autoPanMargin : 20; + options.autoPanMargin : 20; /** * @private @@ -131,8 +131,8 @@ ol.Overlay = function(options) { this.setOffset(options.offset !== undefined ? options.offset : [0, 0]); this.setPositioning(options.positioning !== undefined ? - /** @type {ol.OverlayPositioning} */ (options.positioning) : - ol.OverlayPositioning.TOP_LEFT); + /** @type {ol.OverlayPositioning} */ (options.positioning) : + ol.OverlayPositioning.TOP_LEFT); if (options.position !== undefined) { this.setPosition(options.position); @@ -150,7 +150,7 @@ ol.inherits(ol.Overlay, ol.Object); */ ol.Overlay.prototype.getElement = function() { return /** @type {Element|undefined} */ ( - this.get(ol.Overlay.Property_.ELEMENT)); + this.get(ol.Overlay.Property_.ELEMENT)); }; @@ -172,7 +172,7 @@ ol.Overlay.prototype.getId = function() { */ ol.Overlay.prototype.getMap = function() { return /** @type {ol.Map|undefined} */ ( - this.get(ol.Overlay.Property_.MAP)); + this.get(ol.Overlay.Property_.MAP)); }; @@ -184,7 +184,7 @@ ol.Overlay.prototype.getMap = function() { */ ol.Overlay.prototype.getOffset = function() { return /** @type {Array.} */ ( - this.get(ol.Overlay.Property_.OFFSET)); + this.get(ol.Overlay.Property_.OFFSET)); }; @@ -197,7 +197,7 @@ ol.Overlay.prototype.getOffset = function() { */ ol.Overlay.prototype.getPosition = function() { return /** @type {ol.Coordinate|undefined} */ ( - this.get(ol.Overlay.Property_.POSITION)); + this.get(ol.Overlay.Property_.POSITION)); }; @@ -210,7 +210,7 @@ ol.Overlay.prototype.getPosition = function() { */ ol.Overlay.prototype.getPositioning = function() { return /** @type {ol.OverlayPositioning} */ ( - this.get(ol.Overlay.Property_.POSITIONING)); + this.get(ol.Overlay.Property_.POSITIONING)); }; @@ -241,7 +241,7 @@ ol.Overlay.prototype.handleMapChanged = function() { ol.MapEventType.POSTRENDER, this.render, this); this.updatePixelPosition(); var container = this.stopEvent_ ? - map.getOverlayContainerStopEvent() : map.getOverlayContainer(); + map.getOverlayContainerStopEvent() : map.getOverlayContainer(); if (this.insertFirst_) { container.insertBefore(this.element_, container.childNodes[0] || null); } else { diff --git a/src/ol/pointer/pointerevent.js b/src/ol/pointer/pointerevent.js index 20eb00e88a2..d717b553eb2 100644 --- a/src/ol/pointer/pointerevent.js +++ b/src/ol/pointer/pointerevent.js @@ -140,7 +140,7 @@ ol.pointer.PointerEvent = function(type, originalEvent, opt_eventDict) { * @type {Node} */ this.relatedTarget = 'relatedTarget' in eventDict ? - eventDict['relatedTarget'] : null; + eventDict['relatedTarget'] : null; // PointerEvent related properties diff --git a/src/ol/proj.js b/src/ol/proj.js index 0fae9de0eab..fa5bdb3e7fe 100644 --- a/src/ol/proj.js +++ b/src/ol/proj.js @@ -221,27 +221,27 @@ ol.proj.addCoordinateTransforms = function(source, destination, forward, inverse */ ol.proj.createTransformFromCoordinateTransform = function(transform) { return ( - /** + /** * @param {Array.} input Input. * @param {Array.=} opt_output Output. * @param {number=} opt_dimension Dimension. * @return {Array.} Output. */ - function(input, opt_output, opt_dimension) { - var length = input.length; - var dimension = opt_dimension !== undefined ? opt_dimension : 2; - var output = opt_output !== undefined ? opt_output : new Array(length); - var point, i, j; - for (i = 0; i < length; i += dimension) { - point = transform([input[i], input[i + 1]]); - output[i] = point[0]; - output[i + 1] = point[1]; - for (j = dimension - 1; j >= 2; --j) { - output[i + j] = input[i + j]; - } + function(input, opt_output, opt_dimension) { + var length = input.length; + var dimension = opt_dimension !== undefined ? opt_dimension : 2; + var output = opt_output !== undefined ? opt_output : new Array(length); + var point, i, j; + for (i = 0; i < length; i += dimension) { + point = transform([input[i], input[i + 1]]); + output[i] = point[0]; + output[i + 1] = point[1]; + for (j = dimension - 1; j >= 2; --j) { + output[i + j] = input[i + j]; } - return output; - }); + } + return output; + }); }; diff --git a/src/ol/proj/projection.js b/src/ol/proj/projection.js index 93c1854ec4b..21f8db7841e 100644 --- a/src/ol/proj/projection.js +++ b/src/ol/proj/projection.js @@ -36,63 +36,63 @@ goog.require('ol.proj.proj4'); * @api */ ol.proj.Projection = function(options) { - /** + /** * @private * @type {string} */ this.code_ = options.code; - /** + /** * @private * @type {ol.proj.Units} */ this.units_ = /** @type {ol.proj.Units} */ (options.units); - /** + /** * @private * @type {ol.Extent} */ this.extent_ = options.extent !== undefined ? options.extent : null; - /** + /** * @private * @type {ol.Extent} */ this.worldExtent_ = options.worldExtent !== undefined ? - options.worldExtent : null; + options.worldExtent : null; - /** + /** * @private * @type {string} */ this.axisOrientation_ = options.axisOrientation !== undefined ? - options.axisOrientation : 'enu'; + options.axisOrientation : 'enu'; - /** + /** * @private * @type {boolean} */ this.global_ = options.global !== undefined ? options.global : false; - /** + /** * @private * @type {boolean} */ this.canWrapX_ = !!(this.global_ && this.extent_); - /** + /** * @private * @type {function(number, ol.Coordinate):number|undefined} */ this.getPointResolutionFunc_ = options.getPointResolution; - /** + /** * @private * @type {ol.tilegrid.TileGrid} */ this.defaultTileGrid_ = null; - /** + /** * @private * @type {number|undefined} */ diff --git a/src/ol/render/canvas/imagereplay.js b/src/ol/render/canvas/imagereplay.js index 2a8fbc0b7cf..77dbbe8071c 100644 --- a/src/ol/render/canvas/imagereplay.js +++ b/src/ol/render/canvas/imagereplay.js @@ -125,10 +125,10 @@ ol.render.canvas.ImageReplay.prototype.drawPoint = function(pointGeometry, featu var stride = pointGeometry.getStride(); var myBegin = this.coordinates.length; var myEnd = this.drawCoordinates_( - flatCoordinates, 0, flatCoordinates.length, stride); + flatCoordinates, 0, flatCoordinates.length, stride); this.instructions.push([ ol.render.canvas.Instruction.DRAW_IMAGE, myBegin, myEnd, this.image_, - // Remaining arguments to DRAW_IMAGE are in alphabetical order + // Remaining arguments to DRAW_IMAGE are in alphabetical order this.anchorX_, this.anchorY_, this.height_, this.opacity_, this.originX_, this.originY_, this.rotateWithView_, this.rotation_, this.scale_, this.snapToPixel_, this.width_ @@ -136,7 +136,7 @@ ol.render.canvas.ImageReplay.prototype.drawPoint = function(pointGeometry, featu this.hitDetectionInstructions.push([ ol.render.canvas.Instruction.DRAW_IMAGE, myBegin, myEnd, this.hitDetectionImage_, - // Remaining arguments to DRAW_IMAGE are in alphabetical order + // Remaining arguments to DRAW_IMAGE are in alphabetical order this.anchorX_, this.anchorY_, this.height_, this.opacity_, this.originX_, this.originY_, this.rotateWithView_, this.rotation_, this.scale_, this.snapToPixel_, this.width_ @@ -157,10 +157,10 @@ ol.render.canvas.ImageReplay.prototype.drawMultiPoint = function(multiPointGeome var stride = multiPointGeometry.getStride(); var myBegin = this.coordinates.length; var myEnd = this.drawCoordinates_( - flatCoordinates, 0, flatCoordinates.length, stride); + flatCoordinates, 0, flatCoordinates.length, stride); this.instructions.push([ ol.render.canvas.Instruction.DRAW_IMAGE, myBegin, myEnd, this.image_, - // Remaining arguments to DRAW_IMAGE are in alphabetical order + // Remaining arguments to DRAW_IMAGE are in alphabetical order this.anchorX_, this.anchorY_, this.height_, this.opacity_, this.originX_, this.originY_, this.rotateWithView_, this.rotation_, this.scale_, this.snapToPixel_, this.width_ @@ -168,7 +168,7 @@ ol.render.canvas.ImageReplay.prototype.drawMultiPoint = function(multiPointGeome this.hitDetectionInstructions.push([ ol.render.canvas.Instruction.DRAW_IMAGE, myBegin, myEnd, this.hitDetectionImage_, - // Remaining arguments to DRAW_IMAGE are in alphabetical order + // Remaining arguments to DRAW_IMAGE are in alphabetical order this.anchorX_, this.anchorY_, this.height_, this.opacity_, this.originX_, this.originY_, this.rotateWithView_, this.rotation_, this.scale_, this.snapToPixel_, this.width_ diff --git a/src/ol/render/canvas/immediate.js b/src/ol/render/canvas/immediate.js index 29abefcbfa3..bcf72367f76 100644 --- a/src/ol/render/canvas/immediate.js +++ b/src/ol/render/canvas/immediate.js @@ -822,7 +822,7 @@ ol.render.canvas.Immediate.prototype.setFillStrokeStyle = function(fillStyle, st var fillStyleColor = fillStyle.getColor(); this.fillState_ = { fillStyle: ol.colorlike.asColorLike(fillStyleColor ? - fillStyleColor : ol.render.canvas.defaultFillStyle) + fillStyleColor : ol.render.canvas.defaultFillStyle) }; } if (!strokeStyle) { @@ -837,19 +837,19 @@ ol.render.canvas.Immediate.prototype.setFillStrokeStyle = function(fillStyle, st var strokeStyleMiterLimit = strokeStyle.getMiterLimit(); this.strokeState_ = { lineCap: strokeStyleLineCap !== undefined ? - strokeStyleLineCap : ol.render.canvas.defaultLineCap, + strokeStyleLineCap : ol.render.canvas.defaultLineCap, lineDash: strokeStyleLineDash ? - strokeStyleLineDash : ol.render.canvas.defaultLineDash, + strokeStyleLineDash : ol.render.canvas.defaultLineDash, lineDashOffset: strokeStyleLineDashOffset ? - strokeStyleLineDashOffset : ol.render.canvas.defaultLineDashOffset, + strokeStyleLineDashOffset : ol.render.canvas.defaultLineDashOffset, lineJoin: strokeStyleLineJoin !== undefined ? - strokeStyleLineJoin : ol.render.canvas.defaultLineJoin, + strokeStyleLineJoin : ol.render.canvas.defaultLineJoin, lineWidth: this.pixelRatio_ * (strokeStyleWidth !== undefined ? - strokeStyleWidth : ol.render.canvas.defaultLineWidth), + strokeStyleWidth : ol.render.canvas.defaultLineWidth), miterLimit: strokeStyleMiterLimit !== undefined ? - strokeStyleMiterLimit : ol.render.canvas.defaultMiterLimit, + strokeStyleMiterLimit : ol.render.canvas.defaultMiterLimit, strokeStyle: ol.colorlike.asColorLike(strokeStyleColor ? - strokeStyleColor : ol.render.canvas.defaultStrokeStyle) + strokeStyleColor : ol.render.canvas.defaultStrokeStyle) }; } }; @@ -905,7 +905,7 @@ ol.render.canvas.Immediate.prototype.setTextStyle = function(textStyle) { var textFillStyleColor = textFillStyle.getColor(); this.textFillState_ = { fillStyle: ol.colorlike.asColorLike(textFillStyleColor ? - textFillStyleColor : ol.render.canvas.defaultFillStyle) + textFillStyleColor : ol.render.canvas.defaultFillStyle) }; } var textStrokeStyle = textStyle.getStroke(); @@ -921,19 +921,19 @@ ol.render.canvas.Immediate.prototype.setTextStyle = function(textStyle) { var textStrokeStyleMiterLimit = textStrokeStyle.getMiterLimit(); this.textStrokeState_ = { lineCap: textStrokeStyleLineCap !== undefined ? - textStrokeStyleLineCap : ol.render.canvas.defaultLineCap, + textStrokeStyleLineCap : ol.render.canvas.defaultLineCap, lineDash: textStrokeStyleLineDash ? - textStrokeStyleLineDash : ol.render.canvas.defaultLineDash, + textStrokeStyleLineDash : ol.render.canvas.defaultLineDash, lineDashOffset: textStrokeStyleLineDashOffset ? - textStrokeStyleLineDashOffset : ol.render.canvas.defaultLineDashOffset, + textStrokeStyleLineDashOffset : ol.render.canvas.defaultLineDashOffset, lineJoin: textStrokeStyleLineJoin !== undefined ? - textStrokeStyleLineJoin : ol.render.canvas.defaultLineJoin, + textStrokeStyleLineJoin : ol.render.canvas.defaultLineJoin, lineWidth: textStrokeStyleWidth !== undefined ? - textStrokeStyleWidth : ol.render.canvas.defaultLineWidth, + textStrokeStyleWidth : ol.render.canvas.defaultLineWidth, miterLimit: textStrokeStyleMiterLimit !== undefined ? - textStrokeStyleMiterLimit : ol.render.canvas.defaultMiterLimit, + textStrokeStyleMiterLimit : ol.render.canvas.defaultMiterLimit, strokeStyle: ol.colorlike.asColorLike(textStrokeStyleColor ? - textStrokeStyleColor : ol.render.canvas.defaultStrokeStyle) + textStrokeStyleColor : ol.render.canvas.defaultStrokeStyle) }; } var textFont = textStyle.getFont(); @@ -947,11 +947,11 @@ ol.render.canvas.Immediate.prototype.setTextStyle = function(textStyle) { var textTextBaseline = textStyle.getTextBaseline(); this.textState_ = { font: textFont !== undefined ? - textFont : ol.render.canvas.defaultFont, + textFont : ol.render.canvas.defaultFont, textAlign: textTextAlign !== undefined ? - textTextAlign : ol.render.canvas.defaultTextAlign, + textTextAlign : ol.render.canvas.defaultTextAlign, textBaseline: textTextBaseline !== undefined ? - textTextBaseline : ol.render.canvas.defaultTextBaseline + textTextBaseline : ol.render.canvas.defaultTextBaseline }; this.text_ = textText !== undefined ? textText : ''; this.textOffsetX_ = @@ -961,6 +961,6 @@ ol.render.canvas.Immediate.prototype.setTextStyle = function(textStyle) { this.textRotateWithView_ = textRotateWithView !== undefined ? textRotateWithView : false; this.textRotation_ = textRotation !== undefined ? textRotation : 0; this.textScale_ = this.pixelRatio_ * (textScale !== undefined ? - textScale : 1); + textScale : 1); } }; diff --git a/src/ol/render/canvas/linestringreplay.js b/src/ol/render/canvas/linestringreplay.js index 5814f7f9749..91e86dce8fb 100644 --- a/src/ol/render/canvas/linestringreplay.js +++ b/src/ol/render/canvas/linestringreplay.js @@ -222,25 +222,25 @@ ol.render.canvas.LineStringReplay.prototype.finish = function() { ol.render.canvas.LineStringReplay.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) { var strokeStyleColor = strokeStyle.getColor(); this.state_.strokeStyle = ol.colorlike.asColorLike(strokeStyleColor ? - strokeStyleColor : ol.render.canvas.defaultStrokeStyle); + strokeStyleColor : ol.render.canvas.defaultStrokeStyle); var strokeStyleLineCap = strokeStyle.getLineCap(); this.state_.lineCap = strokeStyleLineCap !== undefined ? - strokeStyleLineCap : ol.render.canvas.defaultLineCap; + strokeStyleLineCap : ol.render.canvas.defaultLineCap; var strokeStyleLineDash = strokeStyle.getLineDash(); this.state_.lineDash = strokeStyleLineDash ? - strokeStyleLineDash : ol.render.canvas.defaultLineDash; + strokeStyleLineDash : ol.render.canvas.defaultLineDash; var strokeStyleLineDashOffset = strokeStyle.getLineDashOffset(); this.state_.lineDashOffset = strokeStyleLineDashOffset ? - strokeStyleLineDashOffset : ol.render.canvas.defaultLineDashOffset; + strokeStyleLineDashOffset : ol.render.canvas.defaultLineDashOffset; var strokeStyleLineJoin = strokeStyle.getLineJoin(); this.state_.lineJoin = strokeStyleLineJoin !== undefined ? - strokeStyleLineJoin : ol.render.canvas.defaultLineJoin; + strokeStyleLineJoin : ol.render.canvas.defaultLineJoin; var strokeStyleWidth = strokeStyle.getWidth(); this.state_.lineWidth = strokeStyleWidth !== undefined ? - strokeStyleWidth : ol.render.canvas.defaultLineWidth; + strokeStyleWidth : ol.render.canvas.defaultLineWidth; var strokeStyleMiterLimit = strokeStyle.getMiterLimit(); this.state_.miterLimit = strokeStyleMiterLimit !== undefined ? - strokeStyleMiterLimit : ol.render.canvas.defaultMiterLimit; + strokeStyleMiterLimit : ol.render.canvas.defaultMiterLimit; if (this.state_.lineWidth > this.maxLineWidth) { this.maxLineWidth = this.state_.lineWidth; diff --git a/src/ol/render/canvas/polygonreplay.js b/src/ol/render/canvas/polygonreplay.js index 42f317c0fd7..54f85853483 100644 --- a/src/ol/render/canvas/polygonreplay.js +++ b/src/ol/render/canvas/polygonreplay.js @@ -178,7 +178,7 @@ ol.render.canvas.PolygonReplay.prototype.drawPolygon = function(polygonGeometry, this.hitDetectionInstructions.push([ ol.render.canvas.Instruction.SET_FILL_STYLE, ol.color.asString(ol.render.canvas.defaultFillStyle)] - ); + ); if (state.strokeStyle !== undefined) { this.hitDetectionInstructions.push([ ol.render.canvas.Instruction.SET_STROKE_STYLE, @@ -275,32 +275,32 @@ ol.render.canvas.PolygonReplay.prototype.setFillStrokeStyle = function(fillStyle if (fillStyle) { var fillStyleColor = fillStyle.getColor(); state.fillStyle = ol.colorlike.asColorLike(fillStyleColor ? - fillStyleColor : ol.render.canvas.defaultFillStyle); + fillStyleColor : ol.render.canvas.defaultFillStyle); } else { state.fillStyle = undefined; } if (strokeStyle) { var strokeStyleColor = strokeStyle.getColor(); state.strokeStyle = ol.colorlike.asColorLike(strokeStyleColor ? - strokeStyleColor : ol.render.canvas.defaultStrokeStyle); + strokeStyleColor : ol.render.canvas.defaultStrokeStyle); var strokeStyleLineCap = strokeStyle.getLineCap(); state.lineCap = strokeStyleLineCap !== undefined ? - strokeStyleLineCap : ol.render.canvas.defaultLineCap; + strokeStyleLineCap : ol.render.canvas.defaultLineCap; var strokeStyleLineDash = strokeStyle.getLineDash(); state.lineDash = strokeStyleLineDash ? - strokeStyleLineDash.slice() : ol.render.canvas.defaultLineDash; + strokeStyleLineDash.slice() : ol.render.canvas.defaultLineDash; var strokeStyleLineDashOffset = strokeStyle.getLineDashOffset(); state.lineDashOffset = strokeStyleLineDashOffset ? - strokeStyleLineDashOffset : ol.render.canvas.defaultLineDashOffset; + strokeStyleLineDashOffset : ol.render.canvas.defaultLineDashOffset; var strokeStyleLineJoin = strokeStyle.getLineJoin(); state.lineJoin = strokeStyleLineJoin !== undefined ? - strokeStyleLineJoin : ol.render.canvas.defaultLineJoin; + strokeStyleLineJoin : ol.render.canvas.defaultLineJoin; var strokeStyleWidth = strokeStyle.getWidth(); state.lineWidth = strokeStyleWidth !== undefined ? - strokeStyleWidth : ol.render.canvas.defaultLineWidth; + strokeStyleWidth : ol.render.canvas.defaultLineWidth; var strokeStyleMiterLimit = strokeStyle.getMiterLimit(); state.miterLimit = strokeStyleMiterLimit !== undefined ? - strokeStyleMiterLimit : ol.render.canvas.defaultMiterLimit; + strokeStyleMiterLimit : ol.render.canvas.defaultMiterLimit; if (state.lineWidth > this.maxLineWidth) { this.maxLineWidth = state.lineWidth; diff --git a/src/ol/render/canvas/replay.js b/src/ol/render/canvas/replay.js index 68a89ef6f0c..9472070cbd0 100644 --- a/src/ol/render/canvas/replay.js +++ b/src/ol/render/canvas/replay.js @@ -473,7 +473,7 @@ ol.render.canvas.Replay.prototype.replay_ = function( break; case ol.render.canvas.Instruction.SET_STROKE_STYLE: var usePixelRatio = instruction[8] !== undefined ? - instruction[8] : true; + instruction[8] : true; var renderedPixelRatio = instruction[9]; var lineWidth = /** @type {number} */ (instruction[2]); diff --git a/src/ol/render/canvas/textreplay.js b/src/ol/render/canvas/textreplay.js index 34ac54582c4..2310e6847af 100644 --- a/src/ol/render/canvas/textreplay.js +++ b/src/ol/render/canvas/textreplay.js @@ -239,7 +239,7 @@ ol.render.canvas.TextReplay.prototype.setTextStyle = function(textStyle) { } else { var textFillStyleColor = textFillStyle.getColor(); var fillStyle = ol.colorlike.asColorLike(textFillStyleColor ? - textFillStyleColor : ol.render.canvas.defaultFillStyle); + textFillStyleColor : ol.render.canvas.defaultFillStyle); if (!this.textFillState_) { this.textFillState_ = { fillStyle: fillStyle @@ -261,19 +261,19 @@ ol.render.canvas.TextReplay.prototype.setTextStyle = function(textStyle) { var textStrokeStyleWidth = textStrokeStyle.getWidth(); var textStrokeStyleMiterLimit = textStrokeStyle.getMiterLimit(); var lineCap = textStrokeStyleLineCap !== undefined ? - textStrokeStyleLineCap : ol.render.canvas.defaultLineCap; + textStrokeStyleLineCap : ol.render.canvas.defaultLineCap; var lineDash = textStrokeStyleLineDash ? - textStrokeStyleLineDash.slice() : ol.render.canvas.defaultLineDash; + textStrokeStyleLineDash.slice() : ol.render.canvas.defaultLineDash; var lineDashOffset = textStrokeStyleLineDashOffset !== undefined ? - textStrokeStyleLineDashOffset : ol.render.canvas.defaultLineDashOffset; + textStrokeStyleLineDashOffset : ol.render.canvas.defaultLineDashOffset; var lineJoin = textStrokeStyleLineJoin !== undefined ? - textStrokeStyleLineJoin : ol.render.canvas.defaultLineJoin; + textStrokeStyleLineJoin : ol.render.canvas.defaultLineJoin; var lineWidth = textStrokeStyleWidth !== undefined ? - textStrokeStyleWidth : ol.render.canvas.defaultLineWidth; + textStrokeStyleWidth : ol.render.canvas.defaultLineWidth; var miterLimit = textStrokeStyleMiterLimit !== undefined ? - textStrokeStyleMiterLimit : ol.render.canvas.defaultMiterLimit; + textStrokeStyleMiterLimit : ol.render.canvas.defaultMiterLimit; var strokeStyle = ol.colorlike.asColorLike(textStrokeStyleColor ? - textStrokeStyleColor : ol.render.canvas.defaultStrokeStyle); + textStrokeStyleColor : ol.render.canvas.defaultStrokeStyle); if (!this.textStrokeState_) { this.textStrokeState_ = { lineCap: lineCap, @@ -305,11 +305,11 @@ ol.render.canvas.TextReplay.prototype.setTextStyle = function(textStyle) { var textTextAlign = textStyle.getTextAlign(); var textTextBaseline = textStyle.getTextBaseline(); var font = textFont !== undefined ? - textFont : ol.render.canvas.defaultFont; + textFont : ol.render.canvas.defaultFont; var textAlign = textTextAlign !== undefined ? - textTextAlign : ol.render.canvas.defaultTextAlign; + textTextAlign : ol.render.canvas.defaultTextAlign; var textBaseline = textTextBaseline !== undefined ? - textTextBaseline : ol.render.canvas.defaultTextBaseline; + textTextBaseline : ol.render.canvas.defaultTextBaseline; if (!this.textState_) { this.textState_ = { font: font, diff --git a/src/ol/render/feature.js b/src/ol/render/feature.js index e383587ecea..702dbeb2c25 100644 --- a/src/ol/render/feature.js +++ b/src/ol/render/feature.js @@ -84,9 +84,9 @@ ol.render.Feature.prototype.getEnds = function() { ol.render.Feature.prototype.getExtent = function() { if (!this.extent_) { this.extent_ = this.type_ === ol.geom.GeometryType.POINT ? - ol.extent.createOrUpdateFromCoordinate(this.flatCoordinates_) : - ol.extent.createOrUpdateFromFlatCoordinates( - this.flatCoordinates_, 0, this.flatCoordinates_.length, 2); + ol.extent.createOrUpdateFromCoordinate(this.flatCoordinates_) : + ol.extent.createOrUpdateFromFlatCoordinates( + this.flatCoordinates_, 0, this.flatCoordinates_.length, 2); } return this.extent_; diff --git a/src/ol/render/webgl.js b/src/ol/render/webgl.js index 10b485cd6dd..e016bd64cd9 100644 --- a/src/ol/render/webgl.js +++ b/src/ol/render/webgl.js @@ -70,7 +70,7 @@ if (ol.ENABLE_WEBGL) { ol.render.webgl.triangleIsCounterClockwise = function(x1, y1, x2, y2, x3, y3) { var area = (x2 - x1) * (y3 - y1) - (x3 - x1) * (y2 - y1); return (area <= ol.render.webgl.EPSILON && area >= -ol.render.webgl.EPSILON) ? - undefined : area > 0; + undefined : area > 0; }; /** diff --git a/src/ol/render/webgl/circlereplay.js b/src/ol/render/webgl/circlereplay.js index 3a83f9f0a40..9abeee1d9c3 100644 --- a/src/ol/render/webgl/circlereplay.js +++ b/src/ol/render/webgl/circlereplay.js @@ -381,10 +381,10 @@ if (ol.ENABLE_WEBGL) { if (strokeStyle) { var strokeStyleLineDash = strokeStyle.getLineDash(); this.state_.lineDash = strokeStyleLineDash ? - strokeStyleLineDash : ol.render.webgl.defaultLineDash; + strokeStyleLineDash : ol.render.webgl.defaultLineDash; var strokeStyleLineDashOffset = strokeStyle.getLineDashOffset(); this.state_.lineDashOffset = strokeStyleLineDashOffset ? - strokeStyleLineDashOffset : ol.render.webgl.defaultLineDashOffset; + strokeStyleLineDashOffset : ol.render.webgl.defaultLineDashOffset; strokeStyleColor = strokeStyle.getColor(); if (!(strokeStyleColor instanceof CanvasGradient) && !(strokeStyleColor instanceof CanvasPattern)) { @@ -396,7 +396,7 @@ if (ol.ENABLE_WEBGL) { } strokeStyleWidth = strokeStyle.getWidth(); strokeStyleWidth = strokeStyleWidth !== undefined ? - strokeStyleWidth : ol.render.webgl.defaultLineWidth; + strokeStyleWidth : ol.render.webgl.defaultLineWidth; } else { strokeStyleColor = [0, 0, 0, 0]; strokeStyleWidth = 0; diff --git a/src/ol/render/webgl/circlereplay/defaultshader.js b/src/ol/render/webgl/circlereplay/defaultshader.js index a50f1c9615b..6da5615e372 100644 --- a/src/ol/render/webgl/circlereplay/defaultshader.js +++ b/src/ol/render/webgl/circlereplay/defaultshader.js @@ -38,8 +38,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.render.webgl.circlereplay.defaultshader.Fragment.SOURCE = ol.DEBUG_WEBGL ? - ol.render.webgl.circlereplay.defaultshader.Fragment.DEBUG_SOURCE : - ol.render.webgl.circlereplay.defaultshader.Fragment.OPTIMIZED_SOURCE; + ol.render.webgl.circlereplay.defaultshader.Fragment.DEBUG_SOURCE : + ol.render.webgl.circlereplay.defaultshader.Fragment.OPTIMIZED_SOURCE; ol.render.webgl.circlereplay.defaultshader.fragment = new ol.render.webgl.circlereplay.defaultshader.Fragment(); @@ -75,8 +75,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.render.webgl.circlereplay.defaultshader.Vertex.SOURCE = ol.DEBUG_WEBGL ? - ol.render.webgl.circlereplay.defaultshader.Vertex.DEBUG_SOURCE : - ol.render.webgl.circlereplay.defaultshader.Vertex.OPTIMIZED_SOURCE; + ol.render.webgl.circlereplay.defaultshader.Vertex.DEBUG_SOURCE : + ol.render.webgl.circlereplay.defaultshader.Vertex.OPTIMIZED_SOURCE; ol.render.webgl.circlereplay.defaultshader.vertex = new ol.render.webgl.circlereplay.defaultshader.Vertex(); diff --git a/src/ol/render/webgl/imagereplay.js b/src/ol/render/webgl/imagereplay.js index aa7a33f8730..16fb0be0455 100644 --- a/src/ol/render/webgl/imagereplay.js +++ b/src/ol/render/webgl/imagereplay.js @@ -497,12 +497,12 @@ if (ol.ENABLE_WEBGL) { } // continue with the next feature start = (featureIndex === this.startIndices.length - 1) ? - groupEnd : this.startIndices[featureIndex + 1]; + groupEnd : this.startIndices[featureIndex + 1]; end = start; } else { // the feature is not skipped, augment the end index end = (featureIndex === this.startIndices.length - 1) ? - groupEnd : this.startIndices[featureIndex + 1]; + groupEnd : this.startIndices[featureIndex + 1]; } featureIndex++; } diff --git a/src/ol/render/webgl/imagereplay/defaultshader.js b/src/ol/render/webgl/imagereplay/defaultshader.js index 92e91c74a1a..ee5fef2ea4d 100644 --- a/src/ol/render/webgl/imagereplay/defaultshader.js +++ b/src/ol/render/webgl/imagereplay/defaultshader.js @@ -38,8 +38,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.render.webgl.imagereplay.defaultshader.Fragment.SOURCE = ol.DEBUG_WEBGL ? - ol.render.webgl.imagereplay.defaultshader.Fragment.DEBUG_SOURCE : - ol.render.webgl.imagereplay.defaultshader.Fragment.OPTIMIZED_SOURCE; + ol.render.webgl.imagereplay.defaultshader.Fragment.DEBUG_SOURCE : + ol.render.webgl.imagereplay.defaultshader.Fragment.OPTIMIZED_SOURCE; ol.render.webgl.imagereplay.defaultshader.fragment = new ol.render.webgl.imagereplay.defaultshader.Fragment(); @@ -75,8 +75,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.render.webgl.imagereplay.defaultshader.Vertex.SOURCE = ol.DEBUG_WEBGL ? - ol.render.webgl.imagereplay.defaultshader.Vertex.DEBUG_SOURCE : - ol.render.webgl.imagereplay.defaultshader.Vertex.OPTIMIZED_SOURCE; + ol.render.webgl.imagereplay.defaultshader.Vertex.DEBUG_SOURCE : + ol.render.webgl.imagereplay.defaultshader.Vertex.OPTIMIZED_SOURCE; ol.render.webgl.imagereplay.defaultshader.vertex = new ol.render.webgl.imagereplay.defaultshader.Vertex(); diff --git a/src/ol/render/webgl/immediate.js b/src/ol/render/webgl/immediate.js index 5515cd5e9f8..23e7a646f60 100644 --- a/src/ol/render/webgl/immediate.js +++ b/src/ol/render/webgl/immediate.js @@ -171,7 +171,7 @@ if (ol.ENABLE_WEBGL) { var context = this.context_; var replayGroup = new ol.render.webgl.ReplayGroup(1, this.extent_); var replay = /** @type {ol.render.webgl.ImageReplay} */ ( - replayGroup.getReplay(0, ol.render.ReplayType.IMAGE)); + replayGroup.getReplay(0, ol.render.ReplayType.IMAGE)); replay.setImageStyle(this.imageStyle_); replay.drawPoint(geometry, data); replay.finish(context); @@ -194,7 +194,7 @@ if (ol.ENABLE_WEBGL) { var context = this.context_; var replayGroup = new ol.render.webgl.ReplayGroup(1, this.extent_); var replay = /** @type {ol.render.webgl.ImageReplay} */ ( - replayGroup.getReplay(0, ol.render.ReplayType.IMAGE)); + replayGroup.getReplay(0, ol.render.ReplayType.IMAGE)); replay.setImageStyle(this.imageStyle_); replay.drawMultiPoint(geometry, data); replay.finish(context); @@ -216,7 +216,7 @@ if (ol.ENABLE_WEBGL) { var context = this.context_; var replayGroup = new ol.render.webgl.ReplayGroup(1, this.extent_); var replay = /** @type {ol.render.webgl.LineStringReplay} */ ( - replayGroup.getReplay(0, ol.render.ReplayType.LINE_STRING)); + replayGroup.getReplay(0, ol.render.ReplayType.LINE_STRING)); replay.setFillStrokeStyle(null, this.strokeStyle_); replay.drawLineString(geometry, data); replay.finish(context); @@ -238,7 +238,7 @@ if (ol.ENABLE_WEBGL) { var context = this.context_; var replayGroup = new ol.render.webgl.ReplayGroup(1, this.extent_); var replay = /** @type {ol.render.webgl.LineStringReplay} */ ( - replayGroup.getReplay(0, ol.render.ReplayType.LINE_STRING)); + replayGroup.getReplay(0, ol.render.ReplayType.LINE_STRING)); replay.setFillStrokeStyle(null, this.strokeStyle_); replay.drawMultiLineString(geometry, data); replay.finish(context); @@ -260,7 +260,7 @@ if (ol.ENABLE_WEBGL) { var context = this.context_; var replayGroup = new ol.render.webgl.ReplayGroup(1, this.extent_); var replay = /** @type {ol.render.webgl.PolygonReplay} */ ( - replayGroup.getReplay(0, ol.render.ReplayType.POLYGON)); + replayGroup.getReplay(0, ol.render.ReplayType.POLYGON)); replay.setFillStrokeStyle(this.fillStyle_, this.strokeStyle_); replay.drawPolygon(geometry, data); replay.finish(context); @@ -282,7 +282,7 @@ if (ol.ENABLE_WEBGL) { var context = this.context_; var replayGroup = new ol.render.webgl.ReplayGroup(1, this.extent_); var replay = /** @type {ol.render.webgl.PolygonReplay} */ ( - replayGroup.getReplay(0, ol.render.ReplayType.POLYGON)); + replayGroup.getReplay(0, ol.render.ReplayType.POLYGON)); replay.setFillStrokeStyle(this.fillStyle_, this.strokeStyle_); replay.drawMultiPolygon(geometry, data); replay.finish(context); @@ -304,7 +304,7 @@ if (ol.ENABLE_WEBGL) { var context = this.context_; var replayGroup = new ol.render.webgl.ReplayGroup(1, this.extent_); var replay = /** @type {ol.render.webgl.CircleReplay} */ ( - replayGroup.getReplay(0, ol.render.ReplayType.CIRCLE)); + replayGroup.getReplay(0, ol.render.ReplayType.CIRCLE)); replay.setFillStrokeStyle(this.fillStyle_, this.strokeStyle_); replay.drawCircle(geometry, data); replay.finish(context); diff --git a/src/ol/render/webgl/linestringreplay.js b/src/ol/render/webgl/linestringreplay.js index e72ea6c9aa7..2bce1502a8e 100644 --- a/src/ol/render/webgl/linestringreplay.js +++ b/src/ol/render/webgl/linestringreplay.js @@ -88,9 +88,9 @@ if (ol.ENABLE_WEBGL) { //ol.render.webgl.LineStringReplay.Instruction_, and a rounding factor (1 or 2). If the product is even, //we round it. If it is odd, we don't. var lineJoin = this.state_.lineJoin === 'bevel' ? 0 : - this.state_.lineJoin === 'miter' ? 1 : 2; + this.state_.lineJoin === 'miter' ? 1 : 2; var lineCap = this.state_.lineCap === 'butt' ? 0 : - this.state_.lineCap === 'square' ? 1 : 2; + this.state_.lineCap === 'square' ? 1 : 2; var closed = ol.geom.flat.topology.lineStringIsClosed(flatCoordinates, offset, end, stride); var startCoords, sign, n; var lastIndex = numIndices; @@ -194,7 +194,7 @@ if (ol.ENABLE_WEBGL) { // We group CW and straight lines, thus the not so inituitive CCW checking function. sign = ol.render.webgl.triangleIsCounterClockwise(p0[0], p0[1], p1[0], p1[1], p2[0], p2[1]) - ? -1 : 1; + ? -1 : 1; numVertices = this.addVertices_(p0, p1, p2, sign * ol.render.webgl.LineStringReplay.Instruction_.BEVEL_FIRST * (lineJoin || 1), numVertices); @@ -236,7 +236,7 @@ if (ol.ENABLE_WEBGL) { if (closed) { n = n || numVertices / 7; sign = ol.geom.flat.orient.linearRingIsClockwise([p0[0], p0[1], p1[0], p1[1], p2[0], p2[1]], 0, 6, 2) - ? 1 : -1; + ? 1 : -1; numVertices = this.addVertices_(p0, p1, p2, sign * ol.render.webgl.LineStringReplay.Instruction_.BEVEL_FIRST * (lineJoin || 1), numVertices); @@ -635,16 +635,16 @@ if (ol.ENABLE_WEBGL) { ol.render.webgl.LineStringReplay.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) { var strokeStyleLineCap = strokeStyle.getLineCap(); this.state_.lineCap = strokeStyleLineCap !== undefined ? - strokeStyleLineCap : ol.render.webgl.defaultLineCap; + strokeStyleLineCap : ol.render.webgl.defaultLineCap; var strokeStyleLineDash = strokeStyle.getLineDash(); this.state_.lineDash = strokeStyleLineDash ? - strokeStyleLineDash : ol.render.webgl.defaultLineDash; + strokeStyleLineDash : ol.render.webgl.defaultLineDash; var strokeStyleLineDashOffset = strokeStyle.getLineDashOffset(); this.state_.lineDashOffset = strokeStyleLineDashOffset ? - strokeStyleLineDashOffset : ol.render.webgl.defaultLineDashOffset; + strokeStyleLineDashOffset : ol.render.webgl.defaultLineDashOffset; var strokeStyleLineJoin = strokeStyle.getLineJoin(); this.state_.lineJoin = strokeStyleLineJoin !== undefined ? - strokeStyleLineJoin : ol.render.webgl.defaultLineJoin; + strokeStyleLineJoin : ol.render.webgl.defaultLineJoin; var strokeStyleColor = strokeStyle.getColor(); if (!(strokeStyleColor instanceof CanvasGradient) && !(strokeStyleColor instanceof CanvasPattern)) { @@ -656,10 +656,10 @@ if (ol.ENABLE_WEBGL) { } var strokeStyleWidth = strokeStyle.getWidth(); strokeStyleWidth = strokeStyleWidth !== undefined ? - strokeStyleWidth : ol.render.webgl.defaultLineWidth; + strokeStyleWidth : ol.render.webgl.defaultLineWidth; var strokeStyleMiterLimit = strokeStyle.getMiterLimit(); strokeStyleMiterLimit = strokeStyleMiterLimit !== undefined ? - strokeStyleMiterLimit : ol.render.webgl.defaultMiterLimit; + strokeStyleMiterLimit : ol.render.webgl.defaultMiterLimit; if (!this.state_.strokeColor || !ol.array.equals(this.state_.strokeColor, strokeStyleColor) || this.state_.lineWidth !== strokeStyleWidth || this.state_.miterLimit !== strokeStyleMiterLimit) { this.state_.changed = true; diff --git a/src/ol/render/webgl/linestringreplay/defaultshader.js b/src/ol/render/webgl/linestringreplay/defaultshader.js index 02e1994f009..d355e0194c2 100644 --- a/src/ol/render/webgl/linestringreplay/defaultshader.js +++ b/src/ol/render/webgl/linestringreplay/defaultshader.js @@ -38,8 +38,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.render.webgl.linestringreplay.defaultshader.Fragment.SOURCE = ol.DEBUG_WEBGL ? - ol.render.webgl.linestringreplay.defaultshader.Fragment.DEBUG_SOURCE : - ol.render.webgl.linestringreplay.defaultshader.Fragment.OPTIMIZED_SOURCE; + ol.render.webgl.linestringreplay.defaultshader.Fragment.DEBUG_SOURCE : + ol.render.webgl.linestringreplay.defaultshader.Fragment.OPTIMIZED_SOURCE; ol.render.webgl.linestringreplay.defaultshader.fragment = new ol.render.webgl.linestringreplay.defaultshader.Fragment(); @@ -75,8 +75,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.render.webgl.linestringreplay.defaultshader.Vertex.SOURCE = ol.DEBUG_WEBGL ? - ol.render.webgl.linestringreplay.defaultshader.Vertex.DEBUG_SOURCE : - ol.render.webgl.linestringreplay.defaultshader.Vertex.OPTIMIZED_SOURCE; + ol.render.webgl.linestringreplay.defaultshader.Vertex.DEBUG_SOURCE : + ol.render.webgl.linestringreplay.defaultshader.Vertex.OPTIMIZED_SOURCE; ol.render.webgl.linestringreplay.defaultshader.vertex = new ol.render.webgl.linestringreplay.defaultshader.Vertex(); diff --git a/src/ol/render/webgl/polygonreplay.js b/src/ol/render/webgl/polygonreplay.js index d0f885234bc..02ce00d3422 100644 --- a/src/ol/render/webgl/polygonreplay.js +++ b/src/ol/render/webgl/polygonreplay.js @@ -211,8 +211,8 @@ if (ol.ENABLE_WEBGL) { do { var reflex = ccw ? ol.render.webgl.triangleIsCounterClockwise(s1.p1.x, s1.p1.y, s0.p1.x, s0.p1.y, s0.p0.x, s0.p0.y) : - ol.render.webgl.triangleIsCounterClockwise(s0.p0.x, s0.p0.y, s0.p1.x, - s0.p1.y, s1.p1.x, s1.p1.y); + ol.render.webgl.triangleIsCounterClockwise(s0.p0.x, s0.p0.y, s0.p1.x, + s0.p1.y, s1.p1.x, s1.p1.y); if (reflex === undefined) { this.removeItem_(s0, s1, list, rtree); pointsReclassified = true; @@ -609,7 +609,7 @@ if (ol.ENABLE_WEBGL) { }; - /** + /** * @private * @param {ol.WebglPolygonSegment} s0 Segment before the remove candidate. * @param {ol.WebglPolygonSegment} s1 Remove candidate segment. @@ -642,7 +642,7 @@ if (ol.ENABLE_WEBGL) { var result = []; var segmentsInExtent = rtree.getInExtent([Math.min(p0.x, p1.x, p2.x), Math.min(p0.y, p1.y, p2.y), Math.max(p0.x, p1.x, p2.x), Math.max(p0.y, - p1.y, p2.y)]); + p1.y, p2.y)]); for (i = 0, ii = segmentsInExtent.length; i < ii; ++i) { for (j in segmentsInExtent[i]) { p = segmentsInExtent[i][j]; diff --git a/src/ol/render/webgl/polygonreplay/defaultshader.js b/src/ol/render/webgl/polygonreplay/defaultshader.js index ccd978d93a4..46db42c7cb0 100644 --- a/src/ol/render/webgl/polygonreplay/defaultshader.js +++ b/src/ol/render/webgl/polygonreplay/defaultshader.js @@ -38,8 +38,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.render.webgl.polygonreplay.defaultshader.Fragment.SOURCE = ol.DEBUG_WEBGL ? - ol.render.webgl.polygonreplay.defaultshader.Fragment.DEBUG_SOURCE : - ol.render.webgl.polygonreplay.defaultshader.Fragment.OPTIMIZED_SOURCE; + ol.render.webgl.polygonreplay.defaultshader.Fragment.DEBUG_SOURCE : + ol.render.webgl.polygonreplay.defaultshader.Fragment.OPTIMIZED_SOURCE; ol.render.webgl.polygonreplay.defaultshader.fragment = new ol.render.webgl.polygonreplay.defaultshader.Fragment(); @@ -75,8 +75,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.render.webgl.polygonreplay.defaultshader.Vertex.SOURCE = ol.DEBUG_WEBGL ? - ol.render.webgl.polygonreplay.defaultshader.Vertex.DEBUG_SOURCE : - ol.render.webgl.polygonreplay.defaultshader.Vertex.OPTIMIZED_SOURCE; + ol.render.webgl.polygonreplay.defaultshader.Vertex.DEBUG_SOURCE : + ol.render.webgl.polygonreplay.defaultshader.Vertex.OPTIMIZED_SOURCE; ol.render.webgl.polygonreplay.defaultshader.vertex = new ol.render.webgl.polygonreplay.defaultshader.Vertex(); diff --git a/src/ol/render/webgl/replay.js b/src/ol/render/webgl/replay.js index 9e36d9a87b9..543d1048cc9 100644 --- a/src/ol/render/webgl/replay.js +++ b/src/ol/render/webgl/replay.js @@ -309,11 +309,11 @@ if (ol.ENABLE_WEBGL) { } gl.uniformMatrix4fv(locations.u_projectionMatrix, false, - ol.vec.Mat4.fromTransform(this.tmpMat4_, projectionMatrix)); + ol.vec.Mat4.fromTransform(this.tmpMat4_, projectionMatrix)); gl.uniformMatrix4fv(locations.u_offsetScaleMatrix, false, - ol.vec.Mat4.fromTransform(this.tmpMat4_, offsetScaleMatrix)); + ol.vec.Mat4.fromTransform(this.tmpMat4_, offsetScaleMatrix)); gl.uniformMatrix4fv(locations.u_offsetRotateMatrix, false, - ol.vec.Mat4.fromTransform(this.tmpMat4_, offsetRotateMatrix)); + ol.vec.Mat4.fromTransform(this.tmpMat4_, offsetRotateMatrix)); gl.uniform1f(locations.u_opacity, opacity); // draw! @@ -335,10 +335,10 @@ if (ol.ENABLE_WEBGL) { } gl.clear(gl.STENCIL_BUFFER_BIT); gl.stencilFunc(/** @type {number} */ (tmpStencilFunc), - /** @type {number} */ (tmpStencilRef), /** @type {number} */ (tmpStencilMaskVal)); + /** @type {number} */ (tmpStencilRef), /** @type {number} */ (tmpStencilMaskVal)); gl.stencilMask(/** @type {number} */ (tmpStencilMask)); gl.stencilOp(/** @type {number} */ (tmpStencilOpFail), - /** @type {number} */ (tmpStencilOpZFail), /** @type {number} */ (tmpStencilOpPass)); + /** @type {number} */ (tmpStencilOpZFail), /** @type {number} */ (tmpStencilOpPass)); } return result; @@ -354,7 +354,7 @@ if (ol.ENABLE_WEBGL) { ol.render.webgl.Replay.prototype.drawElements = function( gl, context, start, end) { var elementType = context.hasOESElementIndexUint ? - ol.webgl.UNSIGNED_INT : ol.webgl.UNSIGNED_SHORT; + ol.webgl.UNSIGNED_INT : ol.webgl.UNSIGNED_SHORT; var elementSize = context.hasOESElementIndexUint ? 4 : 2; var numItems = end - start; diff --git a/src/ol/renderer/canvas/layer.js b/src/ol/renderer/canvas/layer.js index 7ff2f07e652..8ddd277ce55 100644 --- a/src/ol/renderer/canvas/layer.js +++ b/src/ol/renderer/canvas/layer.js @@ -85,7 +85,7 @@ ol.renderer.canvas.Layer.prototype.dispatchComposeEvent_ = function(type, contex var rotation = frameState.viewState.rotation; ol.render.canvas.rotateAtOffset(context, -rotation, width / 2, height / 2); var transform = opt_transform !== undefined ? - opt_transform : this.getTransform(frameState, 0); + opt_transform : this.getTransform(frameState, 0); var render = new ol.render.canvas.Immediate( context, frameState.pixelRatio, frameState.extent, transform, frameState.viewState.rotation); diff --git a/src/ol/renderer/canvas/map.js b/src/ol/renderer/canvas/map.js index f9801a630bb..509695e4dd9 100644 --- a/src/ol/renderer/canvas/map.js +++ b/src/ol/renderer/canvas/map.js @@ -186,7 +186,7 @@ ol.renderer.canvas.Map.prototype.renderFrame = function(frameState) { * @inheritDoc */ ol.renderer.canvas.Map.prototype.forEachLayerAtPixel = function(pixel, frameState, callback, thisArg, - layerFilter, thisArg2) { + layerFilter, thisArg2) { var result; var viewState = frameState.viewState; var viewResolution = viewState.resolution; diff --git a/src/ol/renderer/canvas/tilelayer.js b/src/ol/renderer/canvas/tilelayer.js index 3690c001078..2f3695d5106 100644 --- a/src/ol/renderer/canvas/tilelayer.js +++ b/src/ol/renderer/canvas/tilelayer.js @@ -178,12 +178,12 @@ ol.renderer.canvas.TileLayer.prototype.prepareFrame = function(frameState, layer var hints = frameState.viewHints; var animatingOrInteracting = hints[ol.ViewHint.ANIMATING] || hints[ol.ViewHint.INTERACTING]; if (!(this.renderedResolution && Date.now() - frameState.time > 16 && animatingOrInteracting) && ( - newTiles || + newTiles || !(this.renderedExtent_ && ol.extent.containsExtent(this.renderedExtent_, extent)) || this.renderedRevision != sourceRevision || oversampling != this.oversampling_ || !animatingOrInteracting && renderedResolution != this.renderedResolution - )) { + )) { var context = this.context; if (context) { diff --git a/src/ol/renderer/canvas/vectorlayer.js b/src/ol/renderer/canvas/vectorlayer.js index 448c073d384..49bbf239316 100644 --- a/src/ol/renderer/canvas/vectorlayer.js +++ b/src/ol/renderer/canvas/vectorlayer.js @@ -74,7 +74,7 @@ ol.renderer.canvas.VectorLayer.prototype.composeFrame = function(frameState, lay var extent = frameState.extent; var pixelRatio = frameState.pixelRatio; var skippedFeatureUids = layerState.managed ? - frameState.skippedFeatureUids : {}; + frameState.skippedFeatureUids : {}; var viewState = frameState.viewState; var projection = viewState.projection; var rotation = viewState.rotation; diff --git a/src/ol/renderer/layer.js b/src/ol/renderer/layer.js index 0c083fced38..ebccbdc8c3a 100644 --- a/src/ol/renderer/layer.js +++ b/src/ol/renderer/layer.js @@ -66,20 +66,20 @@ ol.renderer.Layer.prototype.hasFeatureAtCoordinate = ol.functions.FALSE; */ ol.renderer.Layer.prototype.createLoadedTileFinder = function(source, projection, tiles) { return ( - /** + /** * @param {number} zoom Zoom level. * @param {ol.TileRange} tileRange Tile range. * @return {boolean} The tile range is fully loaded. */ - function(zoom, tileRange) { - function callback(tile) { - if (!tiles[zoom]) { - tiles[zoom] = {}; - } - tiles[zoom][tile.tileCoord.toString()] = tile; + function(zoom, tileRange) { + function callback(tile) { + if (!tiles[zoom]) { + tiles[zoom] = {}; } - return source.forEachLoadedTile(projection, zoom, tileRange, callback); - }); + tiles[zoom][tile.tileCoord.toString()] = tile; + } + return source.forEachLoadedTile(projection, zoom, tileRange, callback); + }); }; @@ -153,11 +153,11 @@ ol.renderer.Layer.prototype.scheduleExpireCache = function(frameState, tileSourc var postRenderFunction = function(tileSource, map, frameState) { var tileSourceKey = ol.getUid(tileSource).toString(); tileSource.expireCache(frameState.viewState.projection, - frameState.usedTiles[tileSourceKey]); + frameState.usedTiles[tileSourceKey]); }.bind(null, tileSource); frameState.postRenderFunctions.push( - /** @type {ol.PostRenderFunction} */ (postRenderFunction) + /** @type {ol.PostRenderFunction} */ (postRenderFunction) ); } }; diff --git a/src/ol/renderer/map.js b/src/ol/renderer/map.js index 6a3373334e7..78c40b09f7e 100644 --- a/src/ol/renderer/map.js +++ b/src/ol/renderer/map.js @@ -103,7 +103,7 @@ ol.renderer.Map.expireIconCache_ = function(map, frameState) { * @template S,T,U */ ol.renderer.Map.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, hitTolerance, callback, thisArg, - layerFilter, thisArg2) { + layerFilter, thisArg2) { var result; var viewState = frameState.viewState; var viewResolution = viewState.resolution; @@ -173,7 +173,7 @@ ol.renderer.Map.prototype.forEachFeatureAtCoordinate = function(coordinate, fram * @template S,T,U */ ol.renderer.Map.prototype.forEachLayerAtPixel = function(pixel, frameState, callback, thisArg, - layerFilter, thisArg2) {}; + layerFilter, thisArg2) {}; /** @@ -303,7 +303,7 @@ ol.renderer.Map.prototype.removeUnusedLayerRenderers_ = function(map, frameState */ ol.renderer.Map.prototype.scheduleExpireIconCache = function(frameState) { frameState.postRenderFunctions.push( - /** @type {ol.PostRenderFunction} */ (ol.renderer.Map.expireIconCache_) + /** @type {ol.PostRenderFunction} */ (ol.renderer.Map.expireIconCache_) ); }; @@ -317,7 +317,7 @@ ol.renderer.Map.prototype.scheduleRemoveUnusedLayerRenderers = function(frameSta for (layerKey in this.layerRenderers_) { if (!(layerKey in frameState.layerStates)) { frameState.postRenderFunctions.push( - /** @type {ol.PostRenderFunction} */ (this.removeUnusedLayerRenderers_.bind(this)) + /** @type {ol.PostRenderFunction} */ (this.removeUnusedLayerRenderers_.bind(this)) ); return; } diff --git a/src/ol/renderer/webgl/defaultmapshader.js b/src/ol/renderer/webgl/defaultmapshader.js index 95985672057..d315b01b1e9 100644 --- a/src/ol/renderer/webgl/defaultmapshader.js +++ b/src/ol/renderer/webgl/defaultmapshader.js @@ -38,8 +38,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.renderer.webgl.defaultmapshader.Fragment.SOURCE = ol.DEBUG_WEBGL ? - ol.renderer.webgl.defaultmapshader.Fragment.DEBUG_SOURCE : - ol.renderer.webgl.defaultmapshader.Fragment.OPTIMIZED_SOURCE; + ol.renderer.webgl.defaultmapshader.Fragment.DEBUG_SOURCE : + ol.renderer.webgl.defaultmapshader.Fragment.OPTIMIZED_SOURCE; ol.renderer.webgl.defaultmapshader.fragment = new ol.renderer.webgl.defaultmapshader.Fragment(); @@ -75,8 +75,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.renderer.webgl.defaultmapshader.Vertex.SOURCE = ol.DEBUG_WEBGL ? - ol.renderer.webgl.defaultmapshader.Vertex.DEBUG_SOURCE : - ol.renderer.webgl.defaultmapshader.Vertex.OPTIMIZED_SOURCE; + ol.renderer.webgl.defaultmapshader.Vertex.DEBUG_SOURCE : + ol.renderer.webgl.defaultmapshader.Vertex.OPTIMIZED_SOURCE; ol.renderer.webgl.defaultmapshader.vertex = new ol.renderer.webgl.defaultmapshader.Vertex(); diff --git a/src/ol/renderer/webgl/imagelayer.js b/src/ol/renderer/webgl/imagelayer.js index fe44044127b..bf87d2494bd 100644 --- a/src/ol/renderer/webgl/imagelayer.js +++ b/src/ol/renderer/webgl/imagelayer.js @@ -140,7 +140,7 @@ if (ol.ENABLE_WEBGL) { } }.bind(null, gl, this.texture); frameState.postRenderFunctions.push( - /** @type {ol.PostRenderFunction} */ (postRenderFunction) + /** @type {ol.PostRenderFunction} */ (postRenderFunction) ); } } @@ -183,7 +183,7 @@ if (ol.ENABLE_WEBGL) { * @private */ ol.renderer.webgl.ImageLayer.prototype.updateProjectionMatrix_ = function(canvasWidth, canvasHeight, pixelRatio, - viewCenter, viewResolution, viewRotation, imageExtent) { + viewCenter, viewResolution, viewRotation, imageExtent) { var canvasExtentWidth = canvasWidth * viewResolution; var canvasExtentHeight = canvasHeight * viewResolution; diff --git a/src/ol/renderer/webgl/layer.js b/src/ol/renderer/webgl/layer.js index eb5e48078db..9f557a71c7a 100644 --- a/src/ol/renderer/webgl/layer.js +++ b/src/ol/renderer/webgl/layer.js @@ -113,7 +113,7 @@ if (ol.ENABLE_WEBGL) { }.bind(null, gl, this.framebuffer, this.texture); frameState.postRenderFunctions.push( - /** @type {ol.PostRenderFunction} */ (postRenderFunction) + /** @type {ol.PostRenderFunction} */ (postRenderFunction) ); var texture = ol.webgl.Context.createEmptyTexture( diff --git a/src/ol/renderer/webgl/map.js b/src/ol/renderer/webgl/map.js index 2799444316b..f06ea93a1d6 100644 --- a/src/ol/renderer/webgl/map.js +++ b/src/ol/renderer/webgl/map.js @@ -37,7 +37,7 @@ if (ol.ENABLE_WEBGL) { * @type {HTMLCanvasElement} */ this.canvas_ = /** @type {HTMLCanvasElement} */ - (document.createElement('CANVAS')); + (document.createElement('CANVAS')); this.canvas_.style.width = '100%'; this.canvas_.style.height = '100%'; this.canvas_.style.display = 'block'; @@ -460,7 +460,7 @@ if (ol.ENABLE_WEBGL) { if (this.textureCache_.getCount() - this.textureCacheFrameMarkerCount_ > ol.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK) { frameState.postRenderFunctions.push( - /** @type {ol.PostRenderFunction} */ (this.expireCache_.bind(this)) + /** @type {ol.PostRenderFunction} */ (this.expireCache_.bind(this)) ); } @@ -481,7 +481,7 @@ if (ol.ENABLE_WEBGL) { * @inheritDoc */ ol.renderer.webgl.Map.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, hitTolerance, callback, thisArg, - layerFilter, thisArg2) { + layerFilter, thisArg2) { var result; if (this.getGL().isContextLost()) { @@ -546,7 +546,7 @@ if (ol.ENABLE_WEBGL) { * @inheritDoc */ ol.renderer.webgl.Map.prototype.forEachLayerAtPixel = function(pixel, frameState, callback, thisArg, - layerFilter, thisArg2) { + layerFilter, thisArg2) { if (this.getGL().isContextLost()) { return false; } diff --git a/src/ol/renderer/webgl/tilelayer.js b/src/ol/renderer/webgl/tilelayer.js index 5667884fb5a..f75454ac22d 100644 --- a/src/ol/renderer/webgl/tilelayer.js +++ b/src/ol/renderer/webgl/tilelayer.js @@ -103,24 +103,24 @@ if (ol.ENABLE_WEBGL) { var mapRenderer = this.mapRenderer; return ( - /** + /** * @param {number} zoom Zoom level. * @param {ol.TileRange} tileRange Tile range. * @return {boolean} The tile range is fully loaded. */ - function(zoom, tileRange) { - function callback(tile) { - var loaded = mapRenderer.isTileTextureLoaded(tile); - if (loaded) { - if (!tiles[zoom]) { - tiles[zoom] = {}; - } - tiles[zoom][tile.tileCoord.toString()] = tile; + function(zoom, tileRange) { + function callback(tile) { + var loaded = mapRenderer.isTileTextureLoaded(tile); + if (loaded) { + if (!tiles[zoom]) { + tiles[zoom] = {}; } - return loaded; + tiles[zoom][tile.tileCoord.toString()] = tile; } - return source.forEachLoadedTile(projection, zoom, tileRange, callback); - }); + return loaded; + } + return source.forEachLoadedTile(projection, zoom, tileRange, callback); + }); }; diff --git a/src/ol/renderer/webgl/tilelayershader.js b/src/ol/renderer/webgl/tilelayershader.js index 1fcd190c541..c97eeb56d0e 100644 --- a/src/ol/renderer/webgl/tilelayershader.js +++ b/src/ol/renderer/webgl/tilelayershader.js @@ -38,8 +38,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.renderer.webgl.tilelayershader.Fragment.SOURCE = ol.DEBUG_WEBGL ? - ol.renderer.webgl.tilelayershader.Fragment.DEBUG_SOURCE : - ol.renderer.webgl.tilelayershader.Fragment.OPTIMIZED_SOURCE; + ol.renderer.webgl.tilelayershader.Fragment.DEBUG_SOURCE : + ol.renderer.webgl.tilelayershader.Fragment.OPTIMIZED_SOURCE; ol.renderer.webgl.tilelayershader.fragment = new ol.renderer.webgl.tilelayershader.Fragment(); @@ -75,8 +75,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.renderer.webgl.tilelayershader.Vertex.SOURCE = ol.DEBUG_WEBGL ? - ol.renderer.webgl.tilelayershader.Vertex.DEBUG_SOURCE : - ol.renderer.webgl.tilelayershader.Vertex.OPTIMIZED_SOURCE; + ol.renderer.webgl.tilelayershader.Vertex.DEBUG_SOURCE : + ol.renderer.webgl.tilelayershader.Vertex.OPTIMIZED_SOURCE; ol.renderer.webgl.tilelayershader.vertex = new ol.renderer.webgl.tilelayershader.Vertex(); diff --git a/src/ol/reproj.js b/src/ol/reproj.js index 10da24c84d9..e59eb7b6733 100644 --- a/src/ol/reproj.js +++ b/src/ol/reproj.js @@ -93,7 +93,7 @@ ol.reproj.render = function(width, height, pixelRatio, triangulation, sources, gutter, opt_renderEdges) { var context = ol.dom.createCanvasContext2D(Math.round(pixelRatio * width), - Math.round(pixelRatio * height)); + Math.round(pixelRatio * height)); if (sources.length === 0) { return context.canvas; @@ -200,10 +200,10 @@ ol.reproj.render = function(width, height, pixelRatio, affineCoefs[0], affineCoefs[2], affineCoefs[1], affineCoefs[3], u0, v0); context.translate(sourceDataExtent[0] - sourceNumericalShiftX, - sourceDataExtent[3] - sourceNumericalShiftY); + sourceDataExtent[3] - sourceNumericalShiftY); context.scale(sourceResolution / pixelRatio, - -sourceResolution / pixelRatio); + -sourceResolution / pixelRatio); context.drawImage(stitchContext.canvas, 0, 0); context.restore(); diff --git a/src/ol/reproj/image.js b/src/ol/reproj/image.js index ccced98f5f8..20f51e1e933 100644 --- a/src/ol/reproj/image.js +++ b/src/ol/reproj/image.js @@ -42,7 +42,7 @@ ol.reproj.Image = function(sourceProj, targetProj, var maxTargetExtent = targetProj.getExtent(); var limitedTargetExtent = maxTargetExtent ? - ol.extent.getIntersection(targetExtent, maxTargetExtent) : targetExtent; + ol.extent.getIntersection(targetExtent, maxTargetExtent) : targetExtent; var targetCenter = ol.extent.getCenter(limitedTargetExtent); var sourceResolution = ol.reproj.calculateSourceResolution( @@ -108,7 +108,7 @@ ol.reproj.Image = function(sourceProj, targetProj, } ol.ImageBase.call(this, targetExtent, targetResolution, this.sourcePixelRatio_, - state, attributions); + state, attributions); }; ol.inherits(ol.reproj.Image, ol.ImageBase); diff --git a/src/ol/reproj/tile.js b/src/ol/reproj/tile.js index 95c77e85c05..a79055faa2e 100644 --- a/src/ol/reproj/tile.js +++ b/src/ol/reproj/tile.js @@ -103,7 +103,7 @@ ol.reproj.Tile = function(sourceProj, sourceTileGrid, var maxSourceExtent = this.sourceTileGrid_.getExtent(); var limitedTargetExtent = maxTargetExtent ? - ol.extent.getIntersection(targetExtent, maxTargetExtent) : targetExtent; + ol.extent.getIntersection(targetExtent, maxTargetExtent) : targetExtent; if (ol.extent.getArea(limitedTargetExtent) === 0) { // Tile is completely outside range -> EMPTY @@ -137,7 +137,7 @@ ol.reproj.Tile = function(sourceProj, sourceTileGrid, } var errorThresholdInPixels = opt_errorThreshold !== undefined ? - opt_errorThreshold : ol.DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD; + opt_errorThreshold : ol.DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD; /** * @private diff --git a/src/ol/reproj/triangulation.js b/src/ol/reproj/triangulation.js index fd057a31a47..e4ef2e33d19 100644 --- a/src/ol/reproj/triangulation.js +++ b/src/ol/reproj/triangulation.js @@ -90,14 +90,14 @@ ol.reproj.Triangulation = function(sourceProj, targetProj, targetExtent, * @private */ this.sourceWorldWidth_ = this.sourceProj_.getExtent() ? - ol.extent.getWidth(this.sourceProj_.getExtent()) : null; + ol.extent.getWidth(this.sourceProj_.getExtent()) : null; /** * @type {?number} * @private */ this.targetWorldWidth_ = this.targetProj_.getExtent() ? - ol.extent.getWidth(this.targetProj_.getExtent()) : null; + ol.extent.getWidth(this.targetProj_.getExtent()) : null; var destinationTopLeft = ol.extent.getTopLeft(targetExtent); var destinationTopRight = ol.extent.getTopRight(targetExtent); @@ -127,8 +127,8 @@ ol.reproj.Triangulation = function(sourceProj, targetProj, targetExtent, if (Math.max(triangle.source[0][0], triangle.source[1][0], triangle.source[2][0]) - leftBound > this.sourceWorldWidth_ / 2) { var newTriangle = [[triangle.source[0][0], triangle.source[0][1]], - [triangle.source[1][0], triangle.source[1][1]], - [triangle.source[2][0], triangle.source[2][1]]]; + [triangle.source[1][0], triangle.source[1][1]], + [triangle.source[2][0], triangle.source[2][1]]]; if ((newTriangle[0][0] - leftBound) > this.sourceWorldWidth_ / 2) { newTriangle[0][0] -= this.sourceWorldWidth_; } @@ -197,7 +197,7 @@ ol.reproj.Triangulation.prototype.addQuad_ = function(a, b, c, d, var sourceQuadExtent = ol.extent.boundingExtent([aSrc, bSrc, cSrc, dSrc]); var sourceCoverageX = this.sourceWorldWidth_ ? - ol.extent.getWidth(sourceQuadExtent) / this.sourceWorldWidth_ : null; + ol.extent.getWidth(sourceQuadExtent) / this.sourceWorldWidth_ : null; var sourceWorldWidth = /** @type {number} */ (this.sourceWorldWidth_); // when the quad is wrapped in the source projection diff --git a/src/ol/resolutionconstraint.js b/src/ol/resolutionconstraint.js index 023bd61da50..93fb97f7fe1 100644 --- a/src/ol/resolutionconstraint.js +++ b/src/ol/resolutionconstraint.js @@ -10,28 +10,28 @@ goog.require('ol.math'); */ ol.ResolutionConstraint.createSnapToResolutions = function(resolutions) { return ( - /** + /** * @param {number|undefined} resolution Resolution. * @param {number} delta Delta. * @param {number} direction Direction. * @return {number|undefined} Resolution. */ - function(resolution, delta, direction) { - if (resolution !== undefined) { - var z = + function(resolution, delta, direction) { + if (resolution !== undefined) { + var z = ol.array.linearFindNearest(resolutions, resolution, direction); - z = ol.math.clamp(z + delta, 0, resolutions.length - 1); - var index = Math.floor(z); - if (z != index && index < resolutions.length - 1) { - var power = resolutions[index] / resolutions[index + 1]; - return resolutions[index] / Math.pow(power, z - index); - } else { - return resolutions[index]; - } + z = ol.math.clamp(z + delta, 0, resolutions.length - 1); + var index = Math.floor(z); + if (z != index && index < resolutions.length - 1) { + var power = resolutions[index] / resolutions[index + 1]; + return resolutions[index] / Math.pow(power, z - index); } else { - return undefined; + return resolutions[index]; } - }); + } else { + return undefined; + } + }); }; @@ -43,24 +43,24 @@ ol.ResolutionConstraint.createSnapToResolutions = function(resolutions) { */ ol.ResolutionConstraint.createSnapToPower = function(power, maxResolution, opt_maxLevel) { return ( - /** + /** * @param {number|undefined} resolution Resolution. * @param {number} delta Delta. * @param {number} direction Direction. * @return {number|undefined} Resolution. */ - function(resolution, delta, direction) { - if (resolution !== undefined) { - var offset = -direction / 2 + 0.5; - var oldLevel = Math.floor( - Math.log(maxResolution / resolution) / Math.log(power) + offset); - var newLevel = Math.max(oldLevel + delta, 0); - if (opt_maxLevel !== undefined) { - newLevel = Math.min(newLevel, opt_maxLevel); - } - return maxResolution / Math.pow(power, newLevel); - } else { - return undefined; + function(resolution, delta, direction) { + if (resolution !== undefined) { + var offset = -direction / 2 + 0.5; + var oldLevel = Math.floor( + Math.log(maxResolution / resolution) / Math.log(power) + offset); + var newLevel = Math.max(oldLevel + delta, 0); + if (opt_maxLevel !== undefined) { + newLevel = Math.min(newLevel, opt_maxLevel); } - }); + return maxResolution / Math.pow(power, newLevel); + } else { + return undefined; + } + }); }; diff --git a/src/ol/rotationconstraint.js b/src/ol/rotationconstraint.js index 961b9346b5f..ccbd2e59725 100644 --- a/src/ol/rotationconstraint.js +++ b/src/ol/rotationconstraint.js @@ -38,19 +38,19 @@ ol.RotationConstraint.none = function(rotation, delta) { ol.RotationConstraint.createSnapToN = function(n) { var theta = 2 * Math.PI / n; return ( - /** + /** * @param {number|undefined} rotation Rotation. * @param {number} delta Delta. * @return {number|undefined} Rotation. */ - function(rotation, delta) { - if (rotation !== undefined) { - rotation = Math.floor((rotation + delta) / theta + 0.5) * theta; - return rotation; - } else { - return undefined; - } - }); + function(rotation, delta) { + if (rotation !== undefined) { + rotation = Math.floor((rotation + delta) / theta + 0.5) * theta; + return rotation; + } else { + return undefined; + } + }); }; @@ -61,20 +61,20 @@ ol.RotationConstraint.createSnapToN = function(n) { ol.RotationConstraint.createSnapToZero = function(opt_tolerance) { var tolerance = opt_tolerance || ol.math.toRadians(5); return ( - /** + /** * @param {number|undefined} rotation Rotation. * @param {number} delta Delta. * @return {number|undefined} Rotation. */ - function(rotation, delta) { - if (rotation !== undefined) { - if (Math.abs(rotation + delta) <= tolerance) { - return 0; - } else { - return rotation + delta; - } + function(rotation, delta) { + if (rotation !== undefined) { + if (Math.abs(rotation + delta) <= tolerance) { + return 0; } else { - return undefined; + return rotation + delta; } - }); + } else { + return undefined; + } + }); }; diff --git a/src/ol/source/bingmaps.js b/src/ol/source/bingmaps.js index f9394bcbe90..89c100ef800 100644 --- a/src/ol/source/bingmaps.js +++ b/src/ol/source/bingmaps.js @@ -136,7 +136,7 @@ ol.source.BingMaps.prototype.handleImageryMetadataResponse = function(response) var sourceProjection = this.getProjection(); var extent = ol.tilegrid.extentFromProjection(sourceProjection); var tileSize = resource.imageWidth == resource.imageHeight ? - resource.imageWidth : [resource.imageWidth, resource.imageHeight]; + resource.imageWidth : [resource.imageWidth, resource.imageHeight]; var tileGrid = ol.tilegrid.createXYZ({ extent: extent, minZoom: resource.zoomMin, @@ -154,26 +154,26 @@ ol.source.BingMaps.prototype.handleImageryMetadataResponse = function(response) .replace('{subdomain}', subdomain) .replace('{culture}', culture); return ( - /** + /** * @param {ol.TileCoord} tileCoord Tile coordinate. * @param {number} pixelRatio Pixel ratio. * @param {ol.proj.Projection} projection Projection. * @return {string|undefined} Tile URL. */ - function(tileCoord, pixelRatio, projection) { - if (!tileCoord) { - return undefined; - } else { - ol.tilecoord.createOrUpdate(tileCoord[0], tileCoord[1], - -tileCoord[2] - 1, quadKeyTileCoord); - var url = imageUrl; - if (hidpi) { - url += '&dpi=d1&device=mobile'; - } - return url.replace('{quadkey}', ol.tilecoord.quadKey( - quadKeyTileCoord)); + function(tileCoord, pixelRatio, projection) { + if (!tileCoord) { + return undefined; + } else { + ol.tilecoord.createOrUpdate(tileCoord[0], tileCoord[1], + -tileCoord[2] - 1, quadKeyTileCoord); + var url = imageUrl; + if (hidpi) { + url += '&dpi=d1&device=mobile'; } - }); + return url.replace('{quadkey}', ol.tilecoord.quadKey( + quadKeyTileCoord)); + } + }); })); if (resource.imageryProviders) { diff --git a/src/ol/source/image.js b/src/ol/source/image.js index 9e07a935ce3..cde69eb408f 100644 --- a/src/ol/source/image.js +++ b/src/ol/source/image.js @@ -36,7 +36,7 @@ ol.source.Image = function(options) { * @type {Array.} */ this.resolutions_ = options.resolutions !== undefined ? - options.resolutions : null; + options.resolutions : null; /** diff --git a/src/ol/source/imagearcgisrest.js b/src/ol/source/imagearcgisrest.js index b46ef2381e6..00839398fba 100644 --- a/src/ol/source/imagearcgisrest.js +++ b/src/ol/source/imagearcgisrest.js @@ -61,7 +61,7 @@ ol.source.ImageArcGISRest = function(opt_options) { * @type {ol.ImageLoadFunctionType} */ this.imageLoadFunction_ = options.imageLoadFunction !== undefined ? - options.imageLoadFunction : ol.source.Image.defaultImageLoadFunction; + options.imageLoadFunction : ol.source.Image.defaultImageLoadFunction; /** @@ -213,8 +213,8 @@ ol.source.ImageArcGISRest.prototype.getRequestUrl_ = function(extent, size, pixe var url = this.url_; var modifiedUrl = url - .replace(/MapServer\/?$/, 'MapServer/export') - .replace(/ImageServer\/?$/, 'ImageServer/exportImage'); + .replace(/MapServer\/?$/, 'MapServer/export') + .replace(/ImageServer\/?$/, 'ImageServer/exportImage'); if (modifiedUrl == url) { ol.asserts.assert(false, 50); // `options.featureTypes` should be an Array } diff --git a/src/ol/source/imagecanvas.js b/src/ol/source/imagecanvas.js index 218d667e15a..8dfe02c84a2 100644 --- a/src/ol/source/imagecanvas.js +++ b/src/ol/source/imagecanvas.js @@ -48,7 +48,7 @@ ol.source.ImageCanvas = function(options) { * @type {number} */ this.ratio_ = options.ratio !== undefined ? - options.ratio : 1.5; + options.ratio : 1.5; }; ol.inherits(ol.source.ImageCanvas, ol.source.Image); diff --git a/src/ol/source/imagemapguide.js b/src/ol/source/imagemapguide.js index b17afec4067..d66bb3eec90 100644 --- a/src/ol/source/imagemapguide.js +++ b/src/ol/source/imagemapguide.js @@ -39,7 +39,7 @@ ol.source.ImageMapGuide = function(options) { * @type {number} */ this.displayDpi_ = options.displayDpi !== undefined ? - options.displayDpi : 96; + options.displayDpi : 96; /** * @private @@ -58,7 +58,7 @@ ol.source.ImageMapGuide = function(options) { * @type {ol.ImageLoadFunctionType} */ this.imageLoadFunction_ = options.imageLoadFunction !== undefined ? - options.imageLoadFunction : ol.source.Image.defaultImageLoadFunction; + options.imageLoadFunction : ol.source.Image.defaultImageLoadFunction; /** * @private @@ -71,7 +71,7 @@ ol.source.ImageMapGuide = function(options) { * @type {number} */ this.metersPerUnit_ = options.metersPerUnit !== undefined ? - options.metersPerUnit : 1; + options.metersPerUnit : 1; /** * @private @@ -84,7 +84,7 @@ ol.source.ImageMapGuide = function(options) { * @type {boolean} */ this.useOverlay_ = options.useOverlay !== undefined ? - options.useOverlay : false; + options.useOverlay : false; /** * @private diff --git a/src/ol/source/imagestatic.js b/src/ol/source/imagestatic.js index 87dac70ea1f..4c7c0632999 100644 --- a/src/ol/source/imagestatic.js +++ b/src/ol/source/imagestatic.js @@ -24,11 +24,11 @@ ol.source.ImageStatic = function(options) { var imageExtent = options.imageExtent; var crossOrigin = options.crossOrigin !== undefined ? - options.crossOrigin : null; + options.crossOrigin : null; var /** @type {ol.ImageLoadFunctionType} */ imageLoadFunction = options.imageLoadFunction !== undefined ? - options.imageLoadFunction : ol.source.Image.defaultImageLoadFunction; + options.imageLoadFunction : ol.source.Image.defaultImageLoadFunction; ol.source.Image.call(this, { attributions: options.attributions, diff --git a/src/ol/source/imagevector.js b/src/ol/source/imagevector.js index 5f51d7c132d..cad4e7e4a75 100644 --- a/src/ol/source/imagevector.js +++ b/src/ol/source/imagevector.js @@ -297,6 +297,6 @@ ol.source.ImageVector.prototype.renderFeature_ = function(feature, resolution, p ol.source.ImageVector.prototype.setStyle = function(style) { this.style_ = style !== undefined ? style : ol.style.Style.defaultFunction; this.styleFunction_ = !style ? - undefined : ol.style.Style.createFunction(this.style_); + undefined : ol.style.Style.createFunction(this.style_); this.changed(); }; diff --git a/src/ol/source/imagewms.js b/src/ol/source/imagewms.js index 69c5df0825d..0fd3fbc5eef 100644 --- a/src/ol/source/imagewms.js +++ b/src/ol/source/imagewms.js @@ -55,7 +55,7 @@ ol.source.ImageWMS = function(opt_options) { * @type {ol.ImageLoadFunctionType} */ this.imageLoadFunction_ = options.imageLoadFunction !== undefined ? - options.imageLoadFunction : ol.source.Image.defaultImageLoadFunction; + options.imageLoadFunction : ol.source.Image.defaultImageLoadFunction; /** * @private diff --git a/src/ol/source/osm.js b/src/ol/source/osm.js index e0eb59f0ac9..11eebc5df66 100644 --- a/src/ol/source/osm.js +++ b/src/ol/source/osm.js @@ -26,10 +26,10 @@ ol.source.OSM = function(opt_options) { } var crossOrigin = options.crossOrigin !== undefined ? - options.crossOrigin : 'anonymous'; + options.crossOrigin : 'anonymous'; var url = options.url !== undefined ? - options.url : 'https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png'; + options.url : 'https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png'; ol.source.XYZ.call(this, { attributions: attributions, diff --git a/src/ol/source/raster.js b/src/ol/source/raster.js index bacf4fee27a..dcf82ef6ec0 100644 --- a/src/ol/source/raster.js +++ b/src/ol/source/raster.js @@ -46,7 +46,7 @@ ol.source.Raster = function(options) { * @type {ol.source.RasterOperationType} */ this.operationType_ = options.operationType !== undefined ? - options.operationType : ol.source.RasterOperationType.PIXEL; + options.operationType : ol.source.RasterOperationType.PIXEL; /** * @private @@ -170,10 +170,10 @@ ol.source.Raster.prototype.setOperation = function(operation, opt_lib) { ol.source.Raster.prototype.updateFrameState_ = function(extent, resolution, projection) { var frameState = /** @type {olx.FrameState} */ ( - ol.obj.assign({}, this.frameState_)); + ol.obj.assign({}, this.frameState_)); frameState.viewState = /** @type {olx.ViewState} */ ( - ol.obj.assign({}, frameState.viewState)); + ol.obj.assign({}, frameState.viewState)); var center = ol.extent.getCenter(extent); diff --git a/src/ol/source/source.js b/src/ol/source/source.js index fdd3ada9c70..82b1c98447c 100644 --- a/src/ol/source/source.js +++ b/src/ol/source/source.js @@ -48,7 +48,7 @@ ol.source.Source = function(options) { * @type {ol.source.State} */ this.state_ = options.state !== undefined ? - options.state : ol.source.State.READY; + options.state : ol.source.State.READY; /** * @private diff --git a/src/ol/source/stamen.js b/src/ol/source/stamen.js index 454580a5f80..098d4414857 100644 --- a/src/ol/source/stamen.js +++ b/src/ol/source/stamen.js @@ -23,7 +23,7 @@ ol.source.Stamen = function(options) { var layerConfig = ol.source.Stamen.LayerConfig[options.layer]; var url = options.url !== undefined ? options.url : - 'https://stamen-tiles-{a-d}.a.ssl.fastly.net/' + options.layer + + 'https://stamen-tiles-{a-d}.a.ssl.fastly.net/' + options.layer + '/{z}/{x}/{y}.' + layerConfig.extension; ol.source.XYZ.call(this, { diff --git a/src/ol/source/tile.js b/src/ol/source/tile.js index bc93e256f08..e4f37bc2b65 100644 --- a/src/ol/source/tile.js +++ b/src/ol/source/tile.js @@ -45,7 +45,7 @@ ol.source.Tile = function(options) { * @type {number} */ this.tilePixelRatio_ = options.tilePixelRatio !== undefined ? - options.tilePixelRatio : 1; + options.tilePixelRatio : 1; /** * @protected @@ -283,7 +283,7 @@ ol.source.Tile.prototype.getTilePixelSize = function(z, pixelRatio, projection) */ ol.source.Tile.prototype.getTileCoordForTileUrlFunction = function(tileCoord, opt_projection) { var projection = opt_projection !== undefined ? - opt_projection : this.getProjection(); + opt_projection : this.getProjection(); var tileGrid = this.getTileGridForProjection(projection); if (this.getWrapX() && projection.isGlobal()) { tileCoord = ol.tilegrid.wrapX(tileGrid, tileCoord, projection); diff --git a/src/ol/source/tilearcgisrest.js b/src/ol/source/tilearcgisrest.js index 0f304846889..a78e0e027ad 100644 --- a/src/ol/source/tilearcgisrest.js +++ b/src/ol/source/tilearcgisrest.js @@ -95,7 +95,7 @@ ol.source.TileArcGISRest.prototype.getParams = function() { * @private */ ol.source.TileArcGISRest.prototype.getRequestUrl_ = function(tileCoord, tileSize, tileExtent, - pixelRatio, projection, params) { + pixelRatio, projection, params) { var urls = this.urls; if (!urls) { @@ -111,7 +111,7 @@ ol.source.TileArcGISRest.prototype.getRequestUrl_ = function(tileCoord, tileSize params['IMAGESR'] = srid; params['DPI'] = Math.round( params['DPI'] ? params['DPI'] * pixelRatio : 90 * pixelRatio - ); + ); var url; if (urls.length == 1) { diff --git a/src/ol/source/tiledebug.js b/src/ol/source/tiledebug.js index 4325f161244..76772fd62b0 100644 --- a/src/ol/source/tiledebug.js +++ b/src/ol/source/tiledebug.js @@ -46,7 +46,7 @@ ol.source.TileDebug.prototype.getTile = function(z, x, y) { var tileCoord = [z, x, y]; var textTileCoord = this.getTileCoordForTileUrlFunction(tileCoord); var text = !textTileCoord ? '' : - this.getTileCoordForTileUrlFunction(textTileCoord).toString(); + this.getTileCoordForTileUrlFunction(textTileCoord).toString(); var tile = new ol.source.TileDebug.Tile_(tileCoord, tileSize, text); this.tileCache.set(tileCoordKey, tile); return tile; diff --git a/src/ol/source/tileimage.js b/src/ol/source/tileimage.js index 20a80a6af03..bc5aced5ba4 100644 --- a/src/ol/source/tileimage.js +++ b/src/ol/source/tileimage.js @@ -34,7 +34,7 @@ ol.source.TileImage = function(options) { state: options.state, tileGrid: options.tileGrid, tileLoadFunction: options.tileLoadFunction ? - options.tileLoadFunction : ol.source.TileImage.defaultTileLoadFunction, + options.tileLoadFunction : ol.source.TileImage.defaultTileLoadFunction, tilePixelRatio: options.tilePixelRatio, tileUrlFunction: options.tileUrlFunction, url: options.url, @@ -55,7 +55,7 @@ ol.source.TileImage = function(options) { * ?string, ol.TileLoadFunctionType)} */ this.tileClass = options.tileClass !== undefined ? - options.tileClass : ol.ImageTile; + options.tileClass : ol.ImageTile; /** * @protected @@ -216,7 +216,7 @@ ol.source.TileImage.prototype.createTile_ = function(z, x, y, pixelRatio, projec var urlTileCoord = this.getTileCoordForTileUrlFunction( tileCoord, projection); var tileUrl = urlTileCoord ? - this.tileUrlFunction(urlTileCoord, pixelRatio, projection) : undefined; + this.tileUrlFunction(urlTileCoord, pixelRatio, projection) : undefined; var tile = new this.tileClass( tileCoord, tileUrl !== undefined ? ol.TileState.IDLE : ol.TileState.EMPTY, diff --git a/src/ol/source/tilejson.js b/src/ol/source/tilejson.js index d8d5ab67808..48e9db0fade 100644 --- a/src/ol/source/tilejson.js +++ b/src/ol/source/tilejson.js @@ -137,7 +137,7 @@ ol.source.TileJSON.prototype.handleTileJSONResponse = function(tileJSON) { if (tileJSON.attribution !== undefined && !this.getAttributions()) { var attributionExtent = extent !== undefined ? - extent : epsg4326Projection.getExtent(); + extent : epsg4326Projection.getExtent(); /** @type {Object.>} */ var tileRanges = {}; var z, zKey; diff --git a/src/ol/source/tileutfgrid.js b/src/ol/source/tileutfgrid.js index 70d469e04dc..023fffe8437 100644 --- a/src/ol/source/tileutfgrid.js +++ b/src/ol/source/tileutfgrid.js @@ -36,7 +36,7 @@ ol.source.TileUTFGrid = function(options) { * @type {boolean} */ this.preemptive_ = options.preemptive !== undefined ? - options.preemptive : true; + options.preemptive : true; /** * @private @@ -197,7 +197,7 @@ ol.source.TileUTFGrid.prototype.handleTileJSONResponse = function(tileJSON) { if (tileJSON.attribution !== undefined) { var attributionExtent = extent !== undefined ? - extent : epsg4326Projection.getExtent(); + extent : epsg4326Projection.getExtent(); /** @type {Object.>} */ var tileRanges = {}; var z, zKey; diff --git a/src/ol/source/tilewms.js b/src/ol/source/tilewms.js index 90cb1c01301..8d70b67e953 100644 --- a/src/ol/source/tilewms.js +++ b/src/ol/source/tilewms.js @@ -200,7 +200,7 @@ ol.source.TileWMS.prototype.getParams = function() { * @private */ ol.source.TileWMS.prototype.getRequestUrl_ = function(tileCoord, tileSize, tileExtent, - pixelRatio, projection, params) { + pixelRatio, projection, params) { var urls = this.urls; if (!urls) { @@ -268,7 +268,7 @@ ol.source.TileWMS.prototype.getRequestUrl_ = function(tileCoord, tileSize, tileE */ ol.source.TileWMS.prototype.getTilePixelRatio = function(pixelRatio) { return (!this.hidpi_ || this.serverType_ === undefined) ? 1 : - /** @type {number} */ (pixelRatio); + /** @type {number} */ (pixelRatio); }; diff --git a/src/ol/source/urltile.js b/src/ol/source/urltile.js index a8530d0d950..bb1d73c7aab 100644 --- a/src/ol/source/urltile.js +++ b/src/ol/source/urltile.js @@ -43,8 +43,8 @@ ol.source.UrlTile = function(options) { * @type {ol.TileUrlFunctionType} */ this.tileUrlFunction = this.fixedTileUrlFunction ? - this.fixedTileUrlFunction.bind(this) : - ol.TileUrlFunction.nullTileUrlFunction; + this.fixedTileUrlFunction.bind(this) : + ol.TileUrlFunction.nullTileUrlFunction; /** * @protected @@ -165,8 +165,8 @@ ol.source.UrlTile.prototype.setTileUrlFunction = function(tileUrlFunction, opt_k ol.source.UrlTile.prototype.setUrl = function(url) { var urls = this.urls = ol.TileUrlFunction.expandUrl(url); this.setTileUrlFunction(this.fixedTileUrlFunction ? - this.fixedTileUrlFunction.bind(this) : - ol.TileUrlFunction.createFromTemplates(urls, this.tileGrid), url); + this.fixedTileUrlFunction.bind(this) : + ol.TileUrlFunction.createFromTemplates(urls, this.tileGrid), url); }; @@ -179,8 +179,8 @@ ol.source.UrlTile.prototype.setUrls = function(urls) { this.urls = urls; var key = urls.join('\n'); this.setTileUrlFunction(this.fixedTileUrlFunction ? - this.fixedTileUrlFunction.bind(this) : - ol.TileUrlFunction.createFromTemplates(urls, this.tileGrid), key); + this.fixedTileUrlFunction.bind(this) : + ol.TileUrlFunction.createFromTemplates(urls, this.tileGrid), key); }; diff --git a/src/ol/source/vector.js b/src/ol/source/vector.js index 7706fa56fdb..a836dc7589a 100644 --- a/src/ol/source/vector.js +++ b/src/ol/source/vector.js @@ -84,7 +84,7 @@ ol.source.Vector = function(opt_options) { * @type {ol.LoadingStrategy} */ this.strategy_ = options.strategy !== undefined ? options.strategy : - ol.loadingstrategy.all; + ol.loadingstrategy.all; var useSpatialIndex = options.useSpatialIndex !== undefined ? options.useSpatialIndex : true; diff --git a/src/ol/source/vectortile.js b/src/ol/source/vectortile.js index 9b448c8771e..03f2b0da76d 100644 --- a/src/ol/source/vectortile.js +++ b/src/ol/source/vectortile.js @@ -38,7 +38,7 @@ ol.source.VectorTile = function(options) { state: options.state, tileGrid: options.tileGrid, tileLoadFunction: options.tileLoadFunction ? - options.tileLoadFunction : ol.VectorImageTile.defaultLoadFunction, + options.tileLoadFunction : ol.VectorImageTile.defaultLoadFunction, tileUrlFunction: options.tileUrlFunction, tilePixelRatio: options.tilePixelRatio, url: options.url, @@ -105,7 +105,7 @@ ol.source.VectorTile.prototype.getTile = function(z, x, y, pixelRatio, projectio var urlTileCoord = this.getTileCoordForTileUrlFunction( tileCoord, projection); var tileUrl = urlTileCoord ? - this.tileUrlFunction(urlTileCoord, pixelRatio, projection) : undefined; + this.tileUrlFunction(urlTileCoord, pixelRatio, projection) : undefined; var tile = new ol.VectorImageTile( tileCoord, tileUrl !== undefined ? ol.TileState.IDLE : ol.TileState.EMPTY, @@ -143,8 +143,8 @@ ol.source.VectorTile.prototype.getTileGridForProjection = function(projection) { */ ol.source.VectorTile.prototype.getTilePixelRatio = function(opt_pixelRatio) { return opt_pixelRatio == undefined ? - ol.source.UrlTile.prototype.getTilePixelRatio.call(this, opt_pixelRatio) : - opt_pixelRatio; + ol.source.UrlTile.prototype.getTilePixelRatio.call(this, opt_pixelRatio) : + opt_pixelRatio; }; diff --git a/src/ol/source/wmts.js b/src/ol/source/wmts.js index c5ce6088502..a4ebe9f0dc5 100644 --- a/src/ol/source/wmts.js +++ b/src/ol/source/wmts.js @@ -74,8 +74,8 @@ ol.source.WMTS = function(options) { * @type {ol.source.WMTSRequestEncoding} */ this.requestEncoding_ = options.requestEncoding !== undefined ? - /** @type {ol.source.WMTSRequestEncoding} */ (options.requestEncoding) : - ol.source.WMTSRequestEncoding.KVP; + /** @type {ol.source.WMTSRequestEncoding} */ (options.requestEncoding) : + ol.source.WMTSRequestEncoding.KVP; var requestEncoding = this.requestEncoding_; @@ -113,45 +113,45 @@ ol.source.WMTS = function(options) { // special template params template = (requestEncoding == ol.source.WMTSRequestEncoding.KVP) ? - ol.uri.appendParams(template, context) : - template.replace(/\{(\w+?)\}/g, function(m, p) { - return (p.toLowerCase() in context) ? context[p.toLowerCase()] : m; - }); + ol.uri.appendParams(template, context) : + template.replace(/\{(\w+?)\}/g, function(m, p) { + return (p.toLowerCase() in context) ? context[p.toLowerCase()] : m; + }); return ( - /** + /** * @param {ol.TileCoord} tileCoord Tile coordinate. * @param {number} pixelRatio Pixel ratio. * @param {ol.proj.Projection} projection Projection. * @return {string|undefined} Tile URL. */ - function(tileCoord, pixelRatio, projection) { - if (!tileCoord) { - return undefined; + function(tileCoord, pixelRatio, projection) { + if (!tileCoord) { + return undefined; + } else { + var localContext = { + 'TileMatrix': tileGrid.getMatrixId(tileCoord[0]), + 'TileCol': tileCoord[1], + 'TileRow': -tileCoord[2] - 1 + }; + ol.obj.assign(localContext, dimensions); + var url = template; + if (requestEncoding == ol.source.WMTSRequestEncoding.KVP) { + url = ol.uri.appendParams(url, localContext); } else { - var localContext = { - 'TileMatrix': tileGrid.getMatrixId(tileCoord[0]), - 'TileCol': tileCoord[1], - 'TileRow': -tileCoord[2] - 1 - }; - ol.obj.assign(localContext, dimensions); - var url = template; - if (requestEncoding == ol.source.WMTSRequestEncoding.KVP) { - url = ol.uri.appendParams(url, localContext); - } else { - url = url.replace(/\{(\w+?)\}/g, function(m, p) { - return localContext[p]; - }); - } - return url; + url = url.replace(/\{(\w+?)\}/g, function(m, p) { + return localContext[p]; + }); } - }); + return url; + } + }); } var tileUrlFunction = (urls && urls.length > 0) ? - ol.TileUrlFunction.createFromTileUrlFunctions( - urls.map(createFromWMTSTemplate)) : - ol.TileUrlFunction.nullTileUrlFunction; + ol.TileUrlFunction.createFromTileUrlFunctions( + urls.map(createFromWMTSTemplate)) : + ol.TileUrlFunction.nullTileUrlFunction; ol.source.TileImage.call(this, { attributions: options.attributions, @@ -335,9 +335,9 @@ ol.source.WMTS.optionsFromCapabilities = function(wmtsCap, config) { idx = 0; } matrixSet = /** @type {string} */ - (l['TileMatrixSetLink'][idx]['TileMatrixSet']); + (l['TileMatrixSetLink'][idx]['TileMatrixSet']); matrixLimits = /** @type {Array.} */ - (l['TileMatrixSetLink'][idx]['TileMatrixSetLimits']); + (l['TileMatrixSetLink'][idx]['TileMatrixSetLimits']); var format = /** @type {string} */ (l['Format'][0]); if ('format' in config) { diff --git a/src/ol/source/xyz.js b/src/ol/source/xyz.js index 957bf1070aa..6beb9eae70c 100644 --- a/src/ol/source/xyz.js +++ b/src/ol/source/xyz.js @@ -30,15 +30,15 @@ goog.require('ol.tilegrid'); ol.source.XYZ = function(opt_options) { var options = opt_options || {}; var projection = options.projection !== undefined ? - options.projection : 'EPSG:3857'; + options.projection : 'EPSG:3857'; var tileGrid = options.tileGrid !== undefined ? options.tileGrid : - ol.tilegrid.createXYZ({ - extent: ol.tilegrid.extentFromProjection(projection), - maxZoom: options.maxZoom, - minZoom: options.minZoom, - tileSize: options.tileSize - }); + ol.tilegrid.createXYZ({ + extent: ol.tilegrid.extentFromProjection(projection), + maxZoom: options.maxZoom, + minZoom: options.minZoom, + tileSize: options.tileSize + }); ol.source.TileImage.call(this, { attributions: options.attributions, diff --git a/src/ol/source/zoomify.js b/src/ol/source/zoomify.js index adfe25be8b2..ba448efffca 100644 --- a/src/ol/source/zoomify.js +++ b/src/ol/source/zoomify.js @@ -26,8 +26,8 @@ ol.source.Zoomify = function(opt_options) { var size = options.size; var tierSizeCalculation = options.tierSizeCalculation !== undefined ? - options.tierSizeCalculation : - ol.source.Zoomify.TierSizeCalculation_.DEFAULT; + options.tierSizeCalculation : + ol.source.Zoomify.TierSizeCalculation_.DEFAULT; var imageWidth = size[0]; var imageHeight = size[1]; diff --git a/src/ol/structs/priorityqueue.js b/src/ol/structs/priorityqueue.js index 07b3225e6bf..e6426f31165 100644 --- a/src/ol/structs/priorityqueue.js +++ b/src/ol/structs/priorityqueue.js @@ -210,7 +210,7 @@ ol.structs.PriorityQueue.prototype.siftUp_ = function(index) { var smallerChildIndex = rIndex < count && priorities[rIndex] < priorities[lIndex] ? - rIndex : lIndex; + rIndex : lIndex; elements[index] = elements[smallerChildIndex]; priorities[index] = priorities[smallerChildIndex]; diff --git a/src/ol/style/atlasmanager.js b/src/ol/style/atlasmanager.js index 0965e10da1d..597146e10e0 100644 --- a/src/ol/style/atlasmanager.js +++ b/src/ol/style/atlasmanager.js @@ -31,7 +31,7 @@ ol.style.AtlasManager = function(opt_options) { * @type {number} */ this.currentSize_ = options.initialSize !== undefined ? - options.initialSize : ol.INITIAL_ATLAS_SIZE; + options.initialSize : ol.INITIAL_ATLAS_SIZE; /** * The maximum size in pixels of atlas images. @@ -39,9 +39,9 @@ ol.style.AtlasManager = function(opt_options) { * @type {number} */ this.maxSize_ = options.maxSize !== undefined ? - options.maxSize : ol.MAX_ATLAS_SIZE != -1 ? - ol.MAX_ATLAS_SIZE : ol.WEBGL_MAX_TEXTURE_SIZE !== undefined ? - ol.WEBGL_MAX_TEXTURE_SIZE : 2048; + options.maxSize : ol.MAX_ATLAS_SIZE != -1 ? + ol.MAX_ATLAS_SIZE : ol.WEBGL_MAX_TEXTURE_SIZE !== undefined ? + ol.WEBGL_MAX_TEXTURE_SIZE : 2048; /** * The size in pixels between images. @@ -150,7 +150,7 @@ ol.style.AtlasManager.prototype.mergeInfos_ = function(info, hitInfo) { * entry, or `null` if the image is too big. */ ol.style.AtlasManager.prototype.add = function(id, width, height, - renderCallback, opt_renderHitCallback, opt_this) { + renderCallback, opt_renderHitCallback, opt_this) { if (width + this.space_ > this.maxSize_ || height + this.space_ > this.maxSize_) { return null; @@ -167,7 +167,7 @@ ol.style.AtlasManager.prototype.add = function(id, width, height, // the hit-detection atlas, to make sure that the offset is the same for // the original image and the hit-detection image. var renderHitCallback = opt_renderHitCallback !== undefined ? - opt_renderHitCallback : ol.nullFunction; + opt_renderHitCallback : ol.nullFunction; var hitInfo = /** @type {ol.AtlasInfo} */ (this.add_(true, id, width, height, renderHitCallback, opt_this)); @@ -190,7 +190,7 @@ ol.style.AtlasManager.prototype.add = function(id, width, height, * or `null` if the image is too big. */ ol.style.AtlasManager.prototype.add_ = function(isHitAtlas, id, width, height, - renderCallback, opt_this) { + renderCallback, opt_this) { var atlases = (isHitAtlas) ? this.hitAtlases_ : this.atlases_; var atlas, info, i, ii; for (i = 0, ii = atlases.length; i < ii; ++i) { diff --git a/src/ol/style/fill.js b/src/ol/style/fill.js index 44e948d8977..924ef732643 100644 --- a/src/ol/style/fill.js +++ b/src/ol/style/fill.js @@ -71,13 +71,13 @@ ol.style.Fill.prototype.setColor = function(color) { ol.style.Fill.prototype.getChecksum = function() { if (this.checksum_ === undefined) { if ( - this.color_ instanceof CanvasPattern || + this.color_ instanceof CanvasPattern || this.color_ instanceof CanvasGradient ) { this.checksum_ = ol.getUid(this.color_).toString(); } else { this.checksum_ = 'f' + (this.color_ ? - ol.color.asString(this.color_) : '-'); + ol.color.asString(this.color_) : '-'); } } diff --git a/src/ol/style/icon.js b/src/ol/style/icon.js index 8a6a8239409..8e34b284218 100644 --- a/src/ol/style/icon.js +++ b/src/ol/style/icon.js @@ -42,21 +42,21 @@ ol.style.Icon = function(opt_options) { * @type {ol.style.IconOrigin} */ this.anchorOrigin_ = options.anchorOrigin !== undefined ? - options.anchorOrigin : ol.style.IconOrigin.TOP_LEFT; + options.anchorOrigin : ol.style.IconOrigin.TOP_LEFT; /** * @private * @type {ol.style.IconAnchorUnits} */ this.anchorXUnits_ = options.anchorXUnits !== undefined ? - options.anchorXUnits : ol.style.IconAnchorUnits.FRACTION; + options.anchorXUnits : ol.style.IconAnchorUnits.FRACTION; /** * @private * @type {ol.style.IconAnchorUnits} */ this.anchorYUnits_ = options.anchorYUnits !== undefined ? - options.anchorYUnits : ol.style.IconAnchorUnits.FRACTION; + options.anchorYUnits : ol.style.IconAnchorUnits.FRACTION; /** * @private @@ -95,14 +95,14 @@ ol.style.Icon = function(opt_options) { * @type {ol.ImageState} */ var imageState = options.src !== undefined ? - ol.ImageState.IDLE : ol.ImageState.LOADED; + ol.ImageState.IDLE : ol.ImageState.LOADED; /** * @private * @type {ol.Color} */ this.color_ = options.color !== undefined ? ol.color.asArray(options.color) : - null; + null; /** * @private @@ -122,7 +122,7 @@ ol.style.Icon = function(opt_options) { * @type {ol.style.IconOrigin} */ this.offsetOrigin_ = options.offsetOrigin !== undefined ? - options.offsetOrigin : ol.style.IconOrigin.TOP_LEFT; + options.offsetOrigin : ol.style.IconOrigin.TOP_LEFT; /** * @private @@ -145,7 +145,7 @@ ol.style.Icon = function(opt_options) { * @type {boolean} */ var rotateWithView = options.rotateWithView !== undefined ? - options.rotateWithView : false; + options.rotateWithView : false; /** * @type {number} @@ -161,7 +161,7 @@ ol.style.Icon = function(opt_options) { * @type {boolean} */ var snapToPixel = options.snapToPixel !== undefined ? - options.snapToPixel : true; + options.snapToPixel : true; ol.style.Image.call(this, { opacity: opacity, diff --git a/src/ol/style/iconimage.js b/src/ol/style/iconimage.js index 96e4ab4a0bb..61a79036314 100644 --- a/src/ol/style/iconimage.js +++ b/src/ol/style/iconimage.js @@ -20,7 +20,7 @@ goog.require('ol.style'); * @extends {ol.events.EventTarget} */ ol.style.IconImage = function(image, src, size, crossOrigin, imageState, - color) { + color) { ol.events.EventTarget.call(this); @@ -45,8 +45,8 @@ ol.style.IconImage = function(image, src, size, crossOrigin, imageState, * @type {HTMLCanvasElement} */ this.canvas_ = color ? - /** @type {HTMLCanvasElement} */ (document.createElement('CANVAS')) : - null; + /** @type {HTMLCanvasElement} */ (document.createElement('CANVAS')) : + null; /** * @private @@ -101,7 +101,7 @@ ol.inherits(ol.style.IconImage, ol.events.EventTarget); * @return {ol.style.IconImage} Icon image. */ ol.style.IconImage.get = function(image, src, size, crossOrigin, imageState, - color) { + color) { var iconImageCache = ol.style.iconImageCache; var iconImage = iconImageCache.get(src, crossOrigin, color); if (!iconImage) { diff --git a/src/ol/style/regularshape.js b/src/ol/style/regularshape.js index e82ed184867..4a992a4daaf 100644 --- a/src/ol/style/regularshape.js +++ b/src/ol/style/regularshape.js @@ -62,7 +62,7 @@ ol.style.RegularShape = function(options) { * @type {number} */ this.radius_ = /** @type {number} */ (options.radius !== undefined ? - options.radius : options.radius1); + options.radius : options.radius1); /** * @private @@ -118,13 +118,13 @@ ol.style.RegularShape = function(options) { * @type {boolean} */ var snapToPixel = options.snapToPixel !== undefined ? - options.snapToPixel : true; + options.snapToPixel : true; /** * @type {boolean} */ var rotateWithView = options.rotateWithView !== undefined ? - options.rotateWithView : false; + options.rotateWithView : false; ol.style.Image.call(this, { opacity: 1, @@ -442,7 +442,7 @@ ol.style.RegularShape.prototype.draw_ = function(renderOptions, context, x, y) { angle0 = i * 2 * Math.PI / points - Math.PI / 2 + this.angle_; radiusC = i % 2 === 0 ? this.radius_ : radius2; context.lineTo(renderOptions.size / 2 + radiusC * Math.cos(angle0), - renderOptions.size / 2 + radiusC * Math.sin(angle0)); + renderOptions.size / 2 + radiusC * Math.sin(angle0)); } } @@ -522,7 +522,7 @@ ol.style.RegularShape.prototype.drawHitDetectionCanvas_ = function(renderOptions angle0 = i * 2 * Math.PI / points - Math.PI / 2 + this.angle_; radiusC = i % 2 === 0 ? this.radius_ : radius2; context.lineTo(renderOptions.size / 2 + radiusC * Math.cos(angle0), - renderOptions.size / 2 + radiusC * Math.sin(angle0)); + renderOptions.size / 2 + radiusC * Math.sin(angle0)); } } @@ -545,9 +545,9 @@ ol.style.RegularShape.prototype.drawHitDetectionCanvas_ = function(renderOptions */ ol.style.RegularShape.prototype.getChecksum = function() { var strokeChecksum = this.stroke_ ? - this.stroke_.getChecksum() : '-'; + this.stroke_.getChecksum() : '-'; var fillChecksum = this.fill_ ? - this.fill_.getChecksum() : '-'; + this.fill_.getChecksum() : '-'; var recalculate = !this.checksums_ || (strokeChecksum != this.checksums_[1] || diff --git a/src/ol/style/stroke.js b/src/ol/style/stroke.js index 1649913a4ab..73b3645dd99 100644 --- a/src/ol/style/stroke.js +++ b/src/ol/style/stroke.js @@ -264,17 +264,17 @@ ol.style.Stroke.prototype.getChecksum = function() { } this.checksum_ += ',' + (this.lineCap_ !== undefined ? - this.lineCap_.toString() : '-') + ',' + + this.lineCap_.toString() : '-') + ',' + (this.lineDash_ ? - this.lineDash_.toString() : '-') + ',' + + this.lineDash_.toString() : '-') + ',' + (this.lineDashOffset_ !== undefined ? - this.lineDashOffset_ : '-') + ',' + + this.lineDashOffset_ : '-') + ',' + (this.lineJoin_ !== undefined ? - this.lineJoin_ : '-') + ',' + + this.lineJoin_ : '-') + ',' + (this.miterLimit_ !== undefined ? - this.miterLimit_.toString() : '-') + ',' + + this.miterLimit_.toString() : '-') + ',' + (this.width_ !== undefined ? - this.width_.toString() : '-'); + this.width_.toString() : '-'); } return this.checksum_; diff --git a/src/ol/style/text.js b/src/ol/style/text.js index b6af84c8480..c4ba6327f34 100644 --- a/src/ol/style/text.js +++ b/src/ol/style/text.js @@ -63,7 +63,7 @@ ol.style.Text = function(opt_options) { * @type {ol.style.Fill} */ this.fill_ = options.fill !== undefined ? options.fill : - new ol.style.Fill({color: ol.style.Text.DEFAULT_FILL_COLOR_}); + new ol.style.Fill({color: ol.style.Text.DEFAULT_FILL_COLOR_}); /** * @private diff --git a/src/ol/tilegrid.js b/src/ol/tilegrid.js index 92cc8966b6d..fe5aa7397d4 100644 --- a/src/ol/tilegrid.js +++ b/src/ol/tilegrid.js @@ -57,7 +57,7 @@ ol.tilegrid.wrapX = function(tileGrid, tileCoord, projection) { */ ol.tilegrid.createForExtent = function(extent, opt_maxZoom, opt_tileSize, opt_corner) { var corner = opt_corner !== undefined ? - opt_corner : ol.extent.Corner.TOP_LEFT; + opt_corner : ol.extent.Corner.TOP_LEFT; var resolutions = ol.tilegrid.resolutionsFromExtent( extent, opt_maxZoom, opt_tileSize); @@ -80,7 +80,7 @@ ol.tilegrid.createForExtent = function(extent, opt_maxZoom, opt_tileSize, opt_co ol.tilegrid.createXYZ = function(opt_options) { var options = /** @type {olx.tilegrid.TileGridOptions} */ ({}); ol.obj.assign(options, opt_options !== undefined ? - opt_options : /** @type {olx.tilegrid.XYZOptions} */ ({})); + opt_options : /** @type {olx.tilegrid.XYZOptions} */ ({})); if (options.extent === undefined) { options.extent = ol.proj.get('EPSG:3857').getExtent(); } @@ -103,13 +103,13 @@ ol.tilegrid.createXYZ = function(opt_options) { */ ol.tilegrid.resolutionsFromExtent = function(extent, opt_maxZoom, opt_tileSize) { var maxZoom = opt_maxZoom !== undefined ? - opt_maxZoom : ol.DEFAULT_MAX_ZOOM; + opt_maxZoom : ol.DEFAULT_MAX_ZOOM; var height = ol.extent.getHeight(extent); var width = ol.extent.getWidth(extent); var tileSize = ol.size.toSize(opt_tileSize !== undefined ? - opt_tileSize : ol.DEFAULT_TILE_SIZE); + opt_tileSize : ol.DEFAULT_TILE_SIZE); var maxResolution = Math.max( width / tileSize[0], height / tileSize[1]); diff --git a/src/ol/tilegrid/tilegrid.js b/src/ol/tilegrid/tilegrid.js index 3e7b5b719b6..87e941c7382 100644 --- a/src/ol/tilegrid/tilegrid.js +++ b/src/ol/tilegrid/tilegrid.js @@ -87,8 +87,8 @@ ol.tilegrid.TileGrid = function(options) { * @type {number|ol.Size} */ this.tileSize_ = options.tileSize !== undefined ? - options.tileSize : - !this.tileSizes_ ? ol.DEFAULT_TILE_SIZE : null; + options.tileSize : + !this.tileSizes_ ? ol.DEFAULT_TILE_SIZE : null; ol.asserts.assert( (!this.tileSize_ && this.tileSizes_) || (this.tileSize_ && !this.tileSizes_), diff --git a/src/ol/tilegrid/wmts.js b/src/ol/tilegrid/wmts.js index d9c44220a30..46c0d239e70 100644 --- a/src/ol/tilegrid/wmts.js +++ b/src/ol/tilegrid/wmts.js @@ -69,7 +69,7 @@ ol.tilegrid.WMTS.prototype.getMatrixIds = function() { * @api */ ol.tilegrid.WMTS.createFromCapabilitiesMatrixSet = function(matrixSet, opt_extent, - opt_matrixLimits) { + opt_matrixLimits) { /** @type {!Array.} */ var resolutions = []; @@ -130,7 +130,7 @@ ol.tilegrid.WMTS.createFromCapabilitiesMatrixSet = function(matrixSet, opt_exten } resolutions.push(resolution); tileSizes.push(tileWidth == tileHeight ? - tileWidth : [tileWidth, tileHeight]); + tileWidth : [tileWidth, tileHeight]); // top-left origin, so height is negative sizes.push([elt['MatrixWidth'], -elt['MatrixHeight']]); } diff --git a/src/ol/tileurlfunction.js b/src/ol/tileurlfunction.js index 96f891f4bcf..451fab40cf3 100644 --- a/src/ol/tileurlfunction.js +++ b/src/ol/tileurlfunction.js @@ -16,31 +16,31 @@ ol.TileUrlFunction.createFromTemplate = function(template, tileGrid) { var yRegEx = /\{y\}/g; var dashYRegEx = /\{-y\}/g; return ( - /** + /** * @param {ol.TileCoord} tileCoord Tile Coordinate. * @param {number} pixelRatio Pixel ratio. * @param {ol.proj.Projection} projection Projection. * @return {string|undefined} Tile URL. */ - function(tileCoord, pixelRatio, projection) { - if (!tileCoord) { - return undefined; - } else { - return template.replace(zRegEx, tileCoord[0].toString()) - .replace(xRegEx, tileCoord[1].toString()) - .replace(yRegEx, function() { - var y = -tileCoord[2] - 1; - return y.toString(); - }) - .replace(dashYRegEx, function() { - var z = tileCoord[0]; - var range = tileGrid.getFullTileRange(z); - ol.asserts.assert(range, 55); // The {-y} placeholder requires a tile grid with extent - var y = range.getHeight() + tileCoord[2]; - return y.toString(); - }); - } - }); + function(tileCoord, pixelRatio, projection) { + if (!tileCoord) { + return undefined; + } else { + return template.replace(zRegEx, tileCoord[0].toString()) + .replace(xRegEx, tileCoord[1].toString()) + .replace(yRegEx, function() { + var y = -tileCoord[2] - 1; + return y.toString(); + }) + .replace(dashYRegEx, function() { + var z = tileCoord[0]; + var range = tileGrid.getFullTileRange(z); + ol.asserts.assert(range, 55); // The {-y} placeholder requires a tile grid with extent + var y = range.getHeight() + tileCoord[2]; + return y.toString(); + }); + } + }); }; @@ -69,21 +69,21 @@ ol.TileUrlFunction.createFromTileUrlFunctions = function(tileUrlFunctions) { return tileUrlFunctions[0]; } return ( - /** + /** * @param {ol.TileCoord} tileCoord Tile Coordinate. * @param {number} pixelRatio Pixel ratio. * @param {ol.proj.Projection} projection Projection. * @return {string|undefined} Tile URL. */ - function(tileCoord, pixelRatio, projection) { - if (!tileCoord) { - return undefined; - } else { - var h = ol.tilecoord.hash(tileCoord); - var index = ol.math.modulo(h, tileUrlFunctions.length); - return tileUrlFunctions[index](tileCoord, pixelRatio, projection); - } - }); + function(tileCoord, pixelRatio, projection) { + if (!tileCoord) { + return undefined; + } else { + var h = ol.tilecoord.hash(tileCoord); + var index = ol.math.modulo(h, tileUrlFunctions.length); + return tileUrlFunctions[index](tileCoord, pixelRatio, projection); + } + }); }; diff --git a/src/ol/vectorimagetile.js b/src/ol/vectorimagetile.js index 6f23ded8684..8732937fe51 100644 --- a/src/ol/vectorimagetile.js +++ b/src/ol/vectorimagetile.js @@ -171,7 +171,7 @@ ol.VectorImageTile.prototype.getContext = function() { */ ol.VectorImageTile.prototype.getImage = function() { return this.replayState_.renderedTileRevision == -1 ? - null : this.context_.canvas; + null : this.context_.canvas; }; @@ -234,7 +234,7 @@ ol.VectorImageTile.prototype.load = function() { } if (leftToLoad == 0) { this.setState(this.tileKeys.length > 0 ? - ol.TileState.LOADED : ol.TileState.ERROR); + ol.TileState.LOADED : ol.TileState.ERROR); } } }.bind(this)); @@ -246,8 +246,8 @@ ol.VectorImageTile.prototype.load = function() { if (leftToLoad == 0) { setTimeout(function() { this.setState(this.tileKeys.length > 0 ? - ol.TileState.LOADED : - (errors ? ol.TileState.ERROR : ol.TileState.EMPTY)); + ol.TileState.LOADED : + (errors ? ol.TileState.ERROR : ol.TileState.EMPTY)); }.bind(this), 0); } }; diff --git a/src/ol/view.js b/src/ol/view.js index ec8415b3b82..1665f72493b 100644 --- a/src/ol/view.js +++ b/src/ol/view.js @@ -125,7 +125,7 @@ ol.View.prototype.applyOptions_ = function(options) { */ var properties = {}; properties[ol.ViewProperty.CENTER] = options.center !== undefined ? - options.center : null; + options.center : null; var resolutionConstraintInfo = ol.View.createResolutionConstraint_( options); @@ -285,7 +285,7 @@ ol.View.prototype.animate = function(var_args) { if (options.zoom !== undefined) { animation.sourceResolution = resolution; animation.targetResolution = this.constrainResolution( - this.maxResolution_, options.zoom - this.minZoom_, 0); + this.maxResolution_, options.zoom - this.minZoom_, 0); resolution = animation.targetResolution; } else if (options.resolution) { animation.sourceResolution = resolution; @@ -385,8 +385,8 @@ ol.View.prototype.updateAnimations_ = function() { } if (animation.sourceResolution && animation.targetResolution) { var resolution = progress === 1 ? - animation.targetResolution : - animation.sourceResolution + progress * (animation.targetResolution - animation.sourceResolution); + animation.targetResolution : + animation.sourceResolution + progress * (animation.targetResolution - animation.sourceResolution); if (animation.anchor) { this.set(ol.ViewProperty.CENTER, this.calculateCenterZoom(resolution, animation.anchor)); @@ -395,8 +395,8 @@ ol.View.prototype.updateAnimations_ = function() { } if (animation.sourceRotation !== undefined && animation.targetRotation !== undefined) { var rotation = progress === 1 ? - animation.targetRotation : - animation.sourceRotation + progress * (animation.targetRotation - animation.sourceRotation); + animation.targetRotation : + animation.sourceRotation + progress * (animation.targetRotation - animation.sourceRotation); if (animation.anchor) { this.set(ol.ViewProperty.CENTER, this.calculateCenterRotate(rotation, animation.anchor)); @@ -526,7 +526,7 @@ ol.View.prototype.constrainRotation = function(rotation, opt_delta) { */ ol.View.prototype.getCenter = function() { return /** @type {ol.Coordinate|undefined} */ ( - this.get(ol.ViewProperty.CENTER)); + this.get(ol.ViewProperty.CENTER)); }; @@ -654,7 +654,7 @@ ol.View.prototype.getProjection = function() { */ ol.View.prototype.getResolution = function() { return /** @type {number|undefined} */ ( - this.get(ol.ViewProperty.RESOLUTION)); + this.get(ol.ViewProperty.RESOLUTION)); }; @@ -697,14 +697,14 @@ ol.View.prototype.getResolutionForValueFunction = function(opt_power) { var minResolution = this.minResolution_; var max = Math.log(maxResolution / minResolution) / Math.log(power); return ( - /** + /** * @param {number} value Value. * @return {number} Resolution. */ - function(value) { - var resolution = maxResolution / Math.pow(power, value * max); - return resolution; - }); + function(value) { + var resolution = maxResolution / Math.pow(power, value * max); + return resolution; + }); }; @@ -731,15 +731,15 @@ ol.View.prototype.getValueForResolutionFunction = function(opt_power) { var minResolution = this.minResolution_; var max = Math.log(maxResolution / minResolution) / Math.log(power); return ( - /** + /** * @param {number} resolution Resolution. * @return {number} Value. */ - function(resolution) { - var value = + function(resolution) { + var value = (Math.log(maxResolution / resolution) / Math.log(power)) / max; - return value; - }); + return value; + }); }; @@ -839,7 +839,7 @@ ol.View.prototype.fit = function(geometryOrExtent, opt_options) { var padding = options.padding !== undefined ? options.padding : [0, 0, 0, 0]; var constrainResolution = options.constrainResolution !== undefined ? - options.constrainResolution : true; + options.constrainResolution : true; var nearest = options.nearest !== undefined ? options.nearest : false; var minResolution; if (options.minResolution !== undefined) { @@ -875,7 +875,7 @@ ol.View.prototype.fit = function(geometryOrExtent, opt_options) { [minRotX, minRotY, maxRotX, maxRotY], [size[0] - padding[1] - padding[3], size[1] - padding[0] - padding[2]]); resolution = isNaN(resolution) ? minResolution : - Math.max(resolution, minResolution); + Math.max(resolution, minResolution); if (constrainResolution) { var constrainedResolution = this.constrainResolution(resolution, 0, 0); if (!nearest && constrainedResolution < resolution) { @@ -1058,13 +1058,13 @@ ol.View.createResolutionConstraint_ = function(options) { var defaultZoomFactor = 2; var minZoom = options.minZoom !== undefined ? - options.minZoom : ol.DEFAULT_MIN_ZOOM; + options.minZoom : ol.DEFAULT_MIN_ZOOM; var maxZoom = options.maxZoom !== undefined ? - options.maxZoom : defaultMaxZoom; + options.maxZoom : defaultMaxZoom; var zoomFactor = options.zoomFactor !== undefined ? - options.zoomFactor : defaultZoomFactor; + options.zoomFactor : defaultZoomFactor; if (options.resolutions !== undefined) { var resolutions = options.resolutions; @@ -1077,10 +1077,10 @@ ol.View.createResolutionConstraint_ = function(options) { var projection = ol.proj.createProjection(options.projection, 'EPSG:3857'); var extent = projection.getExtent(); var size = !extent ? - // use an extent that can fit the whole world if need be - 360 * ol.proj.METERS_PER_UNIT[ol.proj.Units.DEGREES] / + // use an extent that can fit the whole world if need be + 360 * ol.proj.METERS_PER_UNIT[ol.proj.Units.DEGREES] / projection.getMetersPerUnit() : - Math.max(ol.extent.getWidth(extent), ol.extent.getHeight(extent)); + Math.max(ol.extent.getWidth(extent), ol.extent.getHeight(extent)); var defaultMaxResolution = size / ol.DEFAULT_TILE_SIZE / Math.pow( defaultZoomFactor, ol.DEFAULT_MIN_ZOOM); @@ -1130,7 +1130,7 @@ ol.View.createResolutionConstraint_ = function(options) { */ ol.View.createRotationConstraint_ = function(options) { var enableRotation = options.enableRotation !== undefined ? - options.enableRotation : true; + options.enableRotation : true; if (enableRotation) { var constrainRotation = options.constrainRotation; if (constrainRotation === undefined || constrainRotation === true) { diff --git a/src/ol/webgl/buffer.js b/src/ol/webgl/buffer.js index d7f7c43f082..19cc90bcdc7 100644 --- a/src/ol/webgl/buffer.js +++ b/src/ol/webgl/buffer.js @@ -25,7 +25,7 @@ if (ol.ENABLE_WEBGL) { * @type {number} */ this.usage_ = opt_usage !== undefined ? - opt_usage : ol.webgl.Buffer.Usage_.STATIC_DRAW; + opt_usage : ol.webgl.Buffer.Usage_.STATIC_DRAW; }; diff --git a/src/ol/webgl/context.js b/src/ol/webgl/context.js index 2ae876cce6f..f3695633f1a 100644 --- a/src/ol/webgl/context.js +++ b/src/ol/webgl/context.js @@ -118,7 +118,7 @@ if (ol.ENABLE_WEBGL) { arrayBuffer = new Float32Array(arr); } else if (target == ol.webgl.ELEMENT_ARRAY_BUFFER) { arrayBuffer = this.hasOESElementIndexUint ? - new Uint32Array(arr) : new Uint16Array(arr); + new Uint32Array(arr) : new Uint16Array(arr); } gl.bufferData(target, arrayBuffer, buf.getUsage()); this.bufferCache_[bufferKey] = { diff --git a/src/ol/xml.js b/src/ol/xml.js index 29ee8d672ee..cf3e5c636a9 100644 --- a/src/ol/xml.js +++ b/src/ol/xml.js @@ -125,18 +125,18 @@ ol.xml.parse = function(xml) { */ ol.xml.makeArrayExtender = function(valueReader, opt_this) { return ( - /** + /** * @param {Node} node Node. * @param {Array.<*>} objectStack Object stack. */ - function(node, objectStack) { - var value = valueReader.call(opt_this, node, objectStack); - if (value !== undefined) { - var array = /** @type {Array.<*>} */ + function(node, objectStack) { + var value = valueReader.call(opt_this, node, objectStack); + if (value !== undefined) { + var array = /** @type {Array.<*>} */ (objectStack[objectStack.length - 1]); - ol.array.extend(array, value); - } - }); + ol.array.extend(array, value); + } + }); }; @@ -150,18 +150,18 @@ ol.xml.makeArrayExtender = function(valueReader, opt_this) { */ ol.xml.makeArrayPusher = function(valueReader, opt_this) { return ( - /** + /** * @param {Node} node Node. * @param {Array.<*>} objectStack Object stack. */ - function(node, objectStack) { - var value = valueReader.call(opt_this !== undefined ? opt_this : this, - node, objectStack); - if (value !== undefined) { - var array = objectStack[objectStack.length - 1]; - array.push(value); - } - }); + function(node, objectStack) { + var value = valueReader.call(opt_this !== undefined ? opt_this : this, + node, objectStack); + if (value !== undefined) { + var array = objectStack[objectStack.length - 1]; + array.push(value); + } + }); }; @@ -175,17 +175,17 @@ ol.xml.makeArrayPusher = function(valueReader, opt_this) { */ ol.xml.makeReplacer = function(valueReader, opt_this) { return ( - /** + /** * @param {Node} node Node. * @param {Array.<*>} objectStack Object stack. */ - function(node, objectStack) { - var value = valueReader.call(opt_this !== undefined ? opt_this : this, - node, objectStack); - if (value !== undefined) { - objectStack[objectStack.length - 1] = value; - } - }); + function(node, objectStack) { + var value = valueReader.call(opt_this !== undefined ? opt_this : this, + node, objectStack); + if (value !== undefined) { + objectStack[objectStack.length - 1] = value; + } + }); }; @@ -200,27 +200,27 @@ ol.xml.makeReplacer = function(valueReader, opt_this) { */ ol.xml.makeObjectPropertyPusher = function(valueReader, opt_property, opt_this) { return ( - /** + /** * @param {Node} node Node. * @param {Array.<*>} objectStack Object stack. */ - function(node, objectStack) { - var value = valueReader.call(opt_this !== undefined ? opt_this : this, - node, objectStack); - if (value !== undefined) { - var object = /** @type {Object} */ + function(node, objectStack) { + var value = valueReader.call(opt_this !== undefined ? opt_this : this, + node, objectStack); + if (value !== undefined) { + var object = /** @type {Object} */ (objectStack[objectStack.length - 1]); - var property = opt_property !== undefined ? - opt_property : node.localName; - var array; - if (property in object) { - array = object[property]; - } else { - array = object[property] = []; - } - array.push(value); + var property = opt_property !== undefined ? + opt_property : node.localName; + var array; + if (property in object) { + array = object[property]; + } else { + array = object[property] = []; } - }); + array.push(value); + } + }); }; @@ -234,21 +234,21 @@ ol.xml.makeObjectPropertyPusher = function(valueReader, opt_property, opt_this) */ ol.xml.makeObjectPropertySetter = function(valueReader, opt_property, opt_this) { return ( - /** + /** * @param {Node} node Node. * @param {Array.<*>} objectStack Object stack. */ - function(node, objectStack) { - var value = valueReader.call(opt_this !== undefined ? opt_this : this, - node, objectStack); - if (value !== undefined) { - var object = /** @type {Object} */ + function(node, objectStack) { + var value = valueReader.call(opt_this !== undefined ? opt_this : this, + node, objectStack); + if (value !== undefined) { + var object = /** @type {Object} */ (objectStack[objectStack.length - 1]); - var property = opt_property !== undefined ? - opt_property : node.localName; - object[property] = value; - } - }); + var property = opt_property !== undefined ? + opt_property : node.localName; + object[property] = value; + } + }); }; @@ -317,25 +317,25 @@ ol.xml.makeArraySerializer = function(nodeWriter, opt_this) { ol.xml.makeSimpleNodeFactory = function(opt_nodeName, opt_namespaceURI) { var fixedNodeName = opt_nodeName; return ( - /** + /** * @param {*} value Value. * @param {Array.<*>} objectStack Object stack. * @param {string=} opt_nodeName Node name. * @return {Node} Node. */ - function(value, objectStack, opt_nodeName) { - var context = objectStack[objectStack.length - 1]; - var node = context.node; - var nodeName = fixedNodeName; - if (nodeName === undefined) { - nodeName = opt_nodeName; - } - var namespaceURI = opt_namespaceURI; - if (opt_namespaceURI === undefined) { - namespaceURI = node.namespaceURI; - } - return ol.xml.createElementNS(namespaceURI, /** @type {string} */ (nodeName)); + function(value, objectStack, opt_nodeName) { + var context = objectStack[objectStack.length - 1]; + var node = context.node; + var nodeName = fixedNodeName; + if (nodeName === undefined) { + nodeName = opt_nodeName; } + var namespaceURI = opt_namespaceURI; + if (opt_namespaceURI === undefined) { + namespaceURI = node.namespaceURI; + } + return ol.xml.createElementNS(namespaceURI, /** @type {string} */ (nodeName)); + } ); }; diff --git a/tasks/build-examples.js b/tasks/build-examples.js index cd899929379..2275e0bf85b 100644 --- a/tasks/build-examples.js +++ b/tasks/build-examples.js @@ -115,7 +115,7 @@ function augmentExamples(files, metalsmith, done) { for (var i = 0, ii = file.resources.length; i < ii; ++i) { var resource = file.resources[i]; var remoteResource = resource.indexOf('//') === -1 ? - 'https://openlayers.org/en/v' + pkg.version + '/examples/' + + 'https://openlayers.org/en/v' + pkg.version + '/examples/' + resource : resource; codePenResources[i] = remoteResource; if (isJsRegEx.test(resource)) { @@ -138,7 +138,7 @@ function augmentExamples(files, metalsmith, done) { remote: remoteResources.join('\n') }; file.extraResources = file.resources.length ? - ',' + codePenResources.join(',') : ''; + ',' + codePenResources.join(',') : ''; } } } diff --git a/tasks/serve.js b/tasks/serve.js index 280294aa2df..6fe96a400e7 100644 --- a/tasks/serve.js +++ b/tasks/serve.js @@ -52,10 +52,10 @@ var createServer = exports.createServer = function(callback) { var pathName = url.parse(referer).pathname; if (pathName.indexOf('/test/') === 0) { main = path.resolve( - path.join(process.cwd(), 'build'), 'test_requires.js'); + path.join(process.cwd(), 'build'), 'test_requires.js'); } else if (pathName.indexOf('/test_rendering/') === 0) { main = path.resolve( - path.join(process.cwd(), 'build'), 'test_rendering_requires.js'); + path.join(process.cwd(), 'build'), 'test_rendering_requires.js'); } else { if (query.id) { if (referer) { diff --git a/test/spec/ol/array.test.js b/test/spec/ol/array.test.js index bf5290bebe6..5b74abfc1fc 100644 --- a/test/spec/ol/array.test.js +++ b/test/spec/ol/array.test.js @@ -47,20 +47,20 @@ describe('ol.array', function() { expect(pos < 0).to.be.ok(); }); it('should have an insertion point of ' + (a.length) + ' for \'zzz0\'', - function() { - var pos = ol.array.binarySearch(a, 'zzz0'); - expect(insertionPoint(pos)).to.be(a.length); - } + function() { + var pos = ol.array.binarySearch(a, 'zzz0'); + expect(insertionPoint(pos)).to.be(a.length); + } ); it('should not find \'BA\'', function() { var pos = ol.array.binarySearch(a, 'zzz0'); expect(pos < 0).to.be.ok(); }); it('should have an insertion point of 10 for \'BA\'', - function() { - var pos = ol.array.binarySearch(a, 'BA'); - expect(insertionPoint(pos)).to.be(10); - } + function() { + var pos = ol.array.binarySearch(a, 'BA'); + expect(insertionPoint(pos)).to.be(10); + } ); }); @@ -70,38 +70,38 @@ describe('ol.array', function() { expect(ol.array.binarySearch(b, 'a') < 0).to.be.ok(); }); it('should have an insertion point of 0 for \'a\'', - function() { - var pos = ol.array.binarySearch(b, 'a'); - expect(insertionPoint(pos)).to.be(0); - } + function() { + var pos = ol.array.binarySearch(b, 'a'); + expect(insertionPoint(pos)).to.be(0); + } ); }); describe('single element array with default lexiographical comparison', - function() { - var c = ['only item']; - it('should find \'only item\' at index 0', function() { - expect(ol.array.binarySearch(c, 'only item')).to.be(0); - }); - it('should not find \'a\'', function() { - expect(ol.array.binarySearch(c, 'a') < 0).to.be.ok(); - }); - it('should have an insertion point of 0 for \'a\'', - function() { - var pos = ol.array.binarySearch(c, 'a'); - expect(insertionPoint(pos)).to.be(0); - } - ); - it('should not find \'z\'', function() { - expect(ol.array.binarySearch(c, 'z') < 0).to.be.ok(); - }); - it('should have an insertion point of 1 for \'z\'', - function() { - var pos = ol.array.binarySearch(c, 'z'); - expect(insertionPoint(pos)).to.be(1); - } - ); - } + function() { + var c = ['only item']; + it('should find \'only item\' at index 0', function() { + expect(ol.array.binarySearch(c, 'only item')).to.be(0); + }); + it('should not find \'a\'', function() { + expect(ol.array.binarySearch(c, 'a') < 0).to.be.ok(); + }); + it('should have an insertion point of 0 for \'a\'', + function() { + var pos = ol.array.binarySearch(c, 'a'); + expect(insertionPoint(pos)).to.be(0); + } + ); + it('should not find \'z\'', function() { + expect(ol.array.binarySearch(c, 'z') < 0).to.be.ok(); + }); + it('should have an insertion point of 1 for \'z\'', + function() { + var pos = ol.array.binarySearch(c, 'z'); + expect(insertionPoint(pos)).to.be(1); + } + ); + } ); describe('default comparison on array of Number(s)', function() { @@ -135,10 +135,10 @@ describe('ol.array', function() { expect(pos < 0).to.be(true); }); it('should have an insertion point of ' + (d.length) + ' for 54255', - function() { - var pos = ol.array.binarySearch(d, 54255); - expect(insertionPoint(pos)).to.be(d.length); - } + function() { + var pos = ol.array.binarySearch(d, 54255); + expect(insertionPoint(pos)).to.be(d.length); + } ); it('should not find 1.1', function() { var pos = ol.array.binarySearch(d, 1.1); @@ -151,54 +151,54 @@ describe('ol.array', function() { }); describe('custom comparison function, which reverse orders numbers', - function() { - var e = [ - 54254, 453, 342, 334, 142.88888708, 5, 0.31255, 0, 0, 0, -3, - -9, -324, -1321.3124, -321434.58758, -897123.9 - ]; - it('should find 54254 at index 0', function() { - var pos = ol.array.binarySearch(e, 54254, revNumCompare); - expect(pos).to.be(0); - }); - it('should find -897123.9 at index ' + (e.length - 1), function() { - var pos = ol.array.binarySearch(e, -897123.9, revNumCompare); - expect(pos).to.be(e.length - 1); - }); - it('should find -3 at index 10', function() { - var pos = ol.array.binarySearch(e, -3, revNumCompare); - expect(pos).to.be(10); - }); - it('should find 0 at index 7 || 8 || 9', function() { - var pos = ol.array.binarySearch(e, 0, revNumCompare); - expect(pos == 7 || pos == 8 || pos == 9).to.be(true); - }); - it('should not find 54254.1', function() { - var pos = ol.array.binarySearch(e, 54254.1, revNumCompare); - expect(pos < 0).to.be(true); - }); - it('should have an insertion point of 0 for 54254.1', function() { - var pos = ol.array.binarySearch(e, 54254.1, revNumCompare); - expect(insertionPoint(pos)).to.be(0); - }); - it('should not find -897124', function() { - var pos = ol.array.binarySearch(e, -897124, revNumCompare); - expect(pos < 0).to.be(true); - }); - it('should have an insertion point of ' + e.length + ' for -897124', - function() { + function() { + var e = [ + 54254, 453, 342, 334, 142.88888708, 5, 0.31255, 0, 0, 0, -3, + -9, -324, -1321.3124, -321434.58758, -897123.9 + ]; + it('should find 54254 at index 0', function() { + var pos = ol.array.binarySearch(e, 54254, revNumCompare); + expect(pos).to.be(0); + }); + it('should find -897123.9 at index ' + (e.length - 1), function() { + var pos = ol.array.binarySearch(e, -897123.9, revNumCompare); + expect(pos).to.be(e.length - 1); + }); + it('should find -3 at index 10', function() { + var pos = ol.array.binarySearch(e, -3, revNumCompare); + expect(pos).to.be(10); + }); + it('should find 0 at index 7 || 8 || 9', function() { + var pos = ol.array.binarySearch(e, 0, revNumCompare); + expect(pos == 7 || pos == 8 || pos == 9).to.be(true); + }); + it('should not find 54254.1', function() { + var pos = ol.array.binarySearch(e, 54254.1, revNumCompare); + expect(pos < 0).to.be(true); + }); + it('should have an insertion point of 0 for 54254.1', function() { + var pos = ol.array.binarySearch(e, 54254.1, revNumCompare); + expect(insertionPoint(pos)).to.be(0); + }); + it('should not find -897124', function() { var pos = ol.array.binarySearch(e, -897124, revNumCompare); - expect(insertionPoint(pos)).to.be(e.length); - } - ); - it('should not find 1.1', function() { - var pos = ol.array.binarySearch(e, 1.1, revNumCompare); - expect(pos < 0).to.be(true); - }); - it('should have an insertion point of 0 for 1.1', function() { - var pos = ol.array.binarySearch(e, 1.1, revNumCompare); - expect(insertionPoint(pos)).to.be(6); - }); - } + expect(pos < 0).to.be(true); + }); + it('should have an insertion point of ' + e.length + ' for -897124', + function() { + var pos = ol.array.binarySearch(e, -897124, revNumCompare); + expect(insertionPoint(pos)).to.be(e.length); + } + ); + it('should not find 1.1', function() { + var pos = ol.array.binarySearch(e, 1.1, revNumCompare); + expect(pos < 0).to.be(true); + }); + it('should have an insertion point of 0 for 1.1', function() { + var pos = ol.array.binarySearch(e, 1.1, revNumCompare); + expect(insertionPoint(pos)).to.be(6); + }); + } ); describe('0 length array with custom comparison function', function() { @@ -214,29 +214,29 @@ describe('ol.array', function() { }); describe('single element array with custom comparison function', - function() { - var g = [1]; - it('should find 1 at index 0', function() { - var pos = ol.array.binarySearch(g, 1, revNumCompare); - expect(pos).to.be(0); - }); - it('should not find 2', function() { - var pos = ol.array.binarySearch(g, 2, revNumCompare); - expect(pos < 0).to.be(true); - }); - it('should have an insertion point of 0 for 2', function() { - var pos = ol.array.binarySearch(g, 2, revNumCompare); - expect(insertionPoint(pos)).to.be(0); - }); - it('should not find 0', function() { - var pos = ol.array.binarySearch(g, 0, revNumCompare); - expect(pos < 0).to.be(true); - }); - it('should have an insertion point of 1 for 0', function() { - var pos = ol.array.binarySearch(g, 0, revNumCompare); - expect(insertionPoint(pos)).to.be(1); - }); - } + function() { + var g = [1]; + it('should find 1 at index 0', function() { + var pos = ol.array.binarySearch(g, 1, revNumCompare); + expect(pos).to.be(0); + }); + it('should not find 2', function() { + var pos = ol.array.binarySearch(g, 2, revNumCompare); + expect(pos < 0).to.be(true); + }); + it('should have an insertion point of 0 for 2', function() { + var pos = ol.array.binarySearch(g, 2, revNumCompare); + expect(insertionPoint(pos)).to.be(0); + }); + it('should not find 0', function() { + var pos = ol.array.binarySearch(g, 0, revNumCompare); + expect(pos < 0).to.be(true); + }); + it('should have an insertion point of 1 for 0', function() { + var pos = ol.array.binarySearch(g, 0, revNumCompare); + expect(insertionPoint(pos)).to.be(1); + }); + } ); describe('finding first index when multiple candidates', function() { @@ -249,51 +249,51 @@ describe('ol.array', function() { }); describe('Don\'t use Array#slice, Function#apply and Function#call', - function() { - var a = [1, 5, 7, 11, 13, 16, 19, 24, 28, 31, 33, 36, 40, 50, 52, 55]; - var calls = { - 'Array#slice': false, - 'Function#apply': false, - 'Function#call': false - }; - var origArraySlice; - var origFunctionApply; - var origFunctionCall; - - it('does not use potentially slow methods (default & custom compare)', - function() { - // Mockup (I failed to use sinon.spy and beforeEach-hooks) - origArraySlice = Array.prototype.slice; - origFunctionApply = Function.prototype.apply; - origFunctionCall = Function.prototype.call; - Array.prototype.slice = function() { - calls['Array#slice'] = true; - }; - Function.prototype.apply = function() { - calls['Function#apply'] = true; - }; - Function.prototype.call = function() { - calls['Function#call'] = true; - }; - - // Now actually call and test the method twice - ol.array.binarySearch(a, 48); - ol.array.binarySearch(a, 13, function(a, b) { - return a > b ? 1 : a < b ? -1 : 0; - }); - - // Restore mocked up methods - Array.prototype.slice = origArraySlice; - Function.prototype.apply = origFunctionApply; - Function.prototype.call = origFunctionCall; - - // Expectations - expect(calls['Array#slice']).to.be(false); - expect(calls['Function#apply']).to.be(false); - expect(calls['Function#call']).to.be(false); - } - ); - } + function() { + var a = [1, 5, 7, 11, 13, 16, 19, 24, 28, 31, 33, 36, 40, 50, 52, 55]; + var calls = { + 'Array#slice': false, + 'Function#apply': false, + 'Function#call': false + }; + var origArraySlice; + var origFunctionApply; + var origFunctionCall; + + it('does not use potentially slow methods (default & custom compare)', + function() { + // Mockup (I failed to use sinon.spy and beforeEach-hooks) + origArraySlice = Array.prototype.slice; + origFunctionApply = Function.prototype.apply; + origFunctionCall = Function.prototype.call; + Array.prototype.slice = function() { + calls['Array#slice'] = true; + }; + Function.prototype.apply = function() { + calls['Function#apply'] = true; + }; + Function.prototype.call = function() { + calls['Function#call'] = true; + }; + + // Now actually call and test the method twice + ol.array.binarySearch(a, 48); + ol.array.binarySearch(a, 13, function(a, b) { + return a > b ? 1 : a < b ? -1 : 0; + }); + + // Restore mocked up methods + Array.prototype.slice = origArraySlice; + Function.prototype.apply = origFunctionApply; + Function.prototype.call = origFunctionCall; + + // Expectations + expect(calls['Array#slice']).to.be(false); + expect(calls['Function#apply']).to.be(false); + expect(calls['Function#call']).to.be(false); + } + ); + } ); describe('when items are not found', function() { @@ -546,7 +546,7 @@ describe('ol.array', function() { beforeEach(function() { arr = [{key: 3, val: 'a'}, {key: 2, val: 'b'}, {key: 3, val: 'c'}, - {key: 4, val: 'd'}, {key: 3, val: 'e'}]; + {key: 4, val: 'd'}, {key: 3, val: 'e'}]; wantedSortedValues = ['b', 'a', 'c', 'e', 'd']; }); diff --git a/test/spec/ol/format/esrijson.test.js b/test/spec/ol/format/esrijson.test.js index 4e60a786d53..c3d8b6ac977 100644 --- a/test/spec/ol/format/esrijson.test.js +++ b/test/spec/ol/format/esrijson.test.js @@ -477,7 +477,7 @@ describe('ol.format.EsriJSON', function() { expect(obj).to.be.a(ol.geom.LineString); expect(obj.getLayout()).to.eql('XYZM'); expect(obj.getCoordinates()).to.eql([[10, 20, 1534, 1], - [30, 40, 1420, 2]]); + [30, 40, 1420, 2]]); }); it('parses multilinestring', function() { @@ -650,7 +650,7 @@ describe('ol.format.EsriJSON', function() { expect(obj.getLayout()).to.eql('XY'); expect(obj.getCoordinates()).to.eql([ [[[0, 1], [1, 4], [4, 3], [3, 0]], [[2, 2], [3, 2], - [3, 3], [2, 3]]], + [3, 3], [2, 3]]], [[[10, 1], [11, 5], [14, 3], [13, 0]]] ]); }); @@ -669,7 +669,7 @@ describe('ol.format.EsriJSON', function() { expect(obj.getLayout()).to.eql('XYZ'); expect(obj.getCoordinates()).to.eql([ [[[0, 1, 0], [1, 4, 0], [4, 3, 0], [3, 0, 0]], [[2, 2, 0], [3, 2, 0], - [3, 3, 0], [2, 3, 0]]], + [3, 3, 0], [2, 3, 0]]], [[[10, 1, 0], [11, 5, 0], [14, 3, 0], [13, 0, 0]]] ]); }); @@ -688,7 +688,7 @@ describe('ol.format.EsriJSON', function() { expect(obj.getLayout()).to.eql('XYM'); expect(obj.getCoordinates()).to.eql([ [[[0, 1, 0], [1, 4, 0], [4, 3, 0], [3, 0, 0]], [[2, 2, 0], [3, 2, 0], - [3, 3, 0], [2, 3, 0]]], + [3, 3, 0], [2, 3, 0]]], [[[10, 1, 0], [11, 5, 0], [14, 3, 0], [13, 0, 0]]] ]); }); @@ -817,8 +817,8 @@ describe('ol.format.EsriJSON', function() { it('encodes XYZM linestring', function() { var linestring = new ol.geom.LineString([[10, 20, 1534, 1], - [30, 40, 1420, 1]], - 'XYZM'); + [30, 40, 1420, 1]], + 'XYZM'); var esrijson = format.writeGeometry(linestring); expect(linestring.getCoordinates()).to.eql( format.readGeometry(esrijson).getCoordinates()); @@ -882,7 +882,7 @@ describe('ol.format.EsriJSON', function() { it('encodes XYZ multipoint', function() { var multipoint = new ol.geom.MultiPoint([[102.0, 0.0, 3], - [103.0, 1.0, 4]], 'XYZ'); + [103.0, 1.0, 4]], 'XYZ'); var esrijson = format.writeGeometry(multipoint); expect(multipoint.getCoordinates()).to.eql( format.readGeometry(esrijson).getCoordinates()); @@ -890,7 +890,7 @@ describe('ol.format.EsriJSON', function() { it('encodes XYM multipoint', function() { var multipoint = new ol.geom.MultiPoint([[102.0, 0.0, 3], - [103.0, 1.0, 4]], 'XYM'); + [103.0, 1.0, 4]], 'XYM'); var esrijson = format.writeGeometry(multipoint); expect(multipoint.getCoordinates()).to.eql( format.readGeometry(esrijson).getCoordinates()); @@ -898,7 +898,7 @@ describe('ol.format.EsriJSON', function() { it('encodes XYZM multipoint', function() { var multipoint = new ol.geom.MultiPoint([[102.0, 0.0, 3, 1], - [103.0, 1.0, 4, 1]], 'XYZM'); + [103.0, 1.0, 4, 1]], 'XYZM'); var esrijson = format.writeGeometry(multipoint); expect(multipoint.getCoordinates()).to.eql( format.readGeometry(esrijson).getCoordinates()); @@ -959,7 +959,7 @@ describe('ol.format.EsriJSON', function() { it('encodes XYZ multipolygon', function() { var multipolygon = new ol.geom.MultiPolygon([ [[[0, 1, 0], [1, 4, 0], [4, 3, 0], [3, 0, 0]], [[2, 2, 0], [3, 2, 0], - [3, 3, 0], [2, 3, 0]]], + [3, 3, 0], [2, 3, 0]]], [[[10, 1, 0], [11, 5, 0], [14, 3, 0], [13, 0, 0]]] ], 'XYZ'); var esrijson = format.writeGeometry(multipolygon); @@ -970,7 +970,7 @@ describe('ol.format.EsriJSON', function() { it('encodes XYM multipolygon', function() { var multipolygon = new ol.geom.MultiPolygon([ [[[0, 1, 0], [1, 4, 0], [4, 3, 0], [3, 0, 0]], [[2, 2, 0], [3, 2, 0], - [3, 3, 0], [2, 3, 0]]], + [3, 3, 0], [2, 3, 0]]], [[[10, 1, 0], [11, 5, 0], [14, 3, 0], [13, 0, 0]]] ], 'XYM'); var esrijson = format.writeGeometry(multipolygon); diff --git a/test/spec/ol/format/geojson.test.js b/test/spec/ol/format/geojson.test.js index a6b20bc6520..c729b96a08c 100644 --- a/test/spec/ol/format/geojson.test.js +++ b/test/spec/ol/format/geojson.test.js @@ -820,7 +820,7 @@ describe('ol.format.GeoJSON', function() { it('truncates a linestring with decimals option', function() { var linestring = new ol.geom.LineString([[42.123456789, 38.987654321], - [43, 39]]); + [43, 39]]); var geojson = format.writeGeometry(linestring, { decimals: 6 }); @@ -832,7 +832,7 @@ describe('ol.format.GeoJSON', function() { it('rounds a linestring with decimals option = 0', function() { var linestring = new ol.geom.LineString([[42.123456789, 38.987654321], - [43, 39]]); + [43, 39]]); var geojson = format.writeGeometry(linestring, { decimals: 0 }); diff --git a/test/spec/ol/format/gml.test.js b/test/spec/ol/format/gml.test.js index 3376e6712f5..2764eab7ab0 100644 --- a/test/spec/ol/format/gml.test.js +++ b/test/spec/ol/format/gml.test.js @@ -494,18 +494,18 @@ describe('ol.format.GML3', function() { it('can read and write a linestring geometry with ' + 'correct axis order', - function() { - var text = + function() { + var text = '' + ' -90 -180 90 180' + ''; - var g = readGeometry(format, text); - expect(g).to.be.an(ol.geom.LineString); - expect(g.getCoordinates()).to.eql([[-180, -90, 0], [180, 90, 0]]); - var serialized = formatWGS84.writeGeometryNode(g); - expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); - }); + var g = readGeometry(format, text); + expect(g).to.be.an(ol.geom.LineString); + expect(g.getCoordinates()).to.eql([[-180, -90, 0], [180, 90, 0]]); + var serialized = formatWGS84.writeGeometryNode(g); + expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); + }); it('can read and write a point geometry with correct axis order', function() { @@ -612,8 +612,8 @@ describe('ol.format.GML3', function() { var g = readGeometry(format, text); expect(g).to.be.an(ol.geom.Polygon); expect(g.getCoordinates()).to.eql([[[1, 2, 0], [3, 2, 0], [3, 4, 0], - [1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]], - [[3, 4, 0], [3, 6, 0], [5, 6, 0], [3, 4, 0]]]); + [1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]], + [[3, 4, 0], [3, 6, 0], [5, 6, 0], [3, 4, 0]]]); var serialized = format.writeGeometryNode(g); expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); }); @@ -649,8 +649,8 @@ describe('ol.format.GML3', function() { var g = readGeometry(format, text); expect(g).to.be.an(ol.geom.Polygon); expect(g.getCoordinates()).to.eql([[[1, 2, 0], [3, 2, 0], [3, 4, 0], - [1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]], - [[3, 4, 0], [3, 6, 0], [5, 6, 0], [3, 4, 0]]]); + [1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]], + [[3, 4, 0], [3, 6, 0], [5, 6, 0], [3, 4, 0]]]); format = new ol.format.GML({srsName: 'CRS:84', surface: true}); var serialized = format.writeGeometryNode(g); expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); @@ -834,7 +834,7 @@ describe('ol.format.GML3', function() { expect(g.getCoordinates()).to.eql([ [[[1, 2, 0], [3, 2, 0], [3, 4, 0], [1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]], - [[3, 4, 0], [3, 6, 0], [5, 6, 0], [3, 4, 0]]], + [[3, 4, 0], [3, 6, 0], [5, 6, 0], [3, 4, 0]]], [[[1, 2, 0], [3, 2, 0], [3, 4, 0], [1, 2, 0]]]]); format = new ol.format.GML({srsName: 'CRS:84', multiSurface: false}); var serialized = format.writeGeometryNode(g); @@ -877,7 +877,7 @@ describe('ol.format.GML3', function() { expect(g.getCoordinates()).to.eql([ [[[1, 2, 0], [3, 2, 0], [3, 4, 0], [1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]], - [[3, 4, 0], [3, 6, 0], [5, 6, 0], [3, 4, 0]]], + [[3, 4, 0], [3, 6, 0], [5, 6, 0], [3, 4, 0]]], [[[1, 2, 0], [3, 2, 0], [3, 4, 0], [1, 2, 0]]]]); }); @@ -983,7 +983,7 @@ describe('ol.format.GML3', function() { expect(g.getCoordinates()).to.eql([ [[[1, 2, 0], [3, 2, 0], [3, 4, 0], [1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]], - [[3, 4, 0], [3, 6, 0], [5, 6, 0], [3, 4, 0]]], + [[3, 4, 0], [3, 6, 0], [5, 6, 0], [3, 4, 0]]], [[[1, 2, 0], [3, 2, 0], [3, 4, 0], [1, 2, 0]]]]); var serialized = format.writeGeometryNode(g); expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); @@ -1027,7 +1027,7 @@ describe('ol.format.GML3', function() { expect(g.getCoordinates()).to.eql([ [[[1, 2, 0], [3, 2, 0], [3, 4, 0], [1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]], - [[3, 4, 0], [3, 6, 0], [5, 6, 0], [3, 4, 0]]], + [[3, 4, 0], [3, 6, 0], [5, 6, 0], [3, 4, 0]]], [[[1, 2, 0], [3, 2, 0], [3, 4, 0], [1, 2, 0]]]]); }); @@ -1077,7 +1077,7 @@ describe('ol.format.GML3', function() { expect(g.getCoordinates()).to.eql([ [[[1, 2, 0], [3, 2, 0], [3, 4, 0], [1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]], - [[3, 4, 0], [3, 6, 0], [5, 6, 0], [3, 4, 0]]], + [[3, 4, 0], [3, 6, 0], [5, 6, 0], [3, 4, 0]]], [[[1, 2, 0], [3, 2, 0], [3, 4, 0], [1, 2, 0]]]]); format = new ol.format.GML({srsName: 'CRS:84', surface: true}); var serialized = format.writeGeometryNode(g); diff --git a/test/spec/ol/format/kml.test.js b/test/spec/ol/format/kml.test.js index fc2ea80bd14..46a7ea25d20 100644 --- a/test/spec/ol/format/kml.test.js +++ b/test/spec/ol/format/kml.test.js @@ -849,8 +849,8 @@ describe('ol.format.KML', function() { var g = f.getGeometry(); expect(g).to.be.an(ol.geom.MultiPolygon); expect(g.getCoordinates()).to.eql( - [[[[0, 0, 0], [0, 1, 0], [1, 1, 0], [1, 0, 0]]], - [[[3, 0, 0], [3, 1, 0], [4, 1, 0], [4, 0, 0]]]]); + [[[[0, 0, 0], [0, 1, 0], [1, 1, 0], [1, 0, 0]]], + [[[3, 0, 0], [3, 1, 0], [4, 1, 0], [4, 0, 0]]]]); expect(g.get('extrude')).to.be.an('array'); expect(g.get('extrude')).to.have.length(2); expect(g.get('extrude')[0]).to.be(false); @@ -864,8 +864,8 @@ describe('ol.format.KML', function() { it('can write MultiPolygon geometries', function() { var layout = 'XYZ'; var multiPolygon = new ol.geom.MultiPolygon( - [[[[0, 0, 0], [0, 1, 0], [1, 1, 0], [1, 0, 0]]], - [[[3, 0, 0], [3, 1, 0], [4, 1, 0], [4, 0, 0]]]], layout); + [[[[0, 0, 0], [0, 1, 0], [1, 1, 0], [1, 0, 0]]], + [[[3, 0, 0], [3, 1, 0], [4, 1, 0], [4, 0, 0]]]], layout); var features = [new ol.Feature(multiPolygon)]; var node = format.writeFeaturesNode(features); var text = diff --git a/test/spec/ol/format/ows.test.js b/test/spec/ol/format/ows.test.js index 069a2cc0f10..0e88005b990 100644 --- a/test/spec/ol/format/ows.test.js +++ b/test/spec/ol/format/ows.test.js @@ -42,7 +42,7 @@ describe('ol.format.OWS 1.1', function() { '' + '' + '' - ); + ); var obj = parser.read(doc); expect(obj).to.be.ok(); @@ -76,7 +76,7 @@ describe('ol.format.OWS 1.1', function() { 'none' + '' + '' - ); + ); var obj = parser.readFromNode(doc.firstChild); expect(obj).to.be.ok(); @@ -129,7 +129,7 @@ describe('ol.format.OWS 1.1', function() { '' + '' + '' - ); + ); var obj = parser.readFromNode(doc.firstChild); expect(obj).to.be.ok(); diff --git a/test/spec/ol/format/wfs.test.js b/test/spec/ol/format/wfs.test.js index 55d3ad751ae..829e9919856 100644 --- a/test/spec/ol/format/wfs.test.js +++ b/test/spec/ol/format/wfs.test.js @@ -348,14 +348,14 @@ describe('ol.format.WFS', function() { featurePrefix: 'topp', featureTypes: ['states'], filter: ol.format.filter.or( - ol.format.filter.and( - ol.format.filter.greaterThan('area', 100), - ol.format.filter.greaterThanOrEqualTo('pop', 20000) - ), - ol.format.filter.and( - ol.format.filter.lessThan('area', 100), - ol.format.filter.lessThanOrEqualTo('pop', 20000) - ) + ol.format.filter.and( + ol.format.filter.greaterThan('area', 100), + ol.format.filter.greaterThanOrEqualTo('pop', 20000) + ), + ol.format.filter.and( + ol.format.filter.lessThan('area', 100), + ol.format.filter.lessThanOrEqualTo('pop', 20000) + ) ) }); expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); @@ -505,9 +505,9 @@ describe('ol.format.WFS', function() { featurePrefix: 'topp', featureTypes: ['states'], filter: ol.format.filter.and( - ol.format.filter.equalTo('name', 'New York'), - ol.format.filter.bbox('the_geom', [1, 2, 3, 4], 'urn:ogc:def:crs:EPSG::4326'), - ol.format.filter.greaterThan('population', 2000000) + ol.format.filter.equalTo('name', 'New York'), + ol.format.filter.bbox('the_geom', [1, 2, 3, 4], 'urn:ogc:def:crs:EPSG::4326'), + ol.format.filter.greaterThan('population', 2000000) ) }); expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); @@ -539,11 +539,11 @@ describe('ol.format.WFS', function() { filter: ol.format.filter.intersects( 'the_geom', new ol.geom.Polygon([[ - [10, 20], - [10, 25], - [15, 25], - [15, 20], - [10, 20] + [10, 20], + [10, 25], + [15, 25], + [15, 20], + [10, 20] ]]) ) }); @@ -576,11 +576,11 @@ describe('ol.format.WFS', function() { filter: ol.format.filter.within( 'the_geom', new ol.geom.Polygon([[ - [10, 20], - [10, 25], - [15, 25], - [15, 20], - [10, 20] + [10, 20], + [10, 25], + [15, 25], + [15, 20], + [10, 20] ]]) ) }); @@ -1182,10 +1182,10 @@ describe('ol.format.WFS', function() { ' ' + ''; var serialized = ol.format.WFS.writeFilter( - ol.format.filter.and( - ol.format.filter.like('name', 'Mississippi*'), - ol.format.filter.equalTo('waterway', 'riverbank') - ) + ol.format.filter.and( + ol.format.filter.like('name', 'Mississippi*'), + ol.format.filter.equalTo('waterway', 'riverbank') + ) ); expect(serialized).to.xmleql(ol.xml.parse(text)); }); diff --git a/test/spec/ol/format/wmtscapabilities.test.js b/test/spec/ol/format/wmtscapabilities.test.js index 373d41a665d..167a57f952b 100644 --- a/test/spec/ol/format/wmtscapabilities.test.js +++ b/test/spec/ol/format/wmtscapabilities.test.js @@ -28,7 +28,7 @@ describe('ol.format.WMTSCapabilities', function() { var layer = capabilities.Contents.Layer[0]; expect(layer.Abstract).to.be - .eql('Blue Marble Next Generation NASA Product'); + .eql('Blue Marble Next Generation NASA Product'); expect(layer.Identifier).to.be.eql('BlueMarbleNextGeneration'); expect(layer.Title).to.be.eql('Blue Marble Next Generation'); @@ -51,16 +51,16 @@ describe('ol.format.WMTSCapabilities', function() { expect(layer.Style[0].isDefault).to.be(true); expect(layer.Style[0].Title).to.be.eql('Dark Blue'); expect(layer.Style[0].LegendURL[0].href).to.be - .eql('http://www.miramon.uab.es/wmts/Coastlines/' + + .eql('http://www.miramon.uab.es/wmts/Coastlines/' + 'coastlines_darkBlue.png'); expect(layer.Style[0].LegendURL[0].format).to.be.eql('image/png'); expect(layer.TileMatrixSetLink).to.be.an('array'); expect(layer.TileMatrixSetLink).to.have.length(2); expect(layer.TileMatrixSetLink[0].TileMatrixSet).to.be - .eql('BigWorldPixel'); + .eql('BigWorldPixel'); expect(layer.TileMatrixSetLink[1].TileMatrixSet).to.be - .eql('google3857'); + .eql('google3857'); var wgs84Bbox = layer.WGS84BoundingBox; expect(wgs84Bbox).to.be.an('array'); @@ -73,7 +73,7 @@ describe('ol.format.WMTSCapabilities', function() { expect(layer.ResourceURL).to.have.length(2); expect(layer.ResourceURL[0].format).to.be.eql('image/png'); expect(layer.ResourceURL[0].template).to.be - .eql('http://www.example.com/wmts/coastlines/{TileMatrix}' + + .eql('http://www.example.com/wmts/coastlines/{TileMatrix}' + '/{TileRow}/{TileCol}.png'); }); @@ -140,19 +140,19 @@ describe('ol.format.WMTSCapabilities', function() { expect(layer.TileMatrixSetLink).to.be.an('array'); expect(layer.TileMatrixSetLink).to.have.length(1); expect(layer.TileMatrixSetLink[0].TileMatrixSet).to.be - .eql('PM'); + .eql('PM'); expect(layer.TileMatrixSetLink[0].TileMatrixSetLimits).to.be.an('array'); expect(layer.TileMatrixSetLink[0].TileMatrixSetLimits).to.have.length(20); expect(layer.TileMatrixSetLink[0].TileMatrixSetLimits[0].TileMatrix) - .to.be.eql('0'); + .to.be.eql('0'); expect(layer.TileMatrixSetLink[0].TileMatrixSetLimits[0].MinTileRow) - .to.be.eql(0); + .to.be.eql(0); expect(layer.TileMatrixSetLink[0].TileMatrixSetLimits[0].MaxTileRow) - .to.be.eql(1); + .to.be.eql(1); expect(layer.TileMatrixSetLink[0].TileMatrixSetLimits[0].MinTileCol) - .to.be.eql(0); + .to.be.eql(0); expect(layer.TileMatrixSetLink[0].TileMatrixSetLimits[0].MaxTileCol) - .to.be.eql(1); + .to.be.eql(1); }); @@ -168,7 +168,7 @@ describe('ol.format.WMTSCapabilities', function() { expect(pm.TileMatrix[0].MatrixHeight).to.be.eql(1); expect(pm.TileMatrix[0].MatrixWidth).to.be.eql(1); expect(pm.TileMatrix[0].ScaleDenominator) - .to.be.eql(559082264.0287178958533332); + .to.be.eql(559082264.0287178958533332); expect(pm.TileMatrix[0].TileWidth).to.be.eql(256); expect(pm.TileMatrix[0].TileHeight).to.be.eql(256); expect(pm.TileMatrix[0].TopLeftCorner).to.be.a('array'); @@ -178,7 +178,7 @@ describe('ol.format.WMTSCapabilities', function() { expect(pm.TileMatrix[1].MatrixHeight).to.be.eql(2); expect(pm.TileMatrix[1].MatrixWidth).to.be.eql(2); expect(pm.TileMatrix[1].ScaleDenominator) - .to.be.eql(279541132.0143588959472254); + .to.be.eql(279541132.0143588959472254); expect(pm.TileMatrix[1].TileWidth).to.be.eql(256); expect(pm.TileMatrix[1].TileHeight).to.be.eql(256); expect(pm.TileMatrix[1].TopLeftCorner).to.be.a('array'); diff --git a/test/spec/ol/geom/circle.test.js b/test/spec/ol/geom/circle.test.js index 67c950974cd..921b60353af 100644 --- a/test/spec/ol/geom/circle.test.js +++ b/test/spec/ol/geom/circle.test.js @@ -208,29 +208,29 @@ describe('ol.geom.Circle', function() { describe('#intersectsExtent', function() { it('returns false for non-intersecting extents (wide outside own bbox)', - function() { - var wideOutsideLeftTop = [-3, 2, -2, 3]; - var wideOutsideRightTop = [2, 2, 3, 3]; - var wideOutsideRightBottom = [2, -3, 3, -2]; - var wideOutsideLeftBottom = [-3, -3, -2, -2]; - expect(circle.intersectsExtent(wideOutsideLeftTop)).to.be(false); - expect(circle.intersectsExtent(wideOutsideRightTop)).to.be(false); - expect(circle.intersectsExtent(wideOutsideRightBottom)).to.be(false); - expect(circle.intersectsExtent(wideOutsideLeftBottom)).to.be(false); - } + function() { + var wideOutsideLeftTop = [-3, 2, -2, 3]; + var wideOutsideRightTop = [2, 2, 3, 3]; + var wideOutsideRightBottom = [2, -3, 3, -2]; + var wideOutsideLeftBottom = [-3, -3, -2, -2]; + expect(circle.intersectsExtent(wideOutsideLeftTop)).to.be(false); + expect(circle.intersectsExtent(wideOutsideRightTop)).to.be(false); + expect(circle.intersectsExtent(wideOutsideRightBottom)).to.be(false); + expect(circle.intersectsExtent(wideOutsideLeftBottom)).to.be(false); + } ); it('returns false for non-intersecting extents (inside own bbox)', - function() { - var nearOutsideLeftTop = [-1, 0.9, -0.9, 1]; - var nearOutsideRightTop = [0.9, 0.9, 1, 1]; - var nearOutsideRightBottom = [0.9, -1, 1, -0.9]; - var nearOutsideLeftBottom = [-1, -1, -0.9, -0.9]; - expect(circle.intersectsExtent(nearOutsideLeftTop)).to.be(false); - expect(circle.intersectsExtent(nearOutsideRightTop)).to.be(false); - expect(circle.intersectsExtent(nearOutsideRightBottom)).to.be(false); - expect(circle.intersectsExtent(nearOutsideLeftBottom)).to.be(false); - } + function() { + var nearOutsideLeftTop = [-1, 0.9, -0.9, 1]; + var nearOutsideRightTop = [0.9, 0.9, 1, 1]; + var nearOutsideRightBottom = [0.9, -1, 1, -0.9]; + var nearOutsideLeftBottom = [-1, -1, -0.9, -0.9]; + expect(circle.intersectsExtent(nearOutsideLeftTop)).to.be(false); + expect(circle.intersectsExtent(nearOutsideRightTop)).to.be(false); + expect(circle.intersectsExtent(nearOutsideRightBottom)).to.be(false); + expect(circle.intersectsExtent(nearOutsideLeftBottom)).to.be(false); + } ); it('returns true for extents that intersect clearly', function() { diff --git a/test/spec/ol/geom/flat/center.test.js b/test/spec/ol/geom/flat/center.test.js index 75f81ba34a2..a15bbafe83c 100644 --- a/test/spec/ol/geom/flat/center.test.js +++ b/test/spec/ol/geom/flat/center.test.js @@ -13,10 +13,10 @@ describe('ol.geom.flat.center', function() { [[0, 0], [0, 1], [1, 1], [1, 0], [0, 0]] ]]); var got = ol.geom.flat.center.linearRingss( - squareMultiPoly.flatCoordinates, - 0, - squareMultiPoly.endss_, - 2 + squareMultiPoly.flatCoordinates, + 0, + squareMultiPoly.endss_, + 2 ); expect(got).to.eql([0.5, 0.5]); }); @@ -31,24 +31,24 @@ describe('ol.geom.flat.center', function() { ] ]); var got = ol.geom.flat.center.linearRingss( - squareMultiPoly.flatCoordinates, - 0, - squareMultiPoly.endss_, - 2 + squareMultiPoly.flatCoordinates, + 0, + squareMultiPoly.endss_, + 2 ); expect(got).to.eql([0.5, 0.5, 3.5, 0.5]); }); it('does not care about holes', function() { var polywithHole = new ol.geom.MultiPolygon([[ - [[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]], - [[1, 1], [1, 4], [4, 4], [4, 1], [1, 1]] + [[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]], + [[1, 1], [1, 4], [4, 4], [4, 1], [1, 1]] ]]); var got = ol.geom.flat.center.linearRingss( - polywithHole.flatCoordinates, - 0, - polywithHole.endss_, - 2 + polywithHole.flatCoordinates, + 0, + polywithHole.endss_, + 2 ); expect(got).to.eql([2.5, 2.5]); }); diff --git a/test/spec/ol/geom/flat/interpolate.test.js b/test/spec/ol/geom/flat/interpolate.test.js index 45745e4ec92..cdb4e5b8710 100644 --- a/test/spec/ol/geom/flat/interpolate.test.js +++ b/test/spec/ol/geom/flat/interpolate.test.js @@ -23,12 +23,12 @@ describe('ol.geom.flat.interpolate', function() { it('returns the expected value when the mid point is an existing ' + 'coordinate', - function() { - var flatCoordinates = [0, 1, 2, 3, 4, 5]; - var point = ol.geom.flat.interpolate.lineString( - flatCoordinates, 0, 6, 2, 0.5); - expect(point).to.eql([2, 3]); - }); + function() { + var flatCoordinates = [0, 1, 2, 3, 4, 5]; + var point = ol.geom.flat.interpolate.lineString( + flatCoordinates, 0, 6, 2, 0.5); + expect(point).to.eql([2, 3]); + }); xit('also when vertices are repeated', function() { var flatCoordinates = [0, 1, 2, 3, 2, 3, 4, 5]; @@ -39,12 +39,12 @@ describe('ol.geom.flat.interpolate', function() { it('returns the expected value when the midpoint falls halfway between ' + 'two existing coordinates', - function() { - var flatCoordinates = [0, 1, 2, 3, 4, 5, 6, 7]; - var point = ol.geom.flat.interpolate.lineString( - flatCoordinates, 0, 8, 2, 0.5); - expect(point).to.eql([3, 4]); - }); + function() { + var flatCoordinates = [0, 1, 2, 3, 4, 5, 6, 7]; + var point = ol.geom.flat.interpolate.lineString( + flatCoordinates, 0, 8, 2, 0.5); + expect(point).to.eql([3, 4]); + }); xit('also when vertices are repeated', function() { var flatCoordinates = [0, 1, 2, 3, 2, 3, 4, 5, 6, 7]; diff --git a/test/spec/ol/geom/flat/intersectsextent.test.js b/test/spec/ol/geom/flat/intersectsextent.test.js index 916a8f68ca0..c0a7f5f0a80 100644 --- a/test/spec/ol/geom/flat/intersectsextent.test.js +++ b/test/spec/ol/geom/flat/intersectsextent.test.js @@ -74,14 +74,14 @@ describe('ol.geom.flat.intersectsextent', function() { }); describe('boundary does not intersect the extent and ring does not ' + 'contain a corner of the extent', - function() { - it('returns false', function() { - var extent = [2.0, 0.5, 3, 1.5]; - var r = ol.geom.flat.intersectsextent.linearRing( - flatCoordinates, 0, flatCoordinates.length, 2, extent); - expect(r).to.be(false); - }); - }); + function() { + it('returns false', function() { + var extent = [2.0, 0.5, 3, 1.5]; + var r = ol.geom.flat.intersectsextent.linearRing( + flatCoordinates, 0, flatCoordinates.length, 2, extent); + expect(r).to.be(false); + }); + }); describe('ring contains the extent', function() { it('returns true', function() { var extent = [0.75, -0.25, 1.25, 0.25]; diff --git a/test/spec/ol/interaction/modify.test.js b/test/spec/ol/interaction/modify.test.js index f22a10a9da8..8abd5861ab2 100644 --- a/test/spec/ol/interaction/modify.test.js +++ b/test/spec/ol/interaction/modify.test.js @@ -217,7 +217,7 @@ describe('ol.interaction.Modify', function() { it('deletes first vertex of a LineString', function() { var lineFeature = new ol.Feature({ geometry: new ol.geom.LineString( - [[0, 0], [10, 20], [0, 40], [40, 40], [40, 0]] + [[0, 0], [10, 20], [0, 40], [40, 40], [40, 0]] ) }); features.length = 0; @@ -253,7 +253,7 @@ describe('ol.interaction.Modify', function() { it('deletes last vertex of a LineString', function() { var lineFeature = new ol.Feature({ geometry: new ol.geom.LineString( - [[0, 0], [10, 20], [0, 40], [40, 40], [40, 0]] + [[0, 0], [10, 20], [0, 40], [40, 40], [40, 0]] ) }); features.length = 0; @@ -289,7 +289,7 @@ describe('ol.interaction.Modify', function() { it('deletes vertex of a LineString programmatically', function() { var lineFeature = new ol.Feature({ geometry: new ol.geom.LineString( - [[0, 0], [10, 20], [0, 40], [40, 40], [40, 0]] + [[0, 0], [10, 20], [0, 40], [40, 40], [40, 0]] ) }); features.length = 0; @@ -331,7 +331,7 @@ describe('ol.interaction.Modify', function() { it('keeps the third dimension', function() { var lineFeature = new ol.Feature({ geometry: new ol.geom.LineString( - [[0, 0, 10], [10, 20, 20], [0, 40, 30], [40, 40, 40], [40, 0, 50]] + [[0, 0, 10], [10, 20, 20], [0, 40, 30], [40, 40, 40], [40, 0, 50]] ) }); features.length = 0; diff --git a/test/spec/ol/interaction/translate.test.js b/test/spec/ol/interaction/translate.test.js index 9f8a0c7d9c4..84dcb59ab42 100644 --- a/test/spec/ol/interaction/translate.test.js +++ b/test/spec/ol/interaction/translate.test.js @@ -32,8 +32,8 @@ describe('ol.interaction.Translate', function() { features = [new ol.Feature({ geometry: new ol.geom.Point([10, -20]) }), new ol.Feature({ - geometry: new ol.geom.Point([20, -30]) - })]; + geometry: new ol.geom.Point([20, -30]) + })]; source.addFeatures(features); var layer = new ol.layer.Vector({source: source}); map = new ol.Map({ diff --git a/test/spec/ol/proj/index.test.js b/test/spec/ol/proj/index.test.js index 122e6b996f6..200cfddbc02 100644 --- a/test/spec/ol/proj/index.test.js +++ b/test/spec/ol/proj/index.test.js @@ -55,13 +55,13 @@ describe('ol.proj', function() { it('gives that CRS:84, urn:ogc:def:crs:EPSG:6.6:4326, EPSG:4326 are ' + 'equivalent', - function() { - _testAllEquivalent([ - 'CRS:84', - 'urn:ogc:def:crs:EPSG:6.6:4326', - 'EPSG:4326' - ]); - }); + function() { + _testAllEquivalent([ + 'CRS:84', + 'urn:ogc:def:crs:EPSG:6.6:4326', + 'EPSG:4326' + ]); + }); it('requires code and units to be equal for projection evquivalence', function() { diff --git a/test/spec/ol/render/webgl/linestringreplay.test.js b/test/spec/ol/render/webgl/linestringreplay.test.js index 219a26a1c9c..073e50b6f3b 100644 --- a/test/spec/ol/render/webgl/linestringreplay.test.js +++ b/test/spec/ol/render/webgl/linestringreplay.test.js @@ -84,8 +84,8 @@ describe('ol.render.webgl.LineStringReplay', function() { var multilinestring; multilinestring = new ol.geom.MultiLineString( - [[[1000, 2000], [2000, 3000]], - [[1000, 3000], [2000, 4000], [3000, 3000]]]); + [[[1000, 2000], [2000, 3000]], + [[1000, 3000], [2000, 4000], [3000, 3000]]]); replay.setFillStrokeStyle(null, strokeStyle1); replay.drawMultiLineString(multilinestring, null); expect(replay.vertices).to.have.length(140); @@ -114,9 +114,9 @@ describe('ol.render.webgl.LineStringReplay', function() { replay.drawCoordinates_(flatCoordinates, 0, flatCoordinates.length, 2); expect(replay.indices).to.eql( - [2, 0, 1, 4, 2, 1, - 2, 4, 3, - 5, 3, 4, 4, 6, 5]); + [2, 0, 1, 4, 2, 1, + 2, 4, 3, + 5, 3, 4, 4, 6, 5]); }); it('optionally creates miters', function() { @@ -134,9 +134,9 @@ describe('ol.render.webgl.LineStringReplay', function() { replay.drawCoordinates_(flatCoordinates, 0, flatCoordinates.length, 2); expect(replay.indices).to.eql( - [2, 0, 1, 4, 2, 1, - 2, 4, 3, 3, 5, 2, - 6, 3, 4, 4, 7, 6]); + [2, 0, 1, 4, 2, 1, + 2, 4, 3, 3, 5, 2, + 6, 3, 4, 4, 7, 6]); }); it('optionally creates caps', function() { @@ -153,11 +153,11 @@ describe('ol.render.webgl.LineStringReplay', function() { replay.drawCoordinates_(flatCoordinates, 0, flatCoordinates.length, 2); expect(replay.indices).to.eql( - [2, 0, 1, 1, 3, 2, - 4, 2, 3, 6, 4, 3, - 4, 6, 5, 5, 7, 4, - 8, 5, 6, 6, 9, 8, - 10, 8, 9, 9, 11, 10]); + [2, 0, 1, 1, 3, 2, + 4, 2, 3, 6, 4, 3, + 4, 6, 5, 5, 7, 4, + 8, 5, 6, 6, 9, 8, + 10, 8, 9, 9, 11, 10]); }); it('respects segment orientation', function() { @@ -176,9 +176,9 @@ describe('ol.render.webgl.LineStringReplay', function() { replay.drawCoordinates_(flatCoordinates, 0, flatCoordinates.length, 2); expect(replay.indices).to.eql( - [2, 0, 1, 4, 2, 0, - 2, 4, 3, - 5, 3, 4, 4, 6, 5]); + [2, 0, 1, 4, 2, 0, + 2, 4, 3, + 5, 3, 4, 4, 6, 5]); }); it('closes boundaries', function() { @@ -197,12 +197,12 @@ describe('ol.render.webgl.LineStringReplay', function() { replay.drawCoordinates_(flatCoordinates, 0, flatCoordinates.length, 2); expect(replay.indices).to.eql( - [0, 2, 1, 3, 1, 2, - 5, 3, 2, - 3, 5, 4, 6, 4, 5, - 8, 6, 5, - 6, 8, 7, 9, 7, 8, - 10, 9, 8]); + [0, 2, 1, 3, 1, 2, + 5, 3, 2, + 3, 5, 4, 6, 4, 5, + 8, 6, 5, + 6, 8, 7, 9, 7, 8, + 10, 9, 8]); expect(replay.vertices.slice(0, 7)).to.eql( replay.vertices.slice(-14, -7)); expect(replay.vertices.slice(14, 21)).to.eql( diff --git a/test/spec/ol/render/webgl/polygonreplay.test.js b/test/spec/ol/render/webgl/polygonreplay.test.js index d67431fc599..92ff160822d 100644 --- a/test/spec/ol/render/webgl/polygonreplay.test.js +++ b/test/spec/ol/render/webgl/polygonreplay.test.js @@ -35,7 +35,7 @@ describe('ol.render.webgl.PolygonReplay', function() { it('sets the buffer data', function() { var polygon1 = new ol.geom.Polygon( [[[1000, 2000], [1200, 2000], [1200, 3000]]] - ); + ); replay.drawPolygon(polygon1, null); expect(replay.vertices).to.have.length(8); expect(replay.indices).to.have.length(3); @@ -46,7 +46,7 @@ describe('ol.render.webgl.PolygonReplay', function() { var polygon2 = new ol.geom.Polygon( [[[4000, 2000], [4200, 2000], [4200, 3000]]] - ); + ); replay.drawPolygon(polygon2, null); expect(replay.vertices).to.have.length(16); expect(replay.indices).to.have.length(6); diff --git a/test/spec/ol/source/imagewms.test.js b/test/spec/ol/source/imagewms.test.js index 207929b3dbc..5269db772b3 100644 --- a/test/spec/ol/source/imagewms.test.js +++ b/test/spec/ol/source/imagewms.test.js @@ -164,16 +164,16 @@ describe('ol.source.ImageWMS', function() { }); it('rounds FORMAT_OPTIONS to an integer when the server is GeoServer', - function() { - options.serverType = 'geoserver'; - var source = new ol.source.ImageWMS(options); - pixelRatio = 1.325; - var image = + function() { + options.serverType = 'geoserver'; + var source = new ol.source.ImageWMS(options); + pixelRatio = 1.325; + var image = source.getImage(extent, resolution, pixelRatio, projection); - var uri = new URL(image.src_); - var queryData = uri.searchParams; - expect(queryData.get('FORMAT_OPTIONS')).to.be('dpi:119'); - }); + var uri = new URL(image.src_); + var queryData = uri.searchParams; + expect(queryData.get('FORMAT_OPTIONS')).to.be('dpi:119'); + }); it('sets DPI when the server is QGIS', function() { options.serverType = 'qgis'; diff --git a/test/spec/ol/source/tileutfgrid.test.js b/test/spec/ol/source/tileutfgrid.test.js index c585b0e207f..519c18b6a95 100644 --- a/test/spec/ol/source/tileutfgrid.test.js +++ b/test/spec/ol/source/tileutfgrid.test.js @@ -119,7 +119,7 @@ describe('ol.source.TileUTFGrid', function() { var proj3857 = ol.proj.get('EPSG:3857'); var expectedExtent4326 = tileJson.bounds; var expectedExtent3857 = ol.proj.transformExtent( - expectedExtent4326, proj4326, proj3857 + expectedExtent4326, proj4326, proj3857 ); expect(extent).to.eql(proj3857.getExtent()); expect(extent[0]).to.roughlyEqual(expectedExtent3857[0], 1e-8); @@ -261,7 +261,7 @@ describe('ol.source.TileUTFGrid', function() { done(); }; source.forDataAtCoordinateAndResolution( - bonn3857, resolutionZoom1, callback, null, true + bonn3857, resolutionZoom1, callback, null, true ); }); @@ -272,7 +272,7 @@ describe('ol.source.TileUTFGrid', function() { done(); }; source.forDataAtCoordinateAndResolution( - bonn3857, resolutionZoom1, callback, scope, true + bonn3857, resolutionZoom1, callback, scope, true ); }); @@ -283,7 +283,7 @@ describe('ol.source.TileUTFGrid', function() { done(); }; source.forDataAtCoordinateAndResolution( - noState3857, resolutionZoom1, callback, null, true + noState3857, resolutionZoom1, callback, null, true ); }); diff --git a/test/spec/ol/source/tilewms.test.js b/test/spec/ol/source/tilewms.test.js index 6f57355081f..a4edebccad7 100644 --- a/test/spec/ol/source/tilewms.test.js +++ b/test/spec/ol/source/tilewms.test.js @@ -143,14 +143,14 @@ describe('ol.source.TileWMS', function() { }); it('rounds FORMAT_OPTIONS to an integer when the server is GeoServer', - function() { - options.serverType = 'geoserver'; - var source = new ol.source.TileWMS(options); - var tile = source.getTile(3, 2, -3, 1.325, ol.proj.get('CRS:84')); - var uri = new URL(tile.src_); - var queryData = uri.searchParams; - expect(queryData.get('FORMAT_OPTIONS')).to.be('dpi:119'); - }); + function() { + options.serverType = 'geoserver'; + var source = new ol.source.TileWMS(options); + var tile = source.getTile(3, 2, -3, 1.325, ol.proj.get('CRS:84')); + var uri = new URL(tile.src_); + var queryData = uri.searchParams; + expect(queryData.get('FORMAT_OPTIONS')).to.be('dpi:119'); + }); }); diff --git a/test/spec/ol/source/wmts.test.js b/test/spec/ol/source/wmts.test.js index 7d734eb9bb7..fcbec0d4e79 100644 --- a/test/spec/ol/source/wmts.test.js +++ b/test/spec/ol/source/wmts.test.js @@ -208,7 +208,7 @@ describe('ol.source.WMTS', function() { expect(options.urls).to.be.an('array'); expect(options.urls).to.have.length(1); expect(options.urls[0]).to.be.eql( - 'https://services.arcgisonline.com/arcgis/rest/services/' + + 'https://services.arcgisonline.com/arcgis/rest/services/' + 'Demographics/USA_Population_Density/MapServer/WMTS?'); }); @@ -223,7 +223,7 @@ describe('ol.source.WMTS', function() { expect(options.urls).to.be.an('array'); expect(options.urls).to.have.length(1); expect(options.urls[0]).to.be.eql( - 'https://services.arcgisonline.com/arcgis/rest/services/' + + 'https://services.arcgisonline.com/arcgis/rest/services/' + 'Demographics/USA_Population_Density/MapServer/WMTS/' + 'tile/1.0.0/Demographics_USA_Population_Density/' + '{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png'); diff --git a/test/spec/ol/tilegrid/wmts.test.js b/test/spec/ol/tilegrid/wmts.test.js index 4434741f166..498594f61b1 100644 --- a/test/spec/ol/tilegrid/wmts.test.js +++ b/test/spec/ol/tilegrid/wmts.test.js @@ -61,97 +61,97 @@ describe('ol.tilegrid.WMTS', function() { describe('when creating tileGrid from capabilities with and without TileMatrixSetLimits', - function() { - var parser = new ol.format.WMTSCapabilities(); - var capabilities; - before(function(done) { - afterLoadText('spec/ol/format/wmts/ign.xml', function(xml) { - try { - capabilities = parser.read(xml); - } catch (e) { - done(e); - } - done(); + function() { + var parser = new ol.format.WMTSCapabilities(); + var capabilities; + before(function(done) { + afterLoadText('spec/ol/format/wmts/ign.xml', function(xml) { + try { + capabilities = parser.read(xml); + } catch (e) { + done(e); + } + done(); + }); }); - }); - - it('can create tileGrid for EPSG:3857 without matrixLimits', - function() { - var matrixSetObj = capabilities.Contents.TileMatrixSet[0]; - var tileGrid; - tileGrid = ol.tilegrid.WMTS.createFromCapabilitiesMatrixSet( - matrixSetObj); - expect(tileGrid.matrixIds_).to.be.an('array'); - expect(tileGrid.matrixIds_).to.have.length(22); - expect(tileGrid.matrixIds_).to.eql([ - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', - '12', '13', '14', '15', '16', '17', '18', '19', '20', '21' - ]); - - expect(tileGrid.resolutions_).to.be.an('array'); - expect(tileGrid.resolutions_).to.have.length(22); - expect(tileGrid.resolutions_).to.eql([ - 156543.033928041, 78271.51696402048, 39135.758482010235, - 19567.87924100512, 9783.93962050256, 4891.96981025128, - 2445.98490512564, 1222.99245256282, 611.49622628141, - 305.7481131407048, 152.8740565703525, 76.43702828517624, - 38.21851414258813, 19.10925707129406, 9.554628535647032, - 4.777314267823516, 2.388657133911758, 1.194328566955879, - 0.5971642834779395, 0.2985821417389697, 0.1492910708694849, - 0.0746455354347424 - ]); - - expect(tileGrid.origins_).to.be.an('array'); - expect(tileGrid.origins_).to.have.length(22); - expect(tileGrid.origins_).to.eql( - Array.apply(null, Array(22)).map(Array.prototype.valueOf, - [-20037508, 20037508])); - - expect(tileGrid.tileSizes_).to.be.an('array'); - expect(tileGrid.tileSizes_).to.have.length(22); - expect(tileGrid.tileSizes_).to.eql( - Array.apply(null, Array(22)).map(Number.prototype.valueOf, 256)); - - }); - - it('can create tileGrid for EPSG:3857 with matrixLimits', - function() { - var matrixSetObj = capabilities.Contents.TileMatrixSet[0]; - var matrixLimitArray = capabilities.Contents.Layer[0] - .TileMatrixSetLink[0].TileMatrixSetLimits; - var tileGrid; - tileGrid = ol.tilegrid.WMTS.createFromCapabilitiesMatrixSet( - matrixSetObj, undefined, matrixLimitArray); - expect(tileGrid.matrixIds_).to.be.an('array'); - expect(tileGrid.matrixIds_).to.have.length(20); - expect(tileGrid.matrixIds_).to.eql([ - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', - '12', '13', '14', '15', '16', '17', '18', '19' - ]); - - expect(tileGrid.resolutions_).to.be.an('array'); - expect(tileGrid.resolutions_).to.have.length(20); - expect(tileGrid.resolutions_).to.eql([ - 156543.033928041, 78271.51696402048, 39135.758482010235, - 19567.87924100512, 9783.93962050256, 4891.96981025128, - 2445.98490512564, 1222.99245256282, 611.49622628141, - 305.7481131407048, 152.8740565703525, 76.43702828517624, - 38.21851414258813, 19.10925707129406, 9.554628535647032, - 4.777314267823516, 2.388657133911758, 1.194328566955879, - 0.5971642834779395, 0.2985821417389697 - ]); - expect(tileGrid.origins_).to.be.an('array'); - expect(tileGrid.origins_).to.have.length(20); - expect(tileGrid.origins_).to.eql( - Array.apply(null, Array(20)).map(Array.prototype.valueOf, - [-20037508, 20037508])); - - expect(tileGrid.tileSizes_).to.be.an('array'); - expect(tileGrid.tileSizes_).to.have.length(20); - expect(tileGrid.tileSizes_).to.eql( - Array.apply(null, Array(20)).map(Number.prototype.valueOf, 256)); - - }); - }); + it('can create tileGrid for EPSG:3857 without matrixLimits', + function() { + var matrixSetObj = capabilities.Contents.TileMatrixSet[0]; + var tileGrid; + tileGrid = ol.tilegrid.WMTS.createFromCapabilitiesMatrixSet( + matrixSetObj); + expect(tileGrid.matrixIds_).to.be.an('array'); + expect(tileGrid.matrixIds_).to.have.length(22); + expect(tileGrid.matrixIds_).to.eql([ + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', + '12', '13', '14', '15', '16', '17', '18', '19', '20', '21' + ]); + + expect(tileGrid.resolutions_).to.be.an('array'); + expect(tileGrid.resolutions_).to.have.length(22); + expect(tileGrid.resolutions_).to.eql([ + 156543.033928041, 78271.51696402048, 39135.758482010235, + 19567.87924100512, 9783.93962050256, 4891.96981025128, + 2445.98490512564, 1222.99245256282, 611.49622628141, + 305.7481131407048, 152.8740565703525, 76.43702828517624, + 38.21851414258813, 19.10925707129406, 9.554628535647032, + 4.777314267823516, 2.388657133911758, 1.194328566955879, + 0.5971642834779395, 0.2985821417389697, 0.1492910708694849, + 0.0746455354347424 + ]); + + expect(tileGrid.origins_).to.be.an('array'); + expect(tileGrid.origins_).to.have.length(22); + expect(tileGrid.origins_).to.eql( + Array.apply(null, Array(22)).map(Array.prototype.valueOf, + [-20037508, 20037508])); + + expect(tileGrid.tileSizes_).to.be.an('array'); + expect(tileGrid.tileSizes_).to.have.length(22); + expect(tileGrid.tileSizes_).to.eql( + Array.apply(null, Array(22)).map(Number.prototype.valueOf, 256)); + + }); + + it('can create tileGrid for EPSG:3857 with matrixLimits', + function() { + var matrixSetObj = capabilities.Contents.TileMatrixSet[0]; + var matrixLimitArray = capabilities.Contents.Layer[0] + .TileMatrixSetLink[0].TileMatrixSetLimits; + var tileGrid; + tileGrid = ol.tilegrid.WMTS.createFromCapabilitiesMatrixSet( + matrixSetObj, undefined, matrixLimitArray); + expect(tileGrid.matrixIds_).to.be.an('array'); + expect(tileGrid.matrixIds_).to.have.length(20); + expect(tileGrid.matrixIds_).to.eql([ + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', + '12', '13', '14', '15', '16', '17', '18', '19' + ]); + + expect(tileGrid.resolutions_).to.be.an('array'); + expect(tileGrid.resolutions_).to.have.length(20); + expect(tileGrid.resolutions_).to.eql([ + 156543.033928041, 78271.51696402048, 39135.758482010235, + 19567.87924100512, 9783.93962050256, 4891.96981025128, + 2445.98490512564, 1222.99245256282, 611.49622628141, + 305.7481131407048, 152.8740565703525, 76.43702828517624, + 38.21851414258813, 19.10925707129406, 9.554628535647032, + 4.777314267823516, 2.388657133911758, 1.194328566955879, + 0.5971642834779395, 0.2985821417389697 + ]); + + expect(tileGrid.origins_).to.be.an('array'); + expect(tileGrid.origins_).to.have.length(20); + expect(tileGrid.origins_).to.eql( + Array.apply(null, Array(20)).map(Array.prototype.valueOf, + [-20037508, 20037508])); + + expect(tileGrid.tileSizes_).to.be.an('array'); + expect(tileGrid.tileSizes_).to.have.length(20); + expect(tileGrid.tileSizes_).to.eql( + Array.apply(null, Array(20)).map(Number.prototype.valueOf, 256)); + + }); + }); }); diff --git a/test/spec/ol/tilequeue.test.js b/test/spec/ol/tilequeue.test.js index 87c40ed956f..25b40b3e309 100644 --- a/test/spec/ol/tilequeue.test.js +++ b/test/spec/ol/tilequeue.test.js @@ -29,7 +29,7 @@ describe('ol.TileQueue', function() { 'yH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==#' + tileId; var tileLoadFunction = opt_tileLoadFunction ? - opt_tileLoadFunction : ol.source.Image.defaultImageLoadFunction; + opt_tileLoadFunction : ol.source.Image.defaultImageLoadFunction; return new ol.ImageTile(tileCoord, state, src, null, tileLoadFunction); } diff --git a/test/spec/ol/vec/mat4.test.js b/test/spec/ol/vec/mat4.test.js index 7d055fe9600..bbaa64e1e87 100644 --- a/test/spec/ol/vec/mat4.test.js +++ b/test/spec/ol/vec/mat4.test.js @@ -8,7 +8,7 @@ describe('ol.vec.Mat4', function() { describe('ol.vec.Mat4.create()', function() { it('returns the expected matrix', function() { expect(ol.vec.Mat4.create()).to.eql( - [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]); + [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]); }); }); diff --git a/test/spec/ol/view.test.js b/test/spec/ol/view.test.js index 23282a5966c..80356edd87d 100644 --- a/test/spec/ol/view.test.js +++ b/test/spec/ol/view.test.js @@ -1160,13 +1160,13 @@ describe('ol.View', function() { }); it('animates when duration is defined', function(done) { view.fit( - new ol.geom.LineString([[6000, 46000], [6000, 47100], [7000, 46000]]), - { - size: [200, 200], - padding: [100, 0, 0, 100], - constrainResolution: false, - duration: 25 - }); + new ol.geom.LineString([[6000, 46000], [6000, 47100], [7000, 46000]]), + { + size: [200, 200], + padding: [100, 0, 0, 100], + constrainResolution: false, + duration: 25 + }); expect(view.getAnimating()).to.eql(true); diff --git a/test/test-extensions.js b/test/test-extensions.js index 2bc48207d0d..a5245eaddd9 100644 --- a/test/test-extensions.js +++ b/test/test-extensions.js @@ -389,25 +389,25 @@ } resemble(referenceImage) - .compareTo(canvas.getContext('2d').getImageData( - 0, 0, canvas.width, canvas.height)) - .onComplete(function(data) { - if (!data.isSameDimensions) { - expect().fail( - 'The dimensions of the reference image and ' + + .compareTo(canvas.getContext('2d').getImageData( + 0, 0, canvas.width, canvas.height)) + .onComplete(function(data) { + if (!data.isSameDimensions) { + expect().fail( + 'The dimensions of the reference image and ' + 'the test canvas are not the same.'); - } + } - if (data.misMatchPercentage > tolerance) { - if (showDiff) { - var diffImage = new Image(); - diffImage.src = data.getImageDataUrl(); - document.body.appendChild(diffImage); + if (data.misMatchPercentage > tolerance) { + if (showDiff) { + var diffImage = new Image(); + diffImage.src = data.getImageDataUrl(); + document.body.appendChild(diffImage); + } + expect(data.misMatchPercentage).to.be.below(tolerance); } - expect(data.misMatchPercentage).to.be.below(tolerance); - } - done(); - }); + done(); + }); } global.resembleCanvas = resembleCanvas; @@ -457,7 +457,7 @@ expectResembleWebGL(map, referenceImage, tolerance, done); } else { expect().fail( - 'resemble only works with the canvas and WebGL renderer.'); + 'resemble only works with the canvas and WebGL renderer.'); } }; diff --git a/test_rendering/spec/ol/reproj/tile.test.js b/test_rendering/spec/ol/reproj/tile.test.js index cce2b29035c..ba850e1005a 100644 --- a/test_rendering/spec/ol/reproj/tile.test.js +++ b/test_rendering/spec/ol/reproj/tile.test.js @@ -11,7 +11,7 @@ goog.require('ol.tilegrid'); describe('ol.rendering.reproj.Tile', function() { function testSingleTile(source, targetProjection, targetTileGrid, z, x, y, - pixelRatio, expectedUrl, expectedRequests, done) { + pixelRatio, expectedUrl, expectedRequests, done) { var sourceProjection = source.getProjection(); var sourceGutter = source.getGutter(sourceProjection); @@ -47,13 +47,13 @@ describe('ol.rendering.reproj.Tile', function() { it('works for identity reprojection', function(done) { testSingleTile(source, 'EPSG:3857', source.getTileGrid(), 5, 5, -13, 1, - 'spec/ol/data/tiles/osm/5/5/12.png', 1, done); + 'spec/ol/data/tiles/osm/5/5/12.png', 1, done); }); it('to EPSG:4326', function(done) { var tileGrid = ol.tilegrid.createForProjection('EPSG:4326', 7, [64, 64]); testSingleTile(source, 'EPSG:4326', tileGrid, 7, 21, -20, 1, - 'spec/ol/reproj/expected/osm4326.png', 1, done); + 'spec/ol/reproj/expected/osm4326.png', 1, done); }); it('to EPSG:5070', function(done) { @@ -65,7 +65,7 @@ describe('ol.rendering.reproj.Tile', function() { var tileGrid = ol.tilegrid.createForProjection('EPSG:5070', 5, [64, 64]); testSingleTile(source, 'EPSG:5070', tileGrid, 5, 13, -15, 1, - 'spec/ol/reproj/expected/osm5070.png', 1, done); + 'spec/ol/reproj/expected/osm5070.png', 1, done); }); it('to ESRI:54009', function(done) { @@ -76,7 +76,7 @@ describe('ol.rendering.reproj.Tile', function() { var tileGrid = ol.tilegrid.createForProjection('ESRI:54009', 7, [64, 64]); testSingleTile(source, 'ESRI:54009', tileGrid, 7, 27, -16, 1, - 'spec/ol/reproj/expected/osm54009.png', 1, done); + 'spec/ol/reproj/expected/osm54009.png', 1, done); }); }); @@ -91,7 +91,7 @@ describe('ol.rendering.reproj.Tile', function() { it('to EPSG:4326', function(done) { var tileGrid = ol.tilegrid.createForProjection('EPSG:4326', 7, [64, 64]); testSingleTile(source, 'EPSG:4326', tileGrid, 7, 23, -21, 1, - 'spec/ol/reproj/expected/stitch-osm4326.png', 2, done); + 'spec/ol/reproj/expected/stitch-osm4326.png', 2, done); }); it('to EPSG:3740', function(done) { @@ -103,7 +103,7 @@ describe('ol.rendering.reproj.Tile', function() { var tileGrid = ol.tilegrid.createForProjection('EPSG:3740', 4, [64, 64]); testSingleTile(source, 'EPSG:3740', tileGrid, 4, 4, -13, 1, - 'spec/ol/reproj/expected/stitch-osm3740.png', 4, done); + 'spec/ol/reproj/expected/stitch-osm3740.png', 4, done); }); }); @@ -118,13 +118,13 @@ describe('ol.rendering.reproj.Tile', function() { it('works for identity reprojection', function(done) { testSingleTile(source, 'EPSG:4326', source.getTileGrid(), 0, 0, -1, 1, - 'spec/ol/data/tiles/4326/0/0/0.png', 1, done); + 'spec/ol/data/tiles/4326/0/0/0.png', 1, done); }); it('to EPSG:3857', function(done) { var tileGrid = ol.tilegrid.createForProjection('EPSG:3857', 0, [64, 64]); testSingleTile(source, 'EPSG:3857', tileGrid, 0, 0, -1, 1, - 'spec/ol/reproj/expected/4326-to-3857.png', 1, done); + 'spec/ol/reproj/expected/4326-to-3857.png', 1, done); }); }); @@ -139,13 +139,13 @@ describe('ol.rendering.reproj.Tile', function() { it('works for identity reprojection', function(done) { testSingleTile(source, 'EPSG:3857', source.getTileGrid(), 5, 3, -13, 1, - 'spec/ol/data/tiles/osm-512x256/5/3/12.png', 1, done); + 'spec/ol/data/tiles/osm-512x256/5/3/12.png', 1, done); }); it('to 64x128 EPSG:4326', function(done) { var tileGrid = ol.tilegrid.createForProjection('EPSG:4326', 7, [64, 128]); testSingleTile(source, 'EPSG:4326', tileGrid, 7, 27, -10, 1, - 'spec/ol/reproj/expected/512x256-to-64x128.png', 1, done); + 'spec/ol/reproj/expected/512x256-to-64x128.png', 1, done); }); }); @@ -165,7 +165,7 @@ describe('ol.rendering.reproj.Tile', function() { var tileGrid = ol.tilegrid.createForProjection('merc_180', 0, [64, 64]); testSingleTile(source, 'merc_180', tileGrid, 0, 0, -1, 1, - 'spec/ol/reproj/expected/dateline-merc-180.png', 2, done); + 'spec/ol/reproj/expected/dateline-merc-180.png', 2, done); }); it('displays north pole correctly (EPSG:3413)', function(done) { @@ -176,7 +176,7 @@ describe('ol.rendering.reproj.Tile', function() { var tileGrid = ol.tilegrid.createForProjection('EPSG:3413', 0, [64, 64]); testSingleTile(source, 'EPSG:3413', tileGrid, 0, 0, -1, 1, - 'spec/ol/reproj/expected/dateline-pole.png', 2, done); + 'spec/ol/reproj/expected/dateline-pole.png', 2, done); }); }); }); diff --git a/test_rendering/spec/ol/style/linestring.test.js b/test_rendering/spec/ol/style/linestring.test.js index 344b597bfb4..182ba7448c3 100644 --- a/test_rendering/spec/ol/style/linestring.test.js +++ b/test_rendering/spec/ol/style/linestring.test.js @@ -72,8 +72,8 @@ describe('ol.rendering.style.LineString', function() { feature.setStyle([new ol.style.Style({ stroke: new ol.style.Stroke({color: '#F2F211', width: 5}) }), new ol.style.Style({ - stroke: new ol.style.Stroke({color: '#292921', width: 1}) - })]); + stroke: new ol.style.Stroke({color: '#292921', width: 1}) + })]); vectorSource.addFeature(feature); feature = new ol.Feature({ diff --git a/test_rendering/test.js b/test_rendering/test.js index 6ebeb0cfffc..98a048cf033 100644 --- a/test_rendering/test.js +++ b/test_rendering/test.js @@ -28,9 +28,9 @@ page.open(url).then(function(status) { console.log('Writing coverage to coverage/coverage-rendering.json'); var fs = require('fs'); fs.write( - fs.workingDirectory + '/coverage/coverage-rendering.json', - JSON.stringify(coverage), - 'w' + fs.workingDirectory + '/coverage/coverage-rendering.json', + JSON.stringify(coverage), + 'w' ); } console.log('All tests passed.'); From 7d6929c710fd6205a69de49cf1f0538dbe406e8f Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Tue, 20 Jun 2017 10:41:03 +0200 Subject: [PATCH 4/6] Manual adjustment of indentation --- src/ol/centerconstraint.js | 8 +- src/ol/color.js | 22 ++--- src/ol/colorlike.js | 4 +- src/ol/coordinate.js | 8 +- src/ol/events/event.js | 12 +-- src/ol/featureloader.js | 22 ++--- src/ol/format/esrijson.js | 8 +- src/ol/graticule.js | 84 +++++++++---------- src/ol/has.js | 4 +- src/ol/interaction/select.js | 22 ++--- src/ol/layer/vector.js | 34 ++++---- src/ol/proj.js | 12 +-- src/ol/proj/projection.js | 60 ++++++------- .../webgl/circlereplay/defaultshader.js | 8 +- .../render/webgl/imagereplay/defaultshader.js | 8 +- .../webgl/linestringreplay/defaultshader.js | 8 +- .../webgl/polygonreplay/defaultshader.js | 8 +- src/ol/renderer/layer.js | 10 +-- src/ol/renderer/webgl/defaultmapshader.js | 8 +- src/ol/renderer/webgl/tilelayer.js | 10 +-- src/ol/renderer/webgl/tilelayershader.js | 8 +- src/ol/resolutionconstraint.js | 24 +++--- src/ol/rotationconstraint.js | 20 ++--- src/ol/source/bingmaps.js | 12 +-- src/ol/source/wmts.js | 12 +-- src/ol/tileurlfunction.js | 24 +++--- src/ol/view.js | 16 ++-- src/ol/xml.js | 52 ++++++------ 28 files changed, 266 insertions(+), 262 deletions(-) diff --git a/src/ol/centerconstraint.js b/src/ol/centerconstraint.js index 17788495d88..abb55e654da 100644 --- a/src/ol/centerconstraint.js +++ b/src/ol/centerconstraint.js @@ -9,10 +9,10 @@ goog.require('ol.math'); */ ol.CenterConstraint.createExtent = function(extent) { return ( - /** - * @param {ol.Coordinate|undefined} center Center. - * @return {ol.Coordinate|undefined} Center. - */ + /** + * @param {ol.Coordinate|undefined} center Center. + * @return {ol.Coordinate|undefined} Center. + */ function(center) { if (center) { return [ diff --git a/src/ol/color.js b/src/ol/color.js index 37267295188..ca8fca14b43 100644 --- a/src/ol/color.js +++ b/src/ol/color.js @@ -79,26 +79,26 @@ ol.color.fromString = ( // arbitrary 25% of the entries. /** - * @const - * @type {number} - */ + * @const + * @type {number} + */ var MAX_CACHE_SIZE = 1024; /** - * @type {Object.} - */ + * @type {Object.} + */ var cache = {}; /** - * @type {number} - */ + * @type {number} + */ var cacheSize = 0; return ( - /** - * @param {string} s String. - * @return {ol.Color} Color. - */ + /** + * @param {string} s String. + * @return {ol.Color} Color. + */ function(s) { var color; if (cache.hasOwnProperty(s)) { diff --git a/src/ol/colorlike.js b/src/ol/colorlike.js index c00ec5ab5d3..07f1e16960b 100644 --- a/src/ol/colorlike.js +++ b/src/ol/colorlike.js @@ -24,7 +24,7 @@ ol.colorlike.asColorLike = function(color) { ol.colorlike.isColorLike = function(color) { return ( typeof color === 'string' || - color instanceof CanvasPattern || - color instanceof CanvasGradient + color instanceof CanvasPattern || + color instanceof CanvasGradient ); }; diff --git a/src/ol/coordinate.js b/src/ol/coordinate.js index af16fad0215..42c324fd09b 100644 --- a/src/ol/coordinate.js +++ b/src/ol/coordinate.js @@ -121,10 +121,10 @@ ol.coordinate.closestOnSegment = function(coordinate, segment) { */ ol.coordinate.createStringXY = function(opt_fractionDigits) { return ( - /** - * @param {ol.Coordinate|undefined} coordinate Coordinate. - * @return {string} String XY. - */ + /** + * @param {ol.Coordinate|undefined} coordinate Coordinate. + * @return {string} String XY. + */ function(coordinate) { return ol.coordinate.toStringXY(coordinate, opt_fractionDigits); }); diff --git a/src/ol/events/event.js b/src/ol/events/event.js index cee7aa9b612..c7c7713ba8f 100644 --- a/src/ol/events/event.js +++ b/src/ol/events/event.js @@ -47,12 +47,12 @@ ol.events.Event = function(type) { */ ol.events.Event.prototype.preventDefault = -/** - * Stop event propagation. - * @function - * @override - * @api - */ + /** + * Stop event propagation. + * @function + * @override + * @api + */ ol.events.Event.prototype.stopPropagation = function() { this.propagationStopped = true; }; diff --git a/src/ol/featureloader.js b/src/ol/featureloader.js index 45f46696aef..2441e4bc6e7 100644 --- a/src/ol/featureloader.js +++ b/src/ol/featureloader.js @@ -18,12 +18,12 @@ goog.require('ol.xml'); */ ol.featureloader.loadFeaturesXhr = function(url, format, success, failure) { return ( - /** - * @param {ol.Extent} extent Extent. - * @param {number} resolution Resolution. - * @param {ol.proj.Projection} projection Projection. - * @this {ol.source.Vector|ol.VectorTile} - */ + /** + * @param {ol.Extent} extent Extent. + * @param {number} resolution Resolution. + * @param {ol.proj.Projection} projection Projection. + * @this {ol.source.Vector|ol.VectorTile} + */ function(extent, resolution, projection) { var xhr = new XMLHttpRequest(); xhr.open('GET', @@ -33,9 +33,9 @@ ol.featureloader.loadFeaturesXhr = function(url, format, success, failure) { xhr.responseType = 'arraybuffer'; } /** - * @param {Event} event Event. - * @private - */ + * @param {Event} event Event. + * @private + */ xhr.onload = function(event) { // status will be 0 for file:// urls if (!xhr.status || xhr.status >= 200 && xhr.status < 300) { @@ -65,8 +65,8 @@ ol.featureloader.loadFeaturesXhr = function(url, format, success, failure) { } }.bind(this); /** - * @private - */ + * @private + */ xhr.onerror = function() { failure.call(this); }.bind(this); diff --git a/src/ol/format/esrijson.js b/src/ol/format/esrijson.js index 474494eb990..b1184656279 100644 --- a/src/ol/format/esrijson.js +++ b/src/ol/format/esrijson.js @@ -121,9 +121,11 @@ ol.format.EsriJSON.convertRings_ = function(rings, layout) { // loop over all outer rings and see if they contain our hole. for (i = outerRings.length - 1; i >= 0; i--) { var outerRing = outerRings[i][0]; - if (ol.extent.containsExtent(new ol.geom.LinearRing( - outerRing).getExtent(), - new ol.geom.LinearRing(hole).getExtent())) { + var containsHole = ol.extent.containsExtent( + new ol.geom.LinearRing(outerRing).getExtent(), + new ol.geom.LinearRing(hole).getExtent() + ); + if (containsHole) { // the hole is contained push it into our polygon outerRings[i].push(hole); matched = true; diff --git a/src/ol/graticule.js b/src/ol/graticule.js index e31668dd0a3..11c5e14af96 100644 --- a/src/ol/graticule.js +++ b/src/ol/graticule.js @@ -24,88 +24,88 @@ ol.Graticule = function(opt_options) { var options = opt_options || {}; /** - * @type {ol.Map} - * @private - */ + * @type {ol.Map} + * @private + */ this.map_ = null; /** - * @type {ol.proj.Projection} - * @private - */ + * @type {ol.proj.Projection} + * @private + */ this.projection_ = null; /** - * @type {number} - * @private - */ + * @type {number} + * @private + */ this.maxLat_ = Infinity; /** - * @type {number} - * @private - */ + * @type {number} + * @private + */ this.maxLon_ = Infinity; /** - * @type {number} - * @private - */ + * @type {number} + * @private + */ this.minLat_ = -Infinity; /** - * @type {number} - * @private - */ + * @type {number} + * @private + */ this.minLon_ = -Infinity; /** - * @type {number} - * @private - */ + * @type {number} + * @private + */ this.maxLatP_ = Infinity; /** - * @type {number} - * @private - */ + * @type {number} + * @private + */ this.maxLonP_ = Infinity; /** - * @type {number} - * @private - */ + * @type {number} + * @private + */ this.minLatP_ = -Infinity; /** - * @type {number} - * @private - */ + * @type {number} + * @private + */ this.minLonP_ = -Infinity; /** - * @type {number} - * @private - */ + * @type {number} + * @private + */ this.targetSize_ = options.targetSize !== undefined ? options.targetSize : 100; /** - * @type {number} - * @private - */ + * @type {number} + * @private + */ this.maxLines_ = options.maxLines !== undefined ? options.maxLines : 100; /** - * @type {Array.} - * @private - */ + * @type {Array.} + * @private + */ this.meridians_ = []; /** - * @type {Array.} - * @private - */ + * @type {Array.} + * @private + */ this.parallels_ = []; /** diff --git a/src/ol/has.js b/src/ol/has.js index e70c4a07981..e396a1dfc10 100644 --- a/src/ol/has.js +++ b/src/ol/has.js @@ -57,8 +57,8 @@ ol.has.CANVAS_LINE_DASH = false; */ ol.has.CANVAS = ol.ENABLE_CANVAS && ( /** - * @return {boolean} Canvas supported. - */ + * @return {boolean} Canvas supported. + */ function() { if (!('HTMLCanvasElement' in window)) { return false; diff --git a/src/ol/interaction/select.js b/src/ol/interaction/select.js index a55a5fad557..483884c811c 100644 --- a/src/ol/interaction/select.js +++ b/src/ol/interaction/select.js @@ -217,11 +217,12 @@ ol.interaction.Select.handleEvent = function(mapBrowserEvent) { // the pixel. ol.obj.clear(this.featureLayerAssociation_); map.forEachFeatureAtPixel(mapBrowserEvent.pixel, - (/** - * @param {ol.Feature|ol.render.Feature} feature Feature. - * @param {ol.layer.Layer} layer Layer. - * @return {boolean|undefined} Continue to iterate over the features. - */ + ( + /** + * @param {ol.Feature|ol.render.Feature} feature Feature. + * @param {ol.layer.Layer} layer Layer. + * @return {boolean|undefined} Continue to iterate over the features. + */ function(feature, layer) { if (this.filter_(feature, layer)) { selected.push(feature); @@ -250,11 +251,12 @@ ol.interaction.Select.handleEvent = function(mapBrowserEvent) { } else { // Modify the currently selected feature(s). map.forEachFeatureAtPixel(mapBrowserEvent.pixel, - (/** - * @param {ol.Feature|ol.render.Feature} feature Feature. - * @param {ol.layer.Layer} layer Layer. - * @return {boolean|undefined} Continue to iterate over the features. - */ + ( + /** + * @param {ol.Feature|ol.render.Feature} feature Feature. + * @param {ol.layer.Layer} layer Layer. + * @return {boolean|undefined} Continue to iterate over the features. + */ function(feature, layer) { if (this.filter_(feature, layer)) { if ((add || toggle) && diff --git a/src/ol/layer/vector.js b/src/ol/layer/vector.js index 3882958e365..0f24ad98538 100644 --- a/src/ol/layer/vector.js +++ b/src/ol/layer/vector.js @@ -35,39 +35,39 @@ ol.layer.Vector = function(opt_options) { ol.layer.Layer.call(this, /** @type {olx.layer.LayerOptions} */ (baseOptions)); /** - * @type {number} - * @private - */ + * @type {number} + * @private + */ this.renderBuffer_ = options.renderBuffer !== undefined ? options.renderBuffer : 100; /** - * User provided style. - * @type {ol.style.Style|Array.|ol.StyleFunction} - * @private - */ + * User provided style. + * @type {ol.style.Style|Array.|ol.StyleFunction} + * @private + */ this.style_ = null; /** - * Style function for use within the library. - * @type {ol.StyleFunction|undefined} - * @private - */ + * Style function for use within the library. + * @type {ol.StyleFunction|undefined} + * @private + */ this.styleFunction_ = undefined; this.setStyle(options.style); /** - * @type {boolean} - * @private - */ + * @type {boolean} + * @private + */ this.updateWhileAnimating_ = options.updateWhileAnimating !== undefined ? options.updateWhileAnimating : false; /** - * @type {boolean} - * @private - */ + * @type {boolean} + * @private + */ this.updateWhileInteracting_ = options.updateWhileInteracting !== undefined ? options.updateWhileInteracting : false; }; diff --git a/src/ol/proj.js b/src/ol/proj.js index fa5bdb3e7fe..b75e5c4715b 100644 --- a/src/ol/proj.js +++ b/src/ol/proj.js @@ -221,12 +221,12 @@ ol.proj.addCoordinateTransforms = function(source, destination, forward, inverse */ ol.proj.createTransformFromCoordinateTransform = function(transform) { return ( - /** - * @param {Array.} input Input. - * @param {Array.=} opt_output Output. - * @param {number=} opt_dimension Dimension. - * @return {Array.} Output. - */ + /** + * @param {Array.} input Input. + * @param {Array.=} opt_output Output. + * @param {number=} opt_dimension Dimension. + * @return {Array.} Output. + */ function(input, opt_output, opt_dimension) { var length = input.length; var dimension = opt_dimension !== undefined ? opt_dimension : 2; diff --git a/src/ol/proj/projection.js b/src/ol/proj/projection.js index 21f8db7841e..85edc64cefd 100644 --- a/src/ol/proj/projection.js +++ b/src/ol/proj/projection.js @@ -37,65 +37,65 @@ goog.require('ol.proj.proj4'); */ ol.proj.Projection = function(options) { /** - * @private - * @type {string} - */ + * @private + * @type {string} + */ this.code_ = options.code; /** - * @private - * @type {ol.proj.Units} - */ + * @private + * @type {ol.proj.Units} + */ this.units_ = /** @type {ol.proj.Units} */ (options.units); /** - * @private - * @type {ol.Extent} - */ + * @private + * @type {ol.Extent} + */ this.extent_ = options.extent !== undefined ? options.extent : null; /** - * @private - * @type {ol.Extent} - */ + * @private + * @type {ol.Extent} + */ this.worldExtent_ = options.worldExtent !== undefined ? options.worldExtent : null; /** - * @private - * @type {string} - */ + * @private + * @type {string} + */ this.axisOrientation_ = options.axisOrientation !== undefined ? options.axisOrientation : 'enu'; /** - * @private - * @type {boolean} - */ + * @private + * @type {boolean} + */ this.global_ = options.global !== undefined ? options.global : false; /** - * @private - * @type {boolean} - */ + * @private + * @type {boolean} + */ this.canWrapX_ = !!(this.global_ && this.extent_); /** - * @private - * @type {function(number, ol.Coordinate):number|undefined} - */ + * @private + * @type {function(number, ol.Coordinate):number|undefined} + */ this.getPointResolutionFunc_ = options.getPointResolution; /** - * @private - * @type {ol.tilegrid.TileGrid} - */ + * @private + * @type {ol.tilegrid.TileGrid} + */ this.defaultTileGrid_ = null; /** - * @private - * @type {number|undefined} - */ + * @private + * @type {number|undefined} + */ this.metersPerUnit_ = options.metersPerUnit; var code = options.code; diff --git a/src/ol/render/webgl/circlereplay/defaultshader.js b/src/ol/render/webgl/circlereplay/defaultshader.js index 6da5615e372..a50f1c9615b 100644 --- a/src/ol/render/webgl/circlereplay/defaultshader.js +++ b/src/ol/render/webgl/circlereplay/defaultshader.js @@ -38,8 +38,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.render.webgl.circlereplay.defaultshader.Fragment.SOURCE = ol.DEBUG_WEBGL ? - ol.render.webgl.circlereplay.defaultshader.Fragment.DEBUG_SOURCE : - ol.render.webgl.circlereplay.defaultshader.Fragment.OPTIMIZED_SOURCE; + ol.render.webgl.circlereplay.defaultshader.Fragment.DEBUG_SOURCE : + ol.render.webgl.circlereplay.defaultshader.Fragment.OPTIMIZED_SOURCE; ol.render.webgl.circlereplay.defaultshader.fragment = new ol.render.webgl.circlereplay.defaultshader.Fragment(); @@ -75,8 +75,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.render.webgl.circlereplay.defaultshader.Vertex.SOURCE = ol.DEBUG_WEBGL ? - ol.render.webgl.circlereplay.defaultshader.Vertex.DEBUG_SOURCE : - ol.render.webgl.circlereplay.defaultshader.Vertex.OPTIMIZED_SOURCE; + ol.render.webgl.circlereplay.defaultshader.Vertex.DEBUG_SOURCE : + ol.render.webgl.circlereplay.defaultshader.Vertex.OPTIMIZED_SOURCE; ol.render.webgl.circlereplay.defaultshader.vertex = new ol.render.webgl.circlereplay.defaultshader.Vertex(); diff --git a/src/ol/render/webgl/imagereplay/defaultshader.js b/src/ol/render/webgl/imagereplay/defaultshader.js index ee5fef2ea4d..92e91c74a1a 100644 --- a/src/ol/render/webgl/imagereplay/defaultshader.js +++ b/src/ol/render/webgl/imagereplay/defaultshader.js @@ -38,8 +38,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.render.webgl.imagereplay.defaultshader.Fragment.SOURCE = ol.DEBUG_WEBGL ? - ol.render.webgl.imagereplay.defaultshader.Fragment.DEBUG_SOURCE : - ol.render.webgl.imagereplay.defaultshader.Fragment.OPTIMIZED_SOURCE; + ol.render.webgl.imagereplay.defaultshader.Fragment.DEBUG_SOURCE : + ol.render.webgl.imagereplay.defaultshader.Fragment.OPTIMIZED_SOURCE; ol.render.webgl.imagereplay.defaultshader.fragment = new ol.render.webgl.imagereplay.defaultshader.Fragment(); @@ -75,8 +75,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.render.webgl.imagereplay.defaultshader.Vertex.SOURCE = ol.DEBUG_WEBGL ? - ol.render.webgl.imagereplay.defaultshader.Vertex.DEBUG_SOURCE : - ol.render.webgl.imagereplay.defaultshader.Vertex.OPTIMIZED_SOURCE; + ol.render.webgl.imagereplay.defaultshader.Vertex.DEBUG_SOURCE : + ol.render.webgl.imagereplay.defaultshader.Vertex.OPTIMIZED_SOURCE; ol.render.webgl.imagereplay.defaultshader.vertex = new ol.render.webgl.imagereplay.defaultshader.Vertex(); diff --git a/src/ol/render/webgl/linestringreplay/defaultshader.js b/src/ol/render/webgl/linestringreplay/defaultshader.js index d355e0194c2..02e1994f009 100644 --- a/src/ol/render/webgl/linestringreplay/defaultshader.js +++ b/src/ol/render/webgl/linestringreplay/defaultshader.js @@ -38,8 +38,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.render.webgl.linestringreplay.defaultshader.Fragment.SOURCE = ol.DEBUG_WEBGL ? - ol.render.webgl.linestringreplay.defaultshader.Fragment.DEBUG_SOURCE : - ol.render.webgl.linestringreplay.defaultshader.Fragment.OPTIMIZED_SOURCE; + ol.render.webgl.linestringreplay.defaultshader.Fragment.DEBUG_SOURCE : + ol.render.webgl.linestringreplay.defaultshader.Fragment.OPTIMIZED_SOURCE; ol.render.webgl.linestringreplay.defaultshader.fragment = new ol.render.webgl.linestringreplay.defaultshader.Fragment(); @@ -75,8 +75,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.render.webgl.linestringreplay.defaultshader.Vertex.SOURCE = ol.DEBUG_WEBGL ? - ol.render.webgl.linestringreplay.defaultshader.Vertex.DEBUG_SOURCE : - ol.render.webgl.linestringreplay.defaultshader.Vertex.OPTIMIZED_SOURCE; + ol.render.webgl.linestringreplay.defaultshader.Vertex.DEBUG_SOURCE : + ol.render.webgl.linestringreplay.defaultshader.Vertex.OPTIMIZED_SOURCE; ol.render.webgl.linestringreplay.defaultshader.vertex = new ol.render.webgl.linestringreplay.defaultshader.Vertex(); diff --git a/src/ol/render/webgl/polygonreplay/defaultshader.js b/src/ol/render/webgl/polygonreplay/defaultshader.js index 46db42c7cb0..ccd978d93a4 100644 --- a/src/ol/render/webgl/polygonreplay/defaultshader.js +++ b/src/ol/render/webgl/polygonreplay/defaultshader.js @@ -38,8 +38,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.render.webgl.polygonreplay.defaultshader.Fragment.SOURCE = ol.DEBUG_WEBGL ? - ol.render.webgl.polygonreplay.defaultshader.Fragment.DEBUG_SOURCE : - ol.render.webgl.polygonreplay.defaultshader.Fragment.OPTIMIZED_SOURCE; + ol.render.webgl.polygonreplay.defaultshader.Fragment.DEBUG_SOURCE : + ol.render.webgl.polygonreplay.defaultshader.Fragment.OPTIMIZED_SOURCE; ol.render.webgl.polygonreplay.defaultshader.fragment = new ol.render.webgl.polygonreplay.defaultshader.Fragment(); @@ -75,8 +75,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.render.webgl.polygonreplay.defaultshader.Vertex.SOURCE = ol.DEBUG_WEBGL ? - ol.render.webgl.polygonreplay.defaultshader.Vertex.DEBUG_SOURCE : - ol.render.webgl.polygonreplay.defaultshader.Vertex.OPTIMIZED_SOURCE; + ol.render.webgl.polygonreplay.defaultshader.Vertex.DEBUG_SOURCE : + ol.render.webgl.polygonreplay.defaultshader.Vertex.OPTIMIZED_SOURCE; ol.render.webgl.polygonreplay.defaultshader.vertex = new ol.render.webgl.polygonreplay.defaultshader.Vertex(); diff --git a/src/ol/renderer/layer.js b/src/ol/renderer/layer.js index ebccbdc8c3a..a5745e13770 100644 --- a/src/ol/renderer/layer.js +++ b/src/ol/renderer/layer.js @@ -66,11 +66,11 @@ ol.renderer.Layer.prototype.hasFeatureAtCoordinate = ol.functions.FALSE; */ ol.renderer.Layer.prototype.createLoadedTileFinder = function(source, projection, tiles) { return ( - /** - * @param {number} zoom Zoom level. - * @param {ol.TileRange} tileRange Tile range. - * @return {boolean} The tile range is fully loaded. - */ + /** + * @param {number} zoom Zoom level. + * @param {ol.TileRange} tileRange Tile range. + * @return {boolean} The tile range is fully loaded. + */ function(zoom, tileRange) { function callback(tile) { if (!tiles[zoom]) { diff --git a/src/ol/renderer/webgl/defaultmapshader.js b/src/ol/renderer/webgl/defaultmapshader.js index d315b01b1e9..95985672057 100644 --- a/src/ol/renderer/webgl/defaultmapshader.js +++ b/src/ol/renderer/webgl/defaultmapshader.js @@ -38,8 +38,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.renderer.webgl.defaultmapshader.Fragment.SOURCE = ol.DEBUG_WEBGL ? - ol.renderer.webgl.defaultmapshader.Fragment.DEBUG_SOURCE : - ol.renderer.webgl.defaultmapshader.Fragment.OPTIMIZED_SOURCE; + ol.renderer.webgl.defaultmapshader.Fragment.DEBUG_SOURCE : + ol.renderer.webgl.defaultmapshader.Fragment.OPTIMIZED_SOURCE; ol.renderer.webgl.defaultmapshader.fragment = new ol.renderer.webgl.defaultmapshader.Fragment(); @@ -75,8 +75,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.renderer.webgl.defaultmapshader.Vertex.SOURCE = ol.DEBUG_WEBGL ? - ol.renderer.webgl.defaultmapshader.Vertex.DEBUG_SOURCE : - ol.renderer.webgl.defaultmapshader.Vertex.OPTIMIZED_SOURCE; + ol.renderer.webgl.defaultmapshader.Vertex.DEBUG_SOURCE : + ol.renderer.webgl.defaultmapshader.Vertex.OPTIMIZED_SOURCE; ol.renderer.webgl.defaultmapshader.vertex = new ol.renderer.webgl.defaultmapshader.Vertex(); diff --git a/src/ol/renderer/webgl/tilelayer.js b/src/ol/renderer/webgl/tilelayer.js index f75454ac22d..8763ef785ea 100644 --- a/src/ol/renderer/webgl/tilelayer.js +++ b/src/ol/renderer/webgl/tilelayer.js @@ -103,11 +103,11 @@ if (ol.ENABLE_WEBGL) { var mapRenderer = this.mapRenderer; return ( - /** - * @param {number} zoom Zoom level. - * @param {ol.TileRange} tileRange Tile range. - * @return {boolean} The tile range is fully loaded. - */ + /** + * @param {number} zoom Zoom level. + * @param {ol.TileRange} tileRange Tile range. + * @return {boolean} The tile range is fully loaded. + */ function(zoom, tileRange) { function callback(tile) { var loaded = mapRenderer.isTileTextureLoaded(tile); diff --git a/src/ol/renderer/webgl/tilelayershader.js b/src/ol/renderer/webgl/tilelayershader.js index c97eeb56d0e..1fcd190c541 100644 --- a/src/ol/renderer/webgl/tilelayershader.js +++ b/src/ol/renderer/webgl/tilelayershader.js @@ -38,8 +38,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.renderer.webgl.tilelayershader.Fragment.SOURCE = ol.DEBUG_WEBGL ? - ol.renderer.webgl.tilelayershader.Fragment.DEBUG_SOURCE : - ol.renderer.webgl.tilelayershader.Fragment.OPTIMIZED_SOURCE; + ol.renderer.webgl.tilelayershader.Fragment.DEBUG_SOURCE : + ol.renderer.webgl.tilelayershader.Fragment.OPTIMIZED_SOURCE; ol.renderer.webgl.tilelayershader.fragment = new ol.renderer.webgl.tilelayershader.Fragment(); @@ -75,8 +75,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.renderer.webgl.tilelayershader.Vertex.SOURCE = ol.DEBUG_WEBGL ? - ol.renderer.webgl.tilelayershader.Vertex.DEBUG_SOURCE : - ol.renderer.webgl.tilelayershader.Vertex.OPTIMIZED_SOURCE; + ol.renderer.webgl.tilelayershader.Vertex.DEBUG_SOURCE : + ol.renderer.webgl.tilelayershader.Vertex.OPTIMIZED_SOURCE; ol.renderer.webgl.tilelayershader.vertex = new ol.renderer.webgl.tilelayershader.Vertex(); diff --git a/src/ol/resolutionconstraint.js b/src/ol/resolutionconstraint.js index 93fb97f7fe1..32bc069eea9 100644 --- a/src/ol/resolutionconstraint.js +++ b/src/ol/resolutionconstraint.js @@ -10,12 +10,12 @@ goog.require('ol.math'); */ ol.ResolutionConstraint.createSnapToResolutions = function(resolutions) { return ( - /** - * @param {number|undefined} resolution Resolution. - * @param {number} delta Delta. - * @param {number} direction Direction. - * @return {number|undefined} Resolution. - */ + /** + * @param {number|undefined} resolution Resolution. + * @param {number} delta Delta. + * @param {number} direction Direction. + * @return {number|undefined} Resolution. + */ function(resolution, delta, direction) { if (resolution !== undefined) { var z = @@ -43,12 +43,12 @@ ol.ResolutionConstraint.createSnapToResolutions = function(resolutions) { */ ol.ResolutionConstraint.createSnapToPower = function(power, maxResolution, opt_maxLevel) { return ( - /** - * @param {number|undefined} resolution Resolution. - * @param {number} delta Delta. - * @param {number} direction Direction. - * @return {number|undefined} Resolution. - */ + /** + * @param {number|undefined} resolution Resolution. + * @param {number} delta Delta. + * @param {number} direction Direction. + * @return {number|undefined} Resolution. + */ function(resolution, delta, direction) { if (resolution !== undefined) { var offset = -direction / 2 + 0.5; diff --git a/src/ol/rotationconstraint.js b/src/ol/rotationconstraint.js index ccbd2e59725..daafdbd2501 100644 --- a/src/ol/rotationconstraint.js +++ b/src/ol/rotationconstraint.js @@ -38,11 +38,11 @@ ol.RotationConstraint.none = function(rotation, delta) { ol.RotationConstraint.createSnapToN = function(n) { var theta = 2 * Math.PI / n; return ( - /** - * @param {number|undefined} rotation Rotation. - * @param {number} delta Delta. - * @return {number|undefined} Rotation. - */ + /** + * @param {number|undefined} rotation Rotation. + * @param {number} delta Delta. + * @return {number|undefined} Rotation. + */ function(rotation, delta) { if (rotation !== undefined) { rotation = Math.floor((rotation + delta) / theta + 0.5) * theta; @@ -61,11 +61,11 @@ ol.RotationConstraint.createSnapToN = function(n) { ol.RotationConstraint.createSnapToZero = function(opt_tolerance) { var tolerance = opt_tolerance || ol.math.toRadians(5); return ( - /** - * @param {number|undefined} rotation Rotation. - * @param {number} delta Delta. - * @return {number|undefined} Rotation. - */ + /** + * @param {number|undefined} rotation Rotation. + * @param {number} delta Delta. + * @return {number|undefined} Rotation. + */ function(rotation, delta) { if (rotation !== undefined) { if (Math.abs(rotation + delta) <= tolerance) { diff --git a/src/ol/source/bingmaps.js b/src/ol/source/bingmaps.js index 89c100ef800..1829ea5ec30 100644 --- a/src/ol/source/bingmaps.js +++ b/src/ol/source/bingmaps.js @@ -154,12 +154,12 @@ ol.source.BingMaps.prototype.handleImageryMetadataResponse = function(response) .replace('{subdomain}', subdomain) .replace('{culture}', culture); return ( - /** - * @param {ol.TileCoord} tileCoord Tile coordinate. - * @param {number} pixelRatio Pixel ratio. - * @param {ol.proj.Projection} projection Projection. - * @return {string|undefined} Tile URL. - */ + /** + * @param {ol.TileCoord} tileCoord Tile coordinate. + * @param {number} pixelRatio Pixel ratio. + * @param {ol.proj.Projection} projection Projection. + * @return {string|undefined} Tile URL. + */ function(tileCoord, pixelRatio, projection) { if (!tileCoord) { return undefined; diff --git a/src/ol/source/wmts.js b/src/ol/source/wmts.js index a4ebe9f0dc5..4aedb54dc1a 100644 --- a/src/ol/source/wmts.js +++ b/src/ol/source/wmts.js @@ -119,12 +119,12 @@ ol.source.WMTS = function(options) { }); return ( - /** - * @param {ol.TileCoord} tileCoord Tile coordinate. - * @param {number} pixelRatio Pixel ratio. - * @param {ol.proj.Projection} projection Projection. - * @return {string|undefined} Tile URL. - */ + /** + * @param {ol.TileCoord} tileCoord Tile coordinate. + * @param {number} pixelRatio Pixel ratio. + * @param {ol.proj.Projection} projection Projection. + * @return {string|undefined} Tile URL. + */ function(tileCoord, pixelRatio, projection) { if (!tileCoord) { return undefined; diff --git a/src/ol/tileurlfunction.js b/src/ol/tileurlfunction.js index 451fab40cf3..3ab48d7e226 100644 --- a/src/ol/tileurlfunction.js +++ b/src/ol/tileurlfunction.js @@ -16,12 +16,12 @@ ol.TileUrlFunction.createFromTemplate = function(template, tileGrid) { var yRegEx = /\{y\}/g; var dashYRegEx = /\{-y\}/g; return ( - /** - * @param {ol.TileCoord} tileCoord Tile Coordinate. - * @param {number} pixelRatio Pixel ratio. - * @param {ol.proj.Projection} projection Projection. - * @return {string|undefined} Tile URL. - */ + /** + * @param {ol.TileCoord} tileCoord Tile Coordinate. + * @param {number} pixelRatio Pixel ratio. + * @param {ol.proj.Projection} projection Projection. + * @return {string|undefined} Tile URL. + */ function(tileCoord, pixelRatio, projection) { if (!tileCoord) { return undefined; @@ -69,12 +69,12 @@ ol.TileUrlFunction.createFromTileUrlFunctions = function(tileUrlFunctions) { return tileUrlFunctions[0]; } return ( - /** - * @param {ol.TileCoord} tileCoord Tile Coordinate. - * @param {number} pixelRatio Pixel ratio. - * @param {ol.proj.Projection} projection Projection. - * @return {string|undefined} Tile URL. - */ + /** + * @param {ol.TileCoord} tileCoord Tile Coordinate. + * @param {number} pixelRatio Pixel ratio. + * @param {ol.proj.Projection} projection Projection. + * @return {string|undefined} Tile URL. + */ function(tileCoord, pixelRatio, projection) { if (!tileCoord) { return undefined; diff --git a/src/ol/view.js b/src/ol/view.js index 1665f72493b..dfbd4165ff7 100644 --- a/src/ol/view.js +++ b/src/ol/view.js @@ -697,10 +697,10 @@ ol.View.prototype.getResolutionForValueFunction = function(opt_power) { var minResolution = this.minResolution_; var max = Math.log(maxResolution / minResolution) / Math.log(power); return ( - /** - * @param {number} value Value. - * @return {number} Resolution. - */ + /** + * @param {number} value Value. + * @return {number} Resolution. + */ function(value) { var resolution = maxResolution / Math.pow(power, value * max); return resolution; @@ -731,10 +731,10 @@ ol.View.prototype.getValueForResolutionFunction = function(opt_power) { var minResolution = this.minResolution_; var max = Math.log(maxResolution / minResolution) / Math.log(power); return ( - /** - * @param {number} resolution Resolution. - * @return {number} Value. - */ + /** + * @param {number} resolution Resolution. + * @return {number} Value. + */ function(resolution) { var value = (Math.log(maxResolution / resolution) / Math.log(power)) / max; diff --git a/src/ol/xml.js b/src/ol/xml.js index cf3e5c636a9..8172942a8c0 100644 --- a/src/ol/xml.js +++ b/src/ol/xml.js @@ -125,10 +125,10 @@ ol.xml.parse = function(xml) { */ ol.xml.makeArrayExtender = function(valueReader, opt_this) { return ( - /** - * @param {Node} node Node. - * @param {Array.<*>} objectStack Object stack. - */ + /** + * @param {Node} node Node. + * @param {Array.<*>} objectStack Object stack. + */ function(node, objectStack) { var value = valueReader.call(opt_this, node, objectStack); if (value !== undefined) { @@ -150,10 +150,10 @@ ol.xml.makeArrayExtender = function(valueReader, opt_this) { */ ol.xml.makeArrayPusher = function(valueReader, opt_this) { return ( - /** - * @param {Node} node Node. - * @param {Array.<*>} objectStack Object stack. - */ + /** + * @param {Node} node Node. + * @param {Array.<*>} objectStack Object stack. + */ function(node, objectStack) { var value = valueReader.call(opt_this !== undefined ? opt_this : this, node, objectStack); @@ -175,10 +175,10 @@ ol.xml.makeArrayPusher = function(valueReader, opt_this) { */ ol.xml.makeReplacer = function(valueReader, opt_this) { return ( - /** - * @param {Node} node Node. - * @param {Array.<*>} objectStack Object stack. - */ + /** + * @param {Node} node Node. + * @param {Array.<*>} objectStack Object stack. + */ function(node, objectStack) { var value = valueReader.call(opt_this !== undefined ? opt_this : this, node, objectStack); @@ -200,10 +200,10 @@ ol.xml.makeReplacer = function(valueReader, opt_this) { */ ol.xml.makeObjectPropertyPusher = function(valueReader, opt_property, opt_this) { return ( - /** - * @param {Node} node Node. - * @param {Array.<*>} objectStack Object stack. - */ + /** + * @param {Node} node Node. + * @param {Array.<*>} objectStack Object stack. + */ function(node, objectStack) { var value = valueReader.call(opt_this !== undefined ? opt_this : this, node, objectStack); @@ -234,10 +234,10 @@ ol.xml.makeObjectPropertyPusher = function(valueReader, opt_property, opt_this) */ ol.xml.makeObjectPropertySetter = function(valueReader, opt_property, opt_this) { return ( - /** - * @param {Node} node Node. - * @param {Array.<*>} objectStack Object stack. - */ + /** + * @param {Node} node Node. + * @param {Array.<*>} objectStack Object stack. + */ function(node, objectStack) { var value = valueReader.call(opt_this !== undefined ? opt_this : this, node, objectStack); @@ -317,12 +317,12 @@ ol.xml.makeArraySerializer = function(nodeWriter, opt_this) { ol.xml.makeSimpleNodeFactory = function(opt_nodeName, opt_namespaceURI) { var fixedNodeName = opt_nodeName; return ( - /** - * @param {*} value Value. - * @param {Array.<*>} objectStack Object stack. - * @param {string=} opt_nodeName Node name. - * @return {Node} Node. - */ + /** + * @param {*} value Value. + * @param {Array.<*>} objectStack Object stack. + * @param {string=} opt_nodeName Node name. + * @return {Node} Node. + */ function(value, objectStack, opt_nodeName) { var context = objectStack[objectStack.length - 1]; var node = context.node; From 87e9c9ad464a786ca5ffb857848d6983ffec4219 Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Tue, 20 Jun 2017 10:53:37 +0200 Subject: [PATCH 5/6] Change indentation of shader mustache template --- src/ol/webgl/shader.mustache | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ol/webgl/shader.mustache b/src/ol/webgl/shader.mustache index 85325305a4a..46a003fd2af 100644 --- a/src/ol/webgl/shader.mustache +++ b/src/ol/webgl/shader.mustache @@ -38,8 +38,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ {{className}}.Fragment.SOURCE = ol.DEBUG_WEBGL ? - {{className}}.Fragment.DEBUG_SOURCE : - {{className}}.Fragment.OPTIMIZED_SOURCE; + {{className}}.Fragment.DEBUG_SOURCE : + {{className}}.Fragment.OPTIMIZED_SOURCE; {{className}}.fragment = new {{className}}.Fragment(); @@ -75,8 +75,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ {{className}}.Vertex.SOURCE = ol.DEBUG_WEBGL ? - {{className}}.Vertex.DEBUG_SOURCE : - {{className}}.Vertex.OPTIMIZED_SOURCE; + {{className}}.Vertex.DEBUG_SOURCE : + {{className}}.Vertex.OPTIMIZED_SOURCE; {{className}}.vertex = new {{className}}.Vertex(); From feabb6440d2703d2f1a2796eb3a1bacec9b9a84b Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Tue, 20 Jun 2017 11:11:54 +0200 Subject: [PATCH 6/6] Add reindented shader sources --- src/ol/render/webgl/circlereplay/defaultshader.js | 8 ++++---- src/ol/render/webgl/imagereplay/defaultshader.js | 8 ++++---- src/ol/render/webgl/linestringreplay/defaultshader.js | 8 ++++---- src/ol/render/webgl/polygonreplay/defaultshader.js | 8 ++++---- src/ol/renderer/webgl/defaultmapshader.js | 8 ++++---- src/ol/renderer/webgl/tilelayershader.js | 8 ++++---- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/ol/render/webgl/circlereplay/defaultshader.js b/src/ol/render/webgl/circlereplay/defaultshader.js index a50f1c9615b..6da5615e372 100644 --- a/src/ol/render/webgl/circlereplay/defaultshader.js +++ b/src/ol/render/webgl/circlereplay/defaultshader.js @@ -38,8 +38,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.render.webgl.circlereplay.defaultshader.Fragment.SOURCE = ol.DEBUG_WEBGL ? - ol.render.webgl.circlereplay.defaultshader.Fragment.DEBUG_SOURCE : - ol.render.webgl.circlereplay.defaultshader.Fragment.OPTIMIZED_SOURCE; + ol.render.webgl.circlereplay.defaultshader.Fragment.DEBUG_SOURCE : + ol.render.webgl.circlereplay.defaultshader.Fragment.OPTIMIZED_SOURCE; ol.render.webgl.circlereplay.defaultshader.fragment = new ol.render.webgl.circlereplay.defaultshader.Fragment(); @@ -75,8 +75,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.render.webgl.circlereplay.defaultshader.Vertex.SOURCE = ol.DEBUG_WEBGL ? - ol.render.webgl.circlereplay.defaultshader.Vertex.DEBUG_SOURCE : - ol.render.webgl.circlereplay.defaultshader.Vertex.OPTIMIZED_SOURCE; + ol.render.webgl.circlereplay.defaultshader.Vertex.DEBUG_SOURCE : + ol.render.webgl.circlereplay.defaultshader.Vertex.OPTIMIZED_SOURCE; ol.render.webgl.circlereplay.defaultshader.vertex = new ol.render.webgl.circlereplay.defaultshader.Vertex(); diff --git a/src/ol/render/webgl/imagereplay/defaultshader.js b/src/ol/render/webgl/imagereplay/defaultshader.js index 92e91c74a1a..ee5fef2ea4d 100644 --- a/src/ol/render/webgl/imagereplay/defaultshader.js +++ b/src/ol/render/webgl/imagereplay/defaultshader.js @@ -38,8 +38,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.render.webgl.imagereplay.defaultshader.Fragment.SOURCE = ol.DEBUG_WEBGL ? - ol.render.webgl.imagereplay.defaultshader.Fragment.DEBUG_SOURCE : - ol.render.webgl.imagereplay.defaultshader.Fragment.OPTIMIZED_SOURCE; + ol.render.webgl.imagereplay.defaultshader.Fragment.DEBUG_SOURCE : + ol.render.webgl.imagereplay.defaultshader.Fragment.OPTIMIZED_SOURCE; ol.render.webgl.imagereplay.defaultshader.fragment = new ol.render.webgl.imagereplay.defaultshader.Fragment(); @@ -75,8 +75,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.render.webgl.imagereplay.defaultshader.Vertex.SOURCE = ol.DEBUG_WEBGL ? - ol.render.webgl.imagereplay.defaultshader.Vertex.DEBUG_SOURCE : - ol.render.webgl.imagereplay.defaultshader.Vertex.OPTIMIZED_SOURCE; + ol.render.webgl.imagereplay.defaultshader.Vertex.DEBUG_SOURCE : + ol.render.webgl.imagereplay.defaultshader.Vertex.OPTIMIZED_SOURCE; ol.render.webgl.imagereplay.defaultshader.vertex = new ol.render.webgl.imagereplay.defaultshader.Vertex(); diff --git a/src/ol/render/webgl/linestringreplay/defaultshader.js b/src/ol/render/webgl/linestringreplay/defaultshader.js index 02e1994f009..d355e0194c2 100644 --- a/src/ol/render/webgl/linestringreplay/defaultshader.js +++ b/src/ol/render/webgl/linestringreplay/defaultshader.js @@ -38,8 +38,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.render.webgl.linestringreplay.defaultshader.Fragment.SOURCE = ol.DEBUG_WEBGL ? - ol.render.webgl.linestringreplay.defaultshader.Fragment.DEBUG_SOURCE : - ol.render.webgl.linestringreplay.defaultshader.Fragment.OPTIMIZED_SOURCE; + ol.render.webgl.linestringreplay.defaultshader.Fragment.DEBUG_SOURCE : + ol.render.webgl.linestringreplay.defaultshader.Fragment.OPTIMIZED_SOURCE; ol.render.webgl.linestringreplay.defaultshader.fragment = new ol.render.webgl.linestringreplay.defaultshader.Fragment(); @@ -75,8 +75,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.render.webgl.linestringreplay.defaultshader.Vertex.SOURCE = ol.DEBUG_WEBGL ? - ol.render.webgl.linestringreplay.defaultshader.Vertex.DEBUG_SOURCE : - ol.render.webgl.linestringreplay.defaultshader.Vertex.OPTIMIZED_SOURCE; + ol.render.webgl.linestringreplay.defaultshader.Vertex.DEBUG_SOURCE : + ol.render.webgl.linestringreplay.defaultshader.Vertex.OPTIMIZED_SOURCE; ol.render.webgl.linestringreplay.defaultshader.vertex = new ol.render.webgl.linestringreplay.defaultshader.Vertex(); diff --git a/src/ol/render/webgl/polygonreplay/defaultshader.js b/src/ol/render/webgl/polygonreplay/defaultshader.js index ccd978d93a4..46db42c7cb0 100644 --- a/src/ol/render/webgl/polygonreplay/defaultshader.js +++ b/src/ol/render/webgl/polygonreplay/defaultshader.js @@ -38,8 +38,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.render.webgl.polygonreplay.defaultshader.Fragment.SOURCE = ol.DEBUG_WEBGL ? - ol.render.webgl.polygonreplay.defaultshader.Fragment.DEBUG_SOURCE : - ol.render.webgl.polygonreplay.defaultshader.Fragment.OPTIMIZED_SOURCE; + ol.render.webgl.polygonreplay.defaultshader.Fragment.DEBUG_SOURCE : + ol.render.webgl.polygonreplay.defaultshader.Fragment.OPTIMIZED_SOURCE; ol.render.webgl.polygonreplay.defaultshader.fragment = new ol.render.webgl.polygonreplay.defaultshader.Fragment(); @@ -75,8 +75,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.render.webgl.polygonreplay.defaultshader.Vertex.SOURCE = ol.DEBUG_WEBGL ? - ol.render.webgl.polygonreplay.defaultshader.Vertex.DEBUG_SOURCE : - ol.render.webgl.polygonreplay.defaultshader.Vertex.OPTIMIZED_SOURCE; + ol.render.webgl.polygonreplay.defaultshader.Vertex.DEBUG_SOURCE : + ol.render.webgl.polygonreplay.defaultshader.Vertex.OPTIMIZED_SOURCE; ol.render.webgl.polygonreplay.defaultshader.vertex = new ol.render.webgl.polygonreplay.defaultshader.Vertex(); diff --git a/src/ol/renderer/webgl/defaultmapshader.js b/src/ol/renderer/webgl/defaultmapshader.js index 95985672057..d315b01b1e9 100644 --- a/src/ol/renderer/webgl/defaultmapshader.js +++ b/src/ol/renderer/webgl/defaultmapshader.js @@ -38,8 +38,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.renderer.webgl.defaultmapshader.Fragment.SOURCE = ol.DEBUG_WEBGL ? - ol.renderer.webgl.defaultmapshader.Fragment.DEBUG_SOURCE : - ol.renderer.webgl.defaultmapshader.Fragment.OPTIMIZED_SOURCE; + ol.renderer.webgl.defaultmapshader.Fragment.DEBUG_SOURCE : + ol.renderer.webgl.defaultmapshader.Fragment.OPTIMIZED_SOURCE; ol.renderer.webgl.defaultmapshader.fragment = new ol.renderer.webgl.defaultmapshader.Fragment(); @@ -75,8 +75,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.renderer.webgl.defaultmapshader.Vertex.SOURCE = ol.DEBUG_WEBGL ? - ol.renderer.webgl.defaultmapshader.Vertex.DEBUG_SOURCE : - ol.renderer.webgl.defaultmapshader.Vertex.OPTIMIZED_SOURCE; + ol.renderer.webgl.defaultmapshader.Vertex.DEBUG_SOURCE : + ol.renderer.webgl.defaultmapshader.Vertex.OPTIMIZED_SOURCE; ol.renderer.webgl.defaultmapshader.vertex = new ol.renderer.webgl.defaultmapshader.Vertex(); diff --git a/src/ol/renderer/webgl/tilelayershader.js b/src/ol/renderer/webgl/tilelayershader.js index 1fcd190c541..c97eeb56d0e 100644 --- a/src/ol/renderer/webgl/tilelayershader.js +++ b/src/ol/renderer/webgl/tilelayershader.js @@ -38,8 +38,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.renderer.webgl.tilelayershader.Fragment.SOURCE = ol.DEBUG_WEBGL ? - ol.renderer.webgl.tilelayershader.Fragment.DEBUG_SOURCE : - ol.renderer.webgl.tilelayershader.Fragment.OPTIMIZED_SOURCE; + ol.renderer.webgl.tilelayershader.Fragment.DEBUG_SOURCE : + ol.renderer.webgl.tilelayershader.Fragment.OPTIMIZED_SOURCE; ol.renderer.webgl.tilelayershader.fragment = new ol.renderer.webgl.tilelayershader.Fragment(); @@ -75,8 +75,8 @@ if (ol.ENABLE_WEBGL) { * @type {string} */ ol.renderer.webgl.tilelayershader.Vertex.SOURCE = ol.DEBUG_WEBGL ? - ol.renderer.webgl.tilelayershader.Vertex.DEBUG_SOURCE : - ol.renderer.webgl.tilelayershader.Vertex.OPTIMIZED_SOURCE; + ol.renderer.webgl.tilelayershader.Vertex.DEBUG_SOURCE : + ol.renderer.webgl.tilelayershader.Vertex.OPTIMIZED_SOURCE; ol.renderer.webgl.tilelayershader.vertex = new ol.renderer.webgl.tilelayershader.Vertex();