Fix some cosmetics on Select interaction
This commit is contained in:
@@ -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`.
|
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
|
#### Other changes
|
||||||
|
|
||||||
##### Allow declutter in image render mode
|
##### Allow declutter in image render mode
|
||||||
|
|||||||
@@ -86,8 +86,6 @@ const SelectEventType = {
|
|||||||
* that takes an {@link module:ol/Feature} and an
|
* that takes an {@link module:ol/Feature} and an
|
||||||
* {@link module:ol/layer/Layer} and returns `true` if the feature may be
|
* {@link module:ol/layer/Layer} and returns `true` if the feature may be
|
||||||
* selected or `false` otherwise.
|
* 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
|
* @property {number} [hitTolerance=0] Hit-detection tolerance. Pixels inside
|
||||||
* the radius around the given position will be checked for features.
|
* the radius around the given position will be checked for features.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ describe('ol.interaction.Select', function() {
|
|||||||
expect(features.getLength()).to.equal(4);
|
expect(features.getLength()).to.equal(4);
|
||||||
expect(select.getLayer(features.item(0))).to.equal(layer);
|
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);
|
simulateEvent('singleclick', 10, -20);
|
||||||
|
|
||||||
expect(listenerSpy.callCount).to.be(1);
|
expect(listenerSpy.callCount).to.be(1);
|
||||||
@@ -362,7 +362,7 @@ describe('ol.interaction.Select', function() {
|
|||||||
interaction.on('select', listenerSpy);
|
interaction.on('select', listenerSpy);
|
||||||
|
|
||||||
simulateEvent('singleclick', 10, -20);
|
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);
|
simulateEvent('singleclick', 10, -20);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user