articodeltd / angular-cesium

JavaScript library for creating map based web apps using Cesium and Angular
https://github.com/articodeltd/angular-cesium/settings/pages
MIT License
178 stars 93 forks source link

Drawing a polygon with PolygonEditorService causes infinite render loop #358

Open leohaughton opened 4 years ago

leohaughton commented 4 years ago

Intended outcome: I am attempting to improve the performance of the Cesium map inside my Angular application by setting requestRenderMode to true. When I use the PolygonEditorService to draw a polygon I set requestRenderMode to false so that the user can see the polygon being drawn. Then once the user has completed drawing the polygon I switch requestRenderMode to true again. I expect that this would only render the map at 60Hz while requestRenderMode is set to false.

Actual outcome: When the user completes the polygon and requestRenderMode is switched to true, the map continues to render. I can see this on my CPU / GPU monitor.

How to reproduce the issue: I have changed the PolygonEditorService StackBlitz example to reproduce this issue: https://stackblitz.com/edit/angular-cesium-polygon-editor-example-kctcwf

Reproduction Steps Please monitor your CPU/GPU usage while performing the reproduction.

  1. Run the application in the example above
  2. Click the "Set Request Render Mode to True" button. You should see the usage of your CPU/GPU decrease.
  3. Click the "Create Polygon" button and draw some points. The points will not render because request render mode is set to true.
  4. Click the "Set Request Render Mode to False" button. You should see your CPU/GPU usage increase.
  5. Double click to close your polygon
  6. Click the "Set Request Render Mode to True" button.

After completing these steps you will see that the CPU/GPU usage remains high despite requestRenderMode being set to true.

Version StackBlitz version "angular-cesium": "^0.0.61", "cesium": ">= 1.48.0",

I have also reproduced the issue with: "angular-cesium": "0.0.66", "cesium": "^1.71.0",