-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Rendering Error caused by Scene.pick
#12438
Comments
Apologies for the delayed response @fawick.
I can't reproduce this in Sandcastle either. It would be helpful to identify what's different between Sandcastle and your app's environment which allows the crash to happen. Is it the same geojson data in both cases? As a workaround, maybe your mouse move handler could return early if |
@ggetz The GeoJSON example data in the sandcastle is representative for the real data. In our production use use, the GeoJSON is generated dynamically by a HTTP backend. I am alreading using for (let i = 0; i < map.dataSources.length; i++) {
if (map.dataSources.get(i).isLoading) {
console.log(map.dataSources.get(i).name, "is still loading");
map.scene.canvas.style.cursor = '';
clearTooltip();
return;
}
}
if (!map.scene.globe.tilesLoaded) {
console.log("still loading tiles");
map.scene.canvas.style.cursor = '';
clearTooltip();
return;
}
const feature = map.scene.pick(e.endPosition, 1, 1);
if (!feature) {
// don't do anything if no feature is under mouse pointer
map.scene.canvas.style.cursor = '';
clearTooltip();
return;
} In the event of the error all datasources are reporting back to be fully loaded. Is there a chance, that the |
The error seems to be coming from a particular geometry primitive, the underlying graphical representation of an individual feature. It'll be difficult to track down the error without some data that can reproduce it.
It's not clear from only looking at |
(NB: Since opening this issue I've rewritten my code to manually parse and convert data fetched via HTTP as GeoJSON into
I'll try to come up with example data that reproduces the error in a Sandcastle. I'm a bit at at loss how to do that best, given that the error only seems to occur when I replace geometry. The scheduled task that fails is One more thought: If there were a way to determine when Cesium had finished all
Ah, of course, thanks. I totally overlooked that. |
Yes, exactly. We batch together geometry data (think polygons, rectangles, circles, and other triangle-based primitives) for better runtime performance. Once the geometry has been broken down into the components needed for rendering, like vertices and indices, the combineGeometry step runs.
The tricky part about troubleshooting this is there are two levels of abstraction at play here— The Entity API, which is higher-level and manages dynamic changes; and the lower-level Primitive API which handle the geometry rendering and are created under-the-hood by the Entity API. What you're looking for here would be accessible from the Primitive API, but not easily through the Entity API. Overall, this is likely symptomatic of something going amiss with processing the geometry at the primitive level. And that's why having representative data (the suspect geometry data) would be so helpful to determine the root issue.
Sure! As long as it's fairly minimal to reduce the risk of interactions with other code. |
I have created a Sandcastle with a representative set of the polygon geometries: The real application works a bit differently, as the GeoJSON for each sign is fetched individually from the backend and converted and colored. But the full set of polygons is exactly the same. |
What happened?
In my Viewer, GeoJSON Datasources may be reload based on user interaction with parameters defined outside of cesium. The GeoJSON is fetched in a dedicated request and the method
GeoJsonDataSource.load(data, options)
is called on the response data.In a callback for
Cesium.ScreenSpaceEventType.MOUSE_MOVE
, I callScene.pick
in a Viewer to generate tooltips and change the mouse cursor depending on what is below the mouse cursor. Occasionally, the call topick
results in a rendering error like so:This seems to correlate with the loading of new GeoJSON data. With Chrome developer tools I located the throw of the underlying exception to
TaskProcessor.js
This is the callstack of the exception:
The Sandcastle link below is for demonstrating the general layout of my code, i.e. reloading GeoJSON at the same time a mouseMove handler calls pick. However, in Sandcastle, the rendering loop does not crash. I was unable to reproduce the crash with Sandcastle.
By setting a breakpoint at the
throw
inscheduleTask
I could fetch this screenshot for the state of the parameter forscheduleTask
Reproduction steps
In my application:
Sandcastle example
https://sandcastle.cesium.com/#c=nVVtb+M2DP4rWoChMhbI6W6fljRY5mZrdm1T1OkBQ1McVJtJtMqSIclJs6H/fZTfEvdywG354MjSQ/Ih+VBOtLKOWJ3BLAXlxEqAIRfkLNt/XoP+y2p1NlyqpEQ93F9bPHtcKkLONs7l9ucw3Ink5VkbxRS40HKVJtw6CSl3POSs8dH/Zpvn/2GTtDZL9YR0JThSGDlTKbwi4QFuNTlsBezKDBXsSARWFBn7VO7RZS8p3yOtHBcKzLLXJ/9407fgyEOmCws3egvohEJALsYeREh1ugLuCuPPqkjMJqCA5cieAgOV3mkrnNAqGJIwJKOL+kei+0l8ReZR9HAfk8vp9I7MbsniakqiyfV1vJhEH8n8N3I3iz76YGJF6Hd1rKCKT7y/FGvg8Em42ruNUGuPVLqlJSwpsCqmyoLkWiiHiZbmHcIJV1tumXV7iS+FsbqUhReDxxpAd6p8eSMg0VXNoVOFWBcmgVue+XrUe0ykzAvN7SMtJSS+FkzvsNxMIXB4cKMxstRr+oWzoIrrH9/COcNeed5vR03coIBkqYPWgwFQcc4TmG6R31UFQJMayiy4mcoLNykp01YG/UZG8TsXi30O7Gb+EE8/38w/TSsNrQpV2hO74/nvoP+I57e07uCRZGmz/uE8IN+TD2XGK3DJhvopfGyOn4KqXsxtQFEDNsf0wGuyWTM/FzTo4OppaaV7aBy8Cuu8bNrC+AGrSm9xytyve98B2r0wgmHjxeuy8cEkqLXbkDEZBIc4TaQUQzTIx8HT8HCeMrvRO68YjsLqHEjN04Z9UOXSFpR2ghy5caY49vJ2YNuV7hE3270gfJ8w4mVbiq/mj2Htf2J5oso8TWlqg69QrhblTr3uPpeqFCpO9ZZLeqSyPvlxMBhUKlyqMLwHBBJkR8rpITvkiaoUqDEvgBQybdlSxe1Vy0xpgX15n8yJJAz4sZtISauILShB+RiONdIvE0cr1nWZI24crrj6wFZGZ5ewxoGydNBHAfUr5FFTDmg6YB7jH+cD/KvAVc1ORV0YruxKm4zWrm64M+L1Jza7nN4uZos/g/q26PV7o/I2GTfl/0VkuTbl14UyFjrIcsmRRvhcJC/gWGLbxo3CY9NRKrZEpBcnPjIkkdxaPFkVUsbib1j2xqMQ8V+YemFhb+ZbMJLvPWxzPr6uNhljoxBfT1s6reUzN+88/ws
Environment
Browser: Google Chrome 131.0.6778.265 (Official Build) (64-bit)
CesiumJS Version: 1.125
Operating System: Windows 10 22H2
The text was updated successfully, but these errors were encountered: