-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
setFeatureState Throws Error #8634
Comments
@econ24 Thank you for reporting this issue. I am not able to reproduce the bug in the jsfiddle. It looks like the style used in the demo is private and cannot be accessed by other access tokens. Could you provide a demo with a public style or one that uses a mapbox style or other simplified style where this issue can be reproduced. |
I updated the fiddle with a public style. I don't believe the mapbox account I am using is an enterprise account so the tileset should be public. |
I experience this bug too. It is very annoying when switching between layers by adding and removing them. |
We are experiencing the same issue. Appears to be happening through switching layers and use of feature state. |
I'm facing this issue as well, under the same conditions of @econ24. |
Did a little investigation to understand what is causing this issue. When a layer is removed, it is marked for removal and then processed on the next render by updating the grouping of layers in the works by these two chunks mapbox-gl-js/src/style/style.js Lines 375 to 381 in 4f0ab92
mapbox-gl-js/src/source/worker.js Lines 88 to 91 in 4f0ab92
The update layer index is not re-applied to the tiles though, so existing buckets on the main thread continue to hang on to removed layer ids and are being processed unneccesarily at: mapbox-gl-js/src/source/tile.js Lines 394 to 397 in 4f0ab92
The shortcut to fix this would be to add a |
mapbox-gl-js version: v1.2.1
browser: Chrome Version 70.0.3538.77 (Official Build) (64-bit)
Steps to Trigger Behavior
Link to Demonstration
https://jsbin.com/yuruvibiqa/edit?html,js,output
I removed my mapboxgl.accessToken.
The error occurs after the setTimeout function removes a layer.
Expected Behavior
setFeatureState works as intended.
Actual Behavior
setFeatureState throws the following error:
Uncaught TypeError: Cannot read property 'queryRadius' of undefined
at Ou.setFeatureState (tile.js:464)
at Vu.coalesceChanges (source_state.js:154)
at i.prepare (source_cache.js:170)
at ao.render (painter.js:340)
at r._render (map.js:1753)
at map.js:1837
The text was updated successfully, but these errors were encountered: