Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hpinkos this seems to cause the JSON load to fail for local hosted and unproxied (?) apps. I'm getting a runtime error for the deployed Sandcastle demos:
http://cesium-dev.s3-website-us-east-1.amazonaws.com/cesium/fix-approx-heights/Apps/Sandcastle/index.html?src=Polyline.html
Is there a good way to test this with a proxy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ApproximateTerrainHeights.initialize
needs to usebuildModuleUrl
like everything else, never load a Cesium required asset without it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, this is what
GroundPrimitive
does already so this should be the right thing to do. I don't know where that runtime error is coming from. I'll see if I can figure it out.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mramato
ApproximateTerrainHeights.initialize
does usebuildModuleUrl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah okay, I this is happening because
ApproximateTerrainHeights
is being used byGroundPolylinePrimitive
in a webworkerThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry about this >__<
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably no one has ever tried to use
buildModuleUrl
from a worker, which is pretty unusual. I suspect an easier path would be to load the terrain height data in the main thread and send the data across, rather than trying to re-load it independently in the worker.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively you could compute the full absolute url and send that across to the worker.