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

Improve Heatmap hit detection test #10115

Merged
merged 1 commit into from Oct 11, 2019
Merged
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
12 changes: 9 additions & 3 deletions test/spec/ol/layer/heatmap.test.js
Expand Up @@ -44,7 +44,7 @@ describe('ol.layer.Heatmap', function() {
}),
target: target
});
map.renderSync();
map.render();

function hitTest(coordinate) {
const features = map.getFeaturesAtPixel(
Expand All @@ -53,7 +53,13 @@ describe('ol.layer.Heatmap', function() {
return features.length ? features[0] : null;
}

setTimeout(function() {
const renderer = layer.getRenderer();
renderer.worker_.addEventListener('message', function(event) {
if (!renderer.hitRenderInstructions_) {
return;
}
map.renderSync();

let res;

res = hitTest([0, 0]);
Expand All @@ -67,7 +73,7 @@ describe('ol.layer.Heatmap', function() {

document.body.removeChild(target);
done();
}, 100);
});
});

});
Expand Down