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
Hi there,
I know it's not an usual thing, but in a project I have to change the map style (switching between mapbox style or customs raster-tiles).
When calling map.setStyle I'm loosing mapbox-gl-draw to draw on map (events get fired but nothing is drawn on map)
I'm using mapbox-gl v0.21.0 and mapbox-gl-draw v0.11.15
note: when using mapbox-gl v0.230 and mapbox-gl-draw v0.11.15. I'm getting errors in the console when hovering the map after a map.setStyle() [Error] TypeError: undefined is not an object (evaluating 'this._layers[o].source') queryRenderedFeatures (mapbox-gl.js:104:10527) queryRenderedFeatures (mapbox-gl.js:192:5465) exports (mapbox-gl-draw.js:5232) getFeatureAtAndSetCursors (mapbox-gl-draw.js:5246) mousemove (mapbox-gl-draw.js:4463) fire (mapbox-gl.js:218:769) h (mapbox-gl.js:162:1252) u (mapbox-gl.js:162:780)
The text was updated successfully, but these errors were encountered:
I'll close the issue, cause I manage to solve my problem.
I'm not changing the style anymore but applying addSource/addLayer | removeSource/removeLayer instead.
Hi there,
I know it's not an usual thing, but in a project I have to change the map style (switching between mapbox style or customs raster-tiles).
When calling
map.setStyle
I'm loosing mapbox-gl-draw to draw on map (events get fired but nothing is drawn on map)I'm using mapbox-gl
v0.21.0
and mapbox-gl-drawv0.11.15
Project url: https://disasterwatch.remotepixel.ca
Project code: https://github.com/RemotePixel/disasterwatch/tree/september
note: when using mapbox-gl
v0.230
and mapbox-gl-drawv0.11.15
. I'm getting errors in the console when hovering the map after a map.setStyle()[Error] TypeError: undefined is not an object (evaluating 'this._layers[o].source') queryRenderedFeatures (mapbox-gl.js:104:10527) queryRenderedFeatures (mapbox-gl.js:192:5465) exports (mapbox-gl-draw.js:5232) getFeatureAtAndSetCursors (mapbox-gl-draw.js:5246) mousemove (mapbox-gl-draw.js:4463) fire (mapbox-gl.js:218:769) h (mapbox-gl.js:162:1252) u (mapbox-gl.js:162:780)
The text was updated successfully, but these errors were encountered: