Add "skipWorker" option to GeoJSON sources [DO NOT MERGE] - #1979
Add "skipWorker" option to GeoJSON sources [DO NOT MERGE]#1979lucaswoj wants to merge 2 commits into
Conversation
|
Assuming this is faster for X features and less, why make it a flag? Why not just always do it for that number of features? I'm guessing number of features will be too simple. The size of the geometry might mater more. Either way, if this gets into gl-js, we should have a recommendation of when to use which mode. |
These are all great questions for which I don't yet have good answers. I think the answer will be one of:
|
|
ref #1180 |
|
As an added bonus, this would also allow for easier integration testing (ref #1987 (comment)) |
|
@lucaswoj I'm 👍 on such an option (off by default, no smart heuristics for now). The main tricky thing here is how to DRY up the code. :) Will probably require moving out GeoJSON handling into a separate file. |
|
My plan for DRYing this code is to refactor the |
|
We might be able to get similar performance characteristics using a transferrable byte array containing stringified GeoJSON or geobuf. #1504 |
|
Closing while we consider other solutions to this problem in #1504 |
|
#2224 is a much better solution than this PR. |
Many users, especially mapbox-gl-draw, have demonstrated a need for high responsiveness in updating GeoJSON sources. One potential solution is to do GeoJSON parsing / tiling in the main thread rather than the worker.
mapbox/mapbox-gl-draw#185
Next Steps
featuresIn/featuresAt