From a43cca7720ba295cbc7236f0557f0a9ff0f4f3bd Mon Sep 17 00:00:00 2001 From: Andreas Hocevar Date: Tue, 17 Nov 2015 12:36:29 +0100 Subject: [PATCH 1/5] Allow '' for crossOrigin (as Anonymous alias) This fixes a regression introduced by the goog.isDef removal. From the HTML 5 spec: "The empty string is also a valid keyword, and maps to the Anonymous state" --- src/ol/image.js | 2 +- src/ol/imagetile.js | 2 +- src/ol/style/iconstyle.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ol/image.js b/src/ol/image.js index 39bfcfe5ac..d2623bc9b8 100644 --- a/src/ol/image.js +++ b/src/ol/image.js @@ -38,7 +38,7 @@ ol.Image = function(extent, resolution, pixelRatio, attributions, src, * @type {Image} */ this.image_ = new Image(); - if (crossOrigin) { + if (crossOrigin !== null) { this.image_.crossOrigin = crossOrigin; } diff --git a/src/ol/imagetile.js b/src/ol/imagetile.js index f1e267f2b0..d5e2900e9d 100644 --- a/src/ol/imagetile.js +++ b/src/ol/imagetile.js @@ -37,7 +37,7 @@ ol.ImageTile = function(tileCoord, state, src, crossOrigin, tileLoadFunction) { * @type {Image} */ this.image_ = new Image(); - if (crossOrigin) { + if (crossOrigin !== null) { this.image_.crossOrigin = crossOrigin; } diff --git a/src/ol/style/iconstyle.js b/src/ol/style/iconstyle.js index ad52456147..8417b08a9d 100644 --- a/src/ol/style/iconstyle.js +++ b/src/ol/style/iconstyle.js @@ -392,7 +392,7 @@ ol.style.IconImage_ = function(image, src, size, crossOrigin, imageState) { */ this.image_ = !image ? new Image() : image; - if (crossOrigin) { + if (crossOrigin !== null) { this.image_.crossOrigin = crossOrigin; } From 071aad4815bae1d584f50a982f68ec9ace2cecfd Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Wed, 18 Nov 2015 11:30:10 +0100 Subject: [PATCH 2/5] Check ol.source.UrlTile#urls property for null value Fixes #4446 --- src/ol/source/tilearcgisrestsource.js | 2 +- src/ol/source/tilewmssource.js | 10 ++++++---- test/spec/ol/source/tilewmssource.test.js | 10 ++++++++++ 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/ol/source/tilearcgisrestsource.js b/src/ol/source/tilearcgisrestsource.js index bd37a418d6..47ec86fd0f 100644 --- a/src/ol/source/tilearcgisrestsource.js +++ b/src/ol/source/tilearcgisrestsource.js @@ -91,7 +91,7 @@ ol.source.TileArcGISRest.prototype.getRequestUrl_ = pixelRatio, projection, params) { var urls = this.urls; - if (urls.length === 0) { + if (!urls) { return undefined; } diff --git a/src/ol/source/tilewmssource.js b/src/ol/source/tilewmssource.js index f17caee76a..47b66b23ac 100644 --- a/src/ol/source/tilewmssource.js +++ b/src/ol/source/tilewmssource.js @@ -212,7 +212,7 @@ ol.source.TileWMS.prototype.getRequestUrl_ = pixelRatio, projection, params) { var urls = this.urls; - if (urls.length === 0) { + if (!urls) { return undefined; } @@ -298,9 +298,11 @@ ol.source.TileWMS.prototype.resetCoordKeyPrefix_ = function() { var i = 0; var res = []; - var j, jj; - for (j = 0, jj = this.urls.length; j < jj; ++j) { - res[i++] = this.urls[j]; + if (this.urls) { + var j, jj; + for (j = 0, jj = this.urls.length; j < jj; ++j) { + res[i++] = this.urls[j]; + } } var key; diff --git a/test/spec/ol/source/tilewmssource.test.js b/test/spec/ol/source/tilewmssource.test.js index 8fcc0ac64e..d5de725a24 100644 --- a/test/spec/ol/source/tilewmssource.test.js +++ b/test/spec/ol/source/tilewmssource.test.js @@ -13,6 +13,16 @@ describe('ol.source.TileWMS', function() { }; }); + describe('constructor', function() { + it('can be constructed without url or urls params', function() { + var source = new ol.source.TileWMS({ + projection: 'EPSG:3857', + tileGrid: ol.tilegrid.createXYZ({maxZoom: 6}) + }); + expect(source).to.be.an(ol.source.TileWMS); + }); + }); + describe('#getTile', function() { it('returns a tile with the expected URL', function() { From 5af338f92bbe07451909a94a246c7a8e8bebf636 Mon Sep 17 00:00:00 2001 From: Andreas Hocevar Date: Wed, 18 Nov 2015 11:57:18 +0100 Subject: [PATCH 3/5] Fix select interaction regression caused by #4391 --- src/ol/interaction/selectinteraction.js | 2 +- test/spec/ol/interaction/selectinteraction.test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ol/interaction/selectinteraction.js b/src/ol/interaction/selectinteraction.js index e4c28fab07..77f559cc1e 100644 --- a/src/ol/interaction/selectinteraction.js +++ b/src/ol/interaction/selectinteraction.js @@ -283,7 +283,7 @@ ol.interaction.Select.handleEvent = function(mapBrowserEvent) { * @param {ol.layer.Layer} layer Layer. */ function(feature, layer) { - if (layer && this.filter_(feature, layer)) { + if (!layer || this.filter_(feature, layer)) { selected.push(feature); this.addFeatureLayerAssociation_(feature, layer); return !this.multi_; diff --git a/test/spec/ol/interaction/selectinteraction.test.js b/test/spec/ol/interaction/selectinteraction.test.js index 89530aa4ff..c9e2c5a1e9 100644 --- a/test/spec/ol/interaction/selectinteraction.test.js +++ b/test/spec/ol/interaction/selectinteraction.test.js @@ -179,7 +179,7 @@ describe('ol.interaction.Select', function() { unmanaged.setMap(map); map.renderSync(); simulateEvent(ol.MapBrowserEvent.EventType.SINGLECLICK, 10, -20); - expect(spy.firstCall.args[0]).to.not.equal(feature); + expect(spy.getCalls().length).to.be(0); unmanaged.setMap(null); }); }); From 4999c792f172bc92a25cb8872e791165e1803df3 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Thu, 19 Nov 2015 11:28:02 -0700 Subject: [PATCH 4/5] Changelog for v3.11.2 --- changelog/v3.11.2.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 changelog/v3.11.2.md diff --git a/changelog/v3.11.2.md b/changelog/v3.11.2.md new file mode 100644 index 0000000000..8864a21f39 --- /dev/null +++ b/changelog/v3.11.2.md @@ -0,0 +1,11 @@ +# v3.11.2 + +## Summary + +The v3.11.2 release is a patch release that addresses a few regressions in the v3.11.1 release. See the [v3.11.0 release notes](https://github.com/openlayers/ol3/releases/tag/v3.11.0) for details on upgrading from v3.10. + +## Fixes + + * [#4450](https://github.com/openlayers/ol3/pull/4450) - Fix select interaction regression caused by #4391 ([@ahocevar](https://github.com/ahocevar)) + * [#4448](https://github.com/openlayers/ol3/pull/4448) - Check ol.source.UrlTile#urls property for null value ([@fredj](https://github.com/fredj)) + * [#4439](https://github.com/openlayers/ol3/pull/4439) - Allow '' for crossOrigin (as Anonymous alias) ([@ahocevar](https://github.com/ahocevar)) From eb5607544c71f9445dcb3bcac27d0db62cff18d0 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Thu, 19 Nov 2015 11:32:41 -0700 Subject: [PATCH 5/5] Update package version to 3.11.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e77e12dd17..504f28ee51 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openlayers", - "version": "3.11.1", + "version": "3.11.2", "description": "Build tools and sources for developing OpenLayers based mapping applications", "keywords": [ "map",