Closed leefsmp closed 4 years ago
Hello
It should be supported by FF https://developer.mozilla.org/en-US/docs/Web/API/Document/currentScript
I will take a look at it, thanks a lot for reporting this bug.
Seems to be working without any errors on firefox. Can you please provide some additional details?
I'm using webpack if that makes any difference... the demo at https://tentone.github.io/potree-core is also working in FF on my side.
Yeah that is possible the problem anyway you can override the location of the workers on the Potree.Global.workerPath
attribute.
Just set it to the path where you have the decode workers.
Doing that already:
import {
loadPointCloud,
PointColorType,
PointSizeType,
PointShape,
Global,
Group
} from 'potree-core/build/potree.module'
const PotreeCore = {
loadPointCloud,
PointColorType,
PointSizeType,
PointShape,
Global,
Group
}
// ...
initialize () {
// ...
PotreeCore.Global.workerPath = '/resources/potree' //contains folder /workers
}
I have added an additional check to make sure that the currentScript exists before using it. Should be enough to prevent the error.
You will still need to set the workerPath pointing to the correct location (relative to your doc path or web server root)
Working now, thanks a lot for your prompt replies and the great lib!
No problem happy to be of use. Thanks a lot for reporting the problem.
Working perfectly in Chrome and Safari, getting following error in Firefox:
OS: MacOS High Sierra 10.13.3