xcube-dev / xcube-viewer

A simple viewer component for xcube-server
https://xcube-dev.github.io/xcube-viewer/
MIT License
29 stars 10 forks source link

Viewer crashes when adding 11th user feature data on the map #299

Closed AliceBalfanz closed 1 year ago

AliceBalfanz commented 1 year ago

If I create more than 10 point locations in the viewer, it crashes with the following error: Looks like it hits a limit for user created feature data

Uncaught runtime errors:
ERROR
Assertion failed. See https://openlayers.org/en/v6.15.1/doc/errors/#14 for details.
AssertionError@http://localhost:3000/static/js/bundle.js:239401:20
assert@http://localhost:3000/static/js/bundle.js:247101:11
fromStringInternal_@http://localhost:3000/static/js/bundle.js:247377:56
./node_modules/ol/color.js/fromString@http://localhost:3000/static/js/bundle.js:247306:17
asArray@http://localhost:3000/static/js/bundle.js:247325:12
./node_modules/ol/style/RegularShape.js/RegularShape.prototype.createHitDetectionCanvas_@http://localhost:3000/static/js/bundle.js:286314:67
./node_modules/ol/style/RegularShape.js/RegularShape.prototype.getHitDetectionImage@http://localhost:3000/static/js/bundle.js:286025:12
./node_modules/ol/render/canvas/ImageBuilder.js/CanvasImageBuilder.prototype.setImageStyle@http://localhost:3000/static/js/bundle.js:274720:42
renderPointGeometry@http://localhost:3000/static/js/bundle.js:279179:17
renderFeatureInternal@http://localhost:3000/static/js/bundle.js:279048:21
renderFeature@http://localhost:3000/static/js/bundle.js:279026:24
./node_modules/ol/renderer/canvas/VectorLayer.js/CanvasVectorLayerRenderer.prototype.renderFeature@http://localhost:3000/static/js/bundle.js:278856:76
./node_modules/ol/renderer/canvas/VectorLayer.js/CanvasVectorLayerRenderer.prototype.prepareFrame/render<@http://localhost:3000/static/js/bundle.js:278808:26
./node_modules/ol/renderer/canvas/VectorLayer.js/CanvasVectorLayerRenderer.prototype.prepareFrame@http://localhost:3000/static/js/bundle.js:278819:13
./node_modules/ol/layer/Layer.js/Layer.prototype.render@http://localhost:3000/static/js/bundle.js:269611:23
./node_modules/ol/renderer/Composite.js/CompositeMapRenderer.prototype.renderFrame@http://localhost:3000/static/js/bundle.js:276849:27
./node_modules/ol/PluggableMap.js/PluggableMap.prototype.renderFrame_@http://localhost:3000/static/js/bundle.js:244045:20
./node_modules/ol/PluggableMap.js/PluggableMap/_this.animationDelay_<@http://localhost:3000/static/js/bundle.js:243023:12
ERROR
Assertion failed. See https://openlayers.org/en/v6.15.1/doc/errors/#14 for details.
AssertionError@http://localhost:3000/static/js/bundle.js:239401:20
assert@http://localhost:3000/static/js/bundle.js:247101:11
fromStringInternal_@http://localhost:3000/static/js/bundle.js:247377:56
./node_modules/ol/color.js/fromString@http://localhost:3000/static/js/bundle.js:247306:17
asArray@http://localhost:3000/static/js/bundle.js:247325:12
./node_modules/ol/style/RegularShape.js/RegularShape.prototype.createHitDetectionCanvas_@http://localhost:3000/static/js/bundle.js:286314:67
./node_modules/ol/style/RegularShape.js/RegularShape.prototype.getHitDetectionImage@http://localhost:3000/static/js/bundle.js:286025:12
./node_modules/ol/render/canvas/ImageBuilder.js/CanvasImageBuilder.prototype.setImageStyle@http://localhost:3000/static/js/bundle.js:274720:42
renderPointGeometry@http://localhost:3000/static/js/bundle.js:279179:17
renderFeatureInternal@http://localhost:3000/static/js/bundle.js:279048:21
renderFeature@http://localhost:3000/static/js/bundle.js:279026:24
./node_modules/ol/renderer/canvas/VectorLayer.js/CanvasVectorLayerRenderer.prototype.renderFeature@http://localhost:3000/static/js/bundle.js:278856:76
./node_modules/ol/renderer/canvas/VectorLayer.js/CanvasVectorLayerRenderer.prototype.prepareFrame/render<@http://localhost:3000/static/js/bundle.js:278808:26
./node_modules/ol/renderer/canvas/VectorLayer.js/CanvasVectorLayerRenderer.prototype.prepareFrame@http://localhost:3000/static/js/bundle.js:278819:13
./node_modules/ol/layer/Layer.js/Layer.prototype.render@http://localhost:3000/static/js/bundle.js:269611:23
./node_modules/ol/renderer/Composite.js/CompositeMapRenderer.prototype.renderFrame@http://localhost:3000/static/js/bundle.js:276849:27
./node_modules/ol/PluggableMap.js/PluggableMap.prototype.renderFrame_@http://localhost:3000/static/js/bundle.js:244045:20
./node_modules/ol/PluggableMap.js/PluggableMap/_this.animationDelay_<@http://localhost:3000/static/js/bundle.js:243023:12
ERROR
Assertion failed. See https://openlayers.org/en/v6.15.1/doc/errors/#14 for details.
AssertionError@http://localhost:3000/static/js/bundle.js:239401:20
assert@http://localhost:3000/static/js/bundle.js:247101:11
fromStringInternal_@http://localhost:3000/static/js/bundle.js:247377:56
./node_modules/ol/color.js/fromString@http://localhost:3000/static/js/bundle.js:247306:17
asArray@http://localhost:3000/static/js/bundle.js:247325:12
./node_modules/ol/style/RegularShape.js/RegularShape.prototype.createHitDetectionCanvas_@http://localhost:3000/static/js/bundle.js:286314:67
./node_modules/ol/style/RegularShape.js/RegularShape.prototype.getHitDetectionImage@http://localhost:3000/static/js/bundle.js:286025:12
./node_modules/ol/render/canvas/ImageBuilder.js/CanvasImageBuilder.prototype.setImageStyle@http://localhost:3000/static/js/bundle.js:274720:42
renderPointGeometry@http://localhost:3000/static/js/bundle.js:279179:17
renderFeatureInternal@http://localhost:3000/static/js/bundle.js:279048:21
renderFeature@http://localhost:3000/static/js/bundle.js:279026:24
./node_modules/ol/renderer/canvas/VectorLayer.js/CanvasVectorLayerRenderer.prototype.renderFeature@http://localhost:3000/static/js/bundle.js:278856:76
./node_modules/ol/renderer/canvas/VectorLayer.js/CanvasVectorLayerRenderer.prototype.prepareFrame/render<@http://localhost:3000/static/js/bundle.js:278808:26
./node_modules/ol/renderer/canvas/VectorLayer.js/CanvasVectorLayerRenderer.prototype.prepareFrame@http://localhost:3000/static/js/bundle.js:278819:13
./node_modules/ol/layer/Layer.js/Layer.prototype.render@http://localhost:3000/static/js/bundle.js:269611:23
./node_modules/ol/renderer/Composite.js/CompositeMapRenderer.prototype.renderFrame@http://localhost:3000/static/js/bundle.js:276849:27
./node_modules/ol/PluggableMap.js/PluggableMap.prototype.renderFrame_@http://localhost:3000/static/js/bundle.js:244045:20
./node_modules/ol/PluggableMap.js/PluggableMap/_this.animationDelay_<@http://localhost:3000/static/js/bundle.js:243023:12
ERROR
Assertion failed. See https://openlayers.org/en/v6.15.1/doc/errors/#14 for details.
AssertionError@http://localhost:3000/static/js/bundle.js:239401:20
assert@http://localhost:3000/static/js/bundle.js:247101:11
fromStringInternal_@http://localhost:3000/static/js/bundle.js:247377:56
./node_modules/ol/color.js/fromString@http://localhost:3000/static/js/bundle.js:247306:17
asArray@http://localhost:3000/static/js/bundle.js:247325:12
./node_modules/ol/style/RegularShape.js/RegularShape.prototype.createHitDetectionCanvas_@http://localhost:3000/static/js/bundle.js:286314:67
./node_modules/ol/style/RegularShape.js/RegularShape.prototype.getHitDetectionImage@http://localhost:3000/static/js/bundle.js:286025:12
./node_modules/ol/render/canvas/ImageBuilder.js/CanvasImageBuilder.prototype.setImageStyle@http://localhost:3000/static/js/bundle.js:274720:42
renderPointGeometry@http://localhost:3000/static/js/bundle.js:279179:17
renderFeatureInternal@http://localhost:3000/static/js/bundle.js:279048:21
renderFeature@http://localhost:3000/static/js/bundle.js:279026:24
./node_modules/ol/renderer/canvas/VectorLayer.js/CanvasVectorLayerRenderer.prototype.renderFeature@http://localhost:3000/static/js/bundle.js:278856:76
./node_modules/ol/renderer/canvas/VectorLayer.js/CanvasVectorLayerRenderer.prototype.prepareFrame/render<@http://localhost:3000/static/js/bundle.js:278808:26
./node_modules/ol/renderer/canvas/VectorLayer.js/CanvasVectorLayerRenderer.prototype.prepareFrame@http://localhost:3000/static/js/bundle.js:278819:13
./node_modules/ol/layer/Layer.js/Layer.prototype.render@http://localhost:3000/static/js/bundle.js:269611:23
./node_modules/ol/renderer/Composite.js/CompositeMapRenderer.prototype.renderFrame@http://localhost:3000/static/js/bundle.js:276849:27
./node_modules/ol/PluggableMap.js/PluggableMap.prototype.renderFrame_@http://localhost:3000/static/js/bundle.js:244045:20
./node_modules/ol/PluggableMap.js/PluggableMap/_this.animationDelay_<@http://localhost:3000/static/js/bundle.js:243023:12

image

pont-us commented 1 year ago

The link https://openlayers.org/en/v6.15.1/doc/errors/#14 in the backtrace describes the error as "Invalid color", so it seems plausible that something is falling off the end of a colour look-up table, or hitting an invalid item.

pont-us commented 1 year ago

userPlaceColorsArray looks relevant.

pont-us commented 1 year ago

This looks like the cause: the 11th item of userPlaceColorsArray is deepPurple, but according to this list deepPurple is not a valid CSS colour name. So removing it, or replacing it with a valid colour name, should fix the error.