Skip to content

Conversation

kylebarron
Copy link
Member

@kylebarron kylebarron commented Nov 30, 2023

Uses geoarrow/geoarrow-js#20; uses a threadpool for earcut by default!

pickable: true,
autoHighlight: true,
})
workerUrl: new URL(
"https://gist.githubusercontent.com/kylebarron/0553b763d118bed6bad48407e9729376/raw/698855d8b237b26af65e2199a4f7914af8e203cf/earcut-worker.js",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was getting issues around "failed to construct worker, script cannot be accessed from origin", and wasn't sure if I was doing something wrong on localhost

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ref https://stackoverflow.com/questions/21913673/execute-web-worker-from-different-origin, https://stackoverflow.com/questions/67326425/construct-worker-from-script-loaded-from-different-origin

Apparently you just can't instantiate a worker cross origin...? That's annoying, but we fetch the worker directly now.

@kylebarron kylebarron changed the title WIP: earcut on a worker!! earcut on a worker!! Dec 1, 2023
@kylebarron kylebarron marked this pull request as ready for review December 1, 2023 20:25
@kylebarron kylebarron merged commit 1219de7 into main Dec 1, 2023
@kylebarron kylebarron deleted the kyle/earcut-worker2 branch December 1, 2023 20:39
@kylebarron kylebarron mentioned this pull request Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant