Faster hit detection with tens of thousands of polygon features.

Open
#17,417 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Quiet
Tech stack
javascript
Domain
performance

Research direction

Start by tracing the hit detection instructions, executor, RTree, and loadFeature() paths mentioned in the issue. Determine whether a bounded-area hit test or an existing example can address the slowdown, and define done as a documented or implemented approach that avoids processing distant polygon features.

Written by the indexing model from the issue text.

Description

feature request

When I have many polygon features on the map, and all of those are shown, (you can imagine all cities in the US are shown in the view). my pointer hover action can be slow. I see that there are optimization techniques applied, to create an executor and features kept in RTree etc. but in the situation it still requires to have a list of all features in "hit detection instructions", when it seems to me that only features overlaps, or contained, within say 50 pixels from the pointer location. (I can give up features that are not fully contained.) Maybe there is a custom way to do this on my end, such as indeed do the loadFeature() for a smaller area each time and run hit test? Is there an existing example like this?

Dominant language
JavaScript
Stars
12.6k
Forks
3.2k
Avg merge
2d 17h
Merged PRs (30d)
21

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openlayers/openlayers

All issues in openlayers/openlayers

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.