Short answer: you don’t need to add your own quadtree. OpenLayers already indexes vector features with an R-tree (RBush) and forEachFeatureAtPixel uses that index for hit-testing. You’ll usually get bigger wins by narrowing what gets tested and by querying a source’s index directly.
Use QuadTree for better complexity on search features?
I want to improve the complexity of search specific feature when using this function :
map.forEachFeatureAtPixel(e.pixel, function (feature, layer) {
// Do something..
});
The improvment will occur by using QuadTree? How can i approach to this situation ?
Follow
1
Add comment
More
Report
1 Expert Answer
Still looking for help? Get the right answer, fast.
Ask a question for free
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Find an Online Tutor Now
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.