Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imagery stops being requested. #7817

Closed
jfrancis537 opened this issue May 6, 2019 · 10 comments
Closed

Imagery stops being requested. #7817

jfrancis537 opened this issue May 6, 2019 · 10 comments

Comments

@jfrancis537
Copy link

After updating to the latest version of cesium I noticed that imagery will stop loading, http requests for the imagery are no longer going out.

I did notice that my event handler on my imageryProvider.errorEvent is no longer being called in 1.56.1+ vs 1.55 "throwing" a tile not found error.

Environment Details:
Our imagery is incomplete, we are missing various sections.
Our environment is offline.

Works Correctly in: Cesium 1.55
Version: Cesium 1.57 and 1.56.1

@hpinkos
Copy link
Contributor

hpinkos commented May 7, 2019

@kring any ideas here?

@hpinkos
Copy link
Contributor

hpinkos commented May 7, 2019

@jfrancis537 Do you also see this issue in Sandcastle? https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/
If not, can you please put together a code sample to reproduce this? Thanks!

@jfrancis537
Copy link
Author

I can't find a way to reproduce it in Sandcastle because I don't have an imagery set located outside of our closed network, but I think I found the source of the issue / a workaround.

We use a UrlTemplateImageryProvider which makes a call to the server which would look up the image on the filesystem and return it as Content-Type jpeg.
it looks somewhat like this:

let imageryProvider = new Cesium.UrlTemplateImageryProvider({
 url: Cesium.buildModuleUrl("/endpoint/{somecustomtag}"),
 customTags: {
     someCustomTag: function() {
       ...doSomething
    }
 }
});

Given that our imagery is incomplete, if the image doesn't exist, we return an HttpResponse with a status code of 204 No content. Once one of those is received in the browser, the imagery stops loading.

However If the status code is changed to 404, the imagery continues to load as expected.

@jfrancis537
Copy link
Author

jfrancis537 commented May 7, 2019

It doesn't appear as though the actual content matters. Returning a 200 with a text/plain, still works as expected.

After further testing it only appears to do this with the 204 response.

@kring
Copy link
Member

kring commented May 8, 2019

That's very odd, I can't think of why a 204 would be different from an invalid-image 200. Is there a proper Access-Control-Allow-Origin: * header in the response in both cases?

@jfrancis537
Copy link
Author

jfrancis537 commented May 8, 2019

Neither has that header.

@OmarShehata
Copy link
Contributor

@jfrancis537 just to rule out ImageBitmap as the culprit, can you add the snippet in #7735 at the top of your code before requesting any imagery and see if the issue still happens?

@jfrancis537
Copy link
Author

jfrancis537 commented May 10, 2019

Adding that snippet does make the issue go away.

@OmarShehata
Copy link
Contributor

@jfrancis537 can you check if this issue is still present with the latest CesiumJS? I made a fix here #7914 that might have resolved this.

@jfrancis537
Copy link
Author

Yep, it fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants