I get the following error when loading a KMZ.
"Uncaught DOMException: Failed to construct 'Worker': Script at 'https://YYYYY.com/ThirdParty/Workers/inflate.js' cannot be accessed from origin 'https://ZZZZZZ.com'."
This is because ThirdParty/zip.js tries to build a worker blindly using the domain that the code is sitting on. The worker code does exist at the target url, but the browser won't allow access to it.
```zip.js
if (obj.zip.useWebWorkers) {
worker = new Worker(obj.zip.workerScriptsPath + INFLATE_JS);
launchWorkerProcess(worker, reader, writer, offset, size, oninflateappend, onprogress, oninflateend, onreaderror, onwriteerror);
} else
launchProcess(new obj.zip.Inflater(), reader, writer, offset, size, oninflateappend, onprogress, oninflateend, onreaderror, onwriteerror);
return worker;
```
It looks like you should be able to set the `useWebWorkers` value on the zip instance, but there's no way to specify that from KmlDataSource.
Is there any way to get around creating these workers from a different domain? I know the other workers in cesium use the TaskProcessor factory to sidestep cors issues.
Can I somehow do this with the zip dependency?
I think this is the same issue referenced here https://cesiumjs.org/forum/#!topic/cesium-dev/mYpD1-fyjFs/discussion
Cesium Version 1.41.0
Chrome Version 63.0.3239.132
Hi Gabby,
I came to this conclusion of modifying zip.js too after looking back through the commits and seeing that it's already been modified to import buildModuleUrl to add the correct workerScriptsPath.
I've taken inspiration from the TaskProcessors's getWorkerUrl for this.
I have prepared a small PR and will likely submit it today following the guidelines laid out in GitHub.
Thanks for your help,
Andew
--
You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/dq2l5L69L0U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Andrew McDowell
Visualiser Team - Frontend Wizard | +61 481516548 | and...@propelleraero.com
propelleraero.com | we’re hiring! | latest news
To unsubscribe from this group and all its topics, send an email to cesium-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.