opened
samanpwbb
username_0
Right now if you're drawing a polygon and you run setDrawMode('polygon'), the stop event triggers, followed by the start event, but the `stop` event doesn't actually stop user from drawing. There are a few options:

1. If you setDrawMode while user is already drawing, noop
2. If you setDrawMode while user is already drawing, abandon in-progress line/polygon, and start fresh

@mcwhittemore do you have a preference for one of those options? Both seem acceptable, but option 2 might be more consistent with how select modes work so I'd lean towards that option.
If setDrawMode when already in a draw mode, weird things happen
issue
created
samanpwbb
username_0
It's possible to reproduce this bug in `http://localhost:9966/debug/` by pressing `3`, drawing a few nodes, pressing `3` again, drawing a few nodes, and then double-clicking to complete the polygon. You will observe a zoom, because of this line: https://github.com/mapbox/mapbox-gl-draw/blob/a9c9d1c43c94082225ef8574cf78b6e9e9e55208/src/modes/draw_polygon.js#L68
comment
created
samanpwbb
username_0
Upon further investigation, this bug entirely is entirely due to the fact that `ctx.map.doubleClickZoom.disable();` is wrapped in a setTimeout in the `stop` event but not the `start` event.
comment
closed
samanpwbb
username_0
issue