mapbox / mapbox/mapbox-gl-directions
Error when using custom styles and removeControl method
Open
auto-triaged
bug
- Dominant language
- JavaScript
- Stars
- 255
- Forks
- 130
- PR merge metrics
- No merged PRs in 30d
Description
I'm getting the error: `Uncaught TypeError: Cannot read property 'recalculate' of undefined` after I use the map.removeControl method on the directions control. Also, it's only happening when using custom styles.
Here's a JSFiddle showing the issue: https://jsfiddle.net/bryantaxs/uomq0zvz/
Any thoughts on this one?
Contributor guide
Research direction
Start by running the linked JSFiddle and reproducing the error after calling map.removeControl on the directions control with custom styles. Trace the resulting `recalculate` access and verify that removing the control no longer throws the reported TypeError in that configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100