mapbox / mapbox/mapbox-gl-draw

Draw mode is not transitioning to simple_select on draw.create event

Open
#793 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

**mapbox-gl-js version**: 0.45.0
**mapbox-gl-draw version**: 1.0.9

### Steps to Trigger Behavior

Use plunker below;
https://plnkr.co/x3R0TtHsNGzxPxAOL7HH

1. After map and draw tools load, draw a point
2. The `draw.create` event fires and console.logs the feature, and the current mode.
3. Try to set the mode to `draw_point` to continue drawing points (does not work)

### Expected Behavior
Based on the documentation - https://github.com/mapbox/mapbox-gl-draw/blob/master/docs/API.md#modes

Expect the `Draw.mode` to transition to `simple_select` and that you can change the mode back to `draw_point` to continue drawing points.

### Actual Behavior
The mode is still in `draw_point` and you can not draw another point.

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

Start with the linked Plunker and reproduce the draw.create flow using draw_point, then compare the observed mode with the modes behavior described in the API documentation. Trace the draw.create event and the draw_point/simple_select transition; done means a created point leaves draw_point and allows switching back to draw_point for another point.

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
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.