You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Removing a symbol layer and immediately readding it as a circle layer causes TypeError in draw_circle #3633
map.removeLayer('a'); map.addLayer({ id: 'a', type: 'circle', source: (same as the symbol layer) })
Expected Behavior
There are no errors
Actual Behavior
TypeError: Cannot read property 'circle' of undefined
at Object.drawCircles [as circle] (/Users/anand/c/mapbox/mapbox-gl-js/js/render/draw_circle.js:27:44)
at Painter.renderLayer (/Users/anand/c/mapbox/mapbox-gl-js/js/render/painter.js:271:25)
at Painter.renderPass (/Users/anand/c/mapbox/mapbox-gl-js/js/render/painter.js:254:18)
at Painter.render (/Users/anand/c/mapbox/mapbox-gl-js/js/render/painter.js:213:14)
at Map._render (/Users/anand/c/mapbox/mapbox-gl-js/js/ui/map.js:1141:22)
at Immediate.immediate._onImmediate (timers.js:585:18)
at tryOnImmediate (timers.js:543:15)
at processImmediate [as _immediateCallback] (timers.js:523:5)
I think the problem is that, since this is happening in a single batch, the it's being treated by the source cache as an update--specifically, the tiles' states are set to reloading, so that they are still considered renderable. In the render pass that happens after the layer's been re-added but before the tile reloading is complete, we end up trying to render them as a circle-layer tiles, but the buffers aren't set up for that yet.
@jfirebaugh found this while adding a runtime-styling test for setStyle (changing a layer's type) -- do you think this should block #3621, or be left as a follow-up? (In the latter case, I could add an ignore for js pointing to this issue.)
Activity
anandthakker commentedon Nov 16, 2016
@jfirebaugh found this while adding a runtime-styling test for setStyle (changing a layer's type) -- do you think this should block #3621, or be left as a follow-up? (In the latter case, I could add an
ignorefor js pointing to this issue.)jfirebaugh commentedon Nov 16, 2016
This sort of situation will be more common with #3621, so let's fix it first.
anandthakker commentedon Nov 16, 2016
👍 sounds good.
On Wed, Nov 16, 2016 at 2:18 PM John Firebaugh [email protected]
wrote:
Clear source tiles for removed/re-added layer
Add regression test for mapbox/mapbox-gl-js#3633
Clear source tiles for removed/re-added layer
Clear source tiles for removed/re-added layer (#3655)
Add regression test for mapbox/mapbox-gl-js#3633