The above code is executed when our JS file loads. Later, when we try to call a method on the ‘availability’ object, we find that is NULL.
It seems that for some users-systems, availability is always NULL. Do you know what the cause could be? In general, would you be able to list all of the potential causes of this object being NULL? I have reviewed your documentation but it is still not very clear to me and doesn’t explain why it would keep returning NULL for certain users.
That’s odd, is the terrain loading correctly for these users visually? But the availability is always null for them? Can you get any more information, like are there any failed requests in the network console? What browser and OS are they using?
I believe availability is computed from the layer.json that is initially requested, so if that request is successful I’d expect that the availability be defined (but I wouldn’t expect the terrain to work if that’s not defined).
Thanks Omar - is there a chance that this would happen on certain browsers…old versions of IE perhaps?
Unfortunately, it is not possible to get info from the user’s network console and we are not actually displaying the terrain visually - we are just querying specific lat / long points to get their elevation.
It is certainly possible that the combination of browser/OS could be triggering a bug here, but I’m not aware of any known issue that causes this.
Any information you can collect that to help reproduce and narrow this down would be great. If you’re not displaying the terrain visually, how are you verifying that the terrain is loading successfully? You can see in the source code this is where the availability is computed:
If the layer.json request fails for any reason, then CesiumJS cannot load this terrain/cannot get the availability. I would also ask the user to confirm they can access Cesium World Terrain on their network, like by loading one of these examples: https://sandcastle.cesium.com/index.html?src=Terrain.html.