mapbox / mapbox/mapbox-gl-draw

crash after adding a canvas to map (no error thrown)

Open
#639 16 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug rendering
Dominant language
JavaScript
Stars
1.1k
Forks
612
Avg merge
8d 9h
Merged PRs (30d)
5

Description

**mapbox-gl-js version**: 0.36.0
**mapbox-gl-draw version**: 0.17.0

### Steps to Trigger Behavior

Add a canvas source like:
```
map.addSource('heatmapsource', {
type: 'canvas',
canvas: 'heatmap-canvas',
animate: true,
coordinates: [
[west, north],
[east, north],
[east, south],
[west, south]
]
});
```
It does not matter if you add it before or after initialising Mapbox Draw

### Expected Behavior
It should work.

### Actual Behavior
It doesn't. All features disappear, when clicking a draw control, the cursor does not even become a crosshair, total f up. No error thrown :-(

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with mapbox-gl-js 0.36.0, mapbox-gl-draw 0.17.0, the canvas source example, and both initialization orders. Compare the map with and without the canvas source, then verify that Draw controls remain usable, features stay visible, and no silent crash occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.