diff --git a/changelog/upgrade-notes.md b/changelog/upgrade-notes.md index b69be2d8ed..cd618ad0b1 100644 --- a/changelog/upgrade-notes.md +++ b/changelog/upgrade-notes.md @@ -275,6 +275,10 @@ The `ol/source/Vector#refresh()` method now removes all features from the source The `getGetFeatureInfoUrl` of `ol/source/ImageWMS` and `ol/source/TileWMS` is now called `getFeatureInfoUrl`. +##### `getFeaturesAtPixel` always returns an array + +`getFeaturesAtPixel` now returns an empty array instead of null if no features were found. + #### Other changes ##### Allow declutter in image render mode diff --git a/src/ol/interaction/Select.js b/src/ol/interaction/Select.js index adfa4ae571..91928944e7 100644 --- a/src/ol/interaction/Select.js +++ b/src/ol/interaction/Select.js @@ -86,8 +86,6 @@ const SelectEventType = { * that takes an {@link module:ol/Feature} and an * {@link module:ol/layer/Layer} and returns `true` if the feature may be * selected or `false` otherwise. - * @property {boolean} [wrapX=true] Wrap the world horizontally on the selection - * overlay. * @property {number} [hitTolerance=0] Hit-detection tolerance. Pixels inside * the radius around the given position will be checked for features. */ diff --git a/test/spec/ol/interaction/select.test.js b/test/spec/ol/interaction/select.test.js index cdfb8bebb9..50f7bb2c70 100644 --- a/test/spec/ol/interaction/select.test.js +++ b/test/spec/ol/interaction/select.test.js @@ -223,7 +223,7 @@ describe('ol.interaction.Select', function() { expect(features.getLength()).to.equal(4); expect(select.getLayer(features.item(0))).to.equal(layer); - // Select again to make sure the internal layer isn't reported + // Select again to make sure the style change does not break selection simulateEvent('singleclick', 10, -20); expect(listenerSpy.callCount).to.be(1); @@ -362,7 +362,7 @@ describe('ol.interaction.Select', function() { interaction.on('select', listenerSpy); simulateEvent('singleclick', 10, -20); - // Select again to make sure that the internal layer doesn't get reported. + // Select again to make sure the style change does not break selection simulateEvent('singleclick', 10, -20); }); });