Crash when panning/rotating/zooming a lot

Here’s a crash from your own Viewer app. It happens when I aggressively zoom, rotate, and pan the globe. This is with Chrome on Windows 7. I notice that the URL contains lots of "NaN"s…not sure if that helps you at all. Any ideas on what might be causing it?

Here’s what appears to be the same error, from our own app. However, the stack trace isn’t the same. It traces it back to jQuery. Any idea why?



If you use $.getScript(CESIUM_URL) to load Cesium Then you will have this bad stack trace as no source map was loaded.
I’ve made a trick to overcome this.

Instead of $.getScript, I use jQuery ajax request and add my source map


.ajax({ url : CESIUM_URL, converters : { 'text script' : function(result){ // Add a Cesium's source URL at the end of file and return the modified result result += '\r\n//# sourceURL=' + CESIUM_URL; return result; } }, success : function(cesiumCode){ // Execute the modified result .globalEval(cesiumCode);


Explanation :

Instead of relying on jQuery to get the script, we tell jQuery to make an ajax request that we will handle on our own.

The converters property tells jQuery to fire a callback when ‘text script’ response received.

To that original response Cesium.js content, I add a special line “\r\n# sourceURL=…”

which tricks chrome to load the source of a dynamically loaded javascript (must be on a separate line, therefore the \r\n).

I learnt it here : dynamic javascript breakpoints

After I return the modified script, the success callback is fired, which calls $.globalEval to load Cesium