Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates for the 7.5.2 release #15067

Merged
merged 3 commits into from Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog/v7.5.2.md
@@ -0,0 +1,5 @@
# 7.5.2

The 7.5.2 is a patch release that includes a fix for hit detection on Vector and VectorTile layers configured with `declutter: true`. See the [7.5.0 release notes](./v7.5.0.md) for a complete list of changes since the previous release.

* Keep declutter tree for hit detection (by @ahocevar in https://github.com/openlayers/openlayers/pull/15028)
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "ol",
"version": "7.5.1",
"version": "8.0.0-dev",
"description": "OpenLayers mapping library",
"keywords": [
"map",
Expand Down
1 change: 0 additions & 1 deletion src/ol/renderer/Composite.js
Expand Up @@ -161,7 +161,6 @@ class CompositeMapRenderer extends MapRenderer {
for (let i = layers.length - 1; i >= 0; --i) {
layers[i].renderDeclutter(frameState);
}
frameState.declutterTree = null;
layers.length = 0;
}
}
Expand Down
49 changes: 49 additions & 0 deletions test/browser/spec/ol/renderer/canvas/vectortilelayer.test.js
Expand Up @@ -14,6 +14,7 @@ import VectorTileLayer from '../../../../../../src/ol/layer/VectorTile.js';
import VectorTileSource from '../../../../../../src/ol/source/VectorTile.js';
import View from '../../../../../../src/ol/View.js';
import XYZ from '../../../../../../src/ol/source/XYZ.js';
import {VOID} from '../../../../../../src/ol/functions.js';
import {checkedFonts} from '../../../../../../src/ol/render/canvas.js';
import {create} from '../../../../../../src/ol/transform.js';
import {createFontStyle} from '../../../util.js';
Expand Down Expand Up @@ -608,5 +609,53 @@ describe('ol/renderer/canvas/VectorTileLayer', function () {
}, 200);
});
});

it('does not fail after flushDeclutterItems()', (done) => {
const target = document.createElement('div');
target.style.width = '100px';
target.style.height = '100px';
document.body.appendChild(target);
const extent = [
1824704.739223726, 6141868.096770482, 1827150.7241288517,
6144314.081675608,
];
const source = new VectorTileSource({
format: new MVT(),
url: 'spec/ol/data/14-8938-5680.vector.pbf',
minZoom: 14,
maxZoom: 14,
});
const layer = new VectorTileLayer({
declutter: true,
extent: extent,
source: source,
});
const map = new Map({
target: target,
layers: [layer],
view: new View({
center: getCenter(extent),
zoom: 14,
}),
});
map.once('rendercomplete', () => {
setTimeout(() => {
map.setTarget(null);
document.body.removeChild(target);
}, 0);
expect(() => {
layer
.getRenderer()
.forEachFeatureAtCoordinate(
getCenter(extent),
map.frameState_,
1,
VOID,
[]
);
}).to.not.throwException();
done();
});
});
});
});