mapbox-gl-draw: map.on('draw.update', callback) does not fire consistently

mapbox-gl-js version: v0.39.1, v0.38.0, v0.37.0 mapbox-gl-draw version: v1.0.0, 0.19.0

Steps to Trigger Behavior

  1. Open Plunkr: https://plnkr.co/edit/Rn5AZKlDrdBBAQmdiRy2?p=preview
  2. Open Dev Tools -> Console
  3. Draw a polygon
  4. Update the polygon by moving a point
  5. Repeat step 4 and keep track of the number of times you have moved a point. After a few changes you should notice that the count variable does not represent the number of changes actually made.

Expected Behavior

The draw.update event callback should fire each time a point is moved to a new position. Which in turn would increment the count variable by one.

Actual Behavior

The draw.update event callback is not being fired consistently.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 6
  • Comments: 23 (6 by maintainers)

Commits related to this issue

Most upvoted comments

I made a fork of the v1.4.1 with fix and prepare command. You can try it:

yarn add https://github.com/gynekolog/mapbox-gl-draw.git#119ebc511726e4a54ea1fd499c7ebd853a76ef22

When will you release the fixed version? Why wait so long to release a bug fix?

Works better, but still with problems on 1.4.3.

I tried locally to apply #1160 but I’m still able to reproduce the problem by following @Maximenya instructions:

@stepankuzmin I can reproduce the problem. It seems to happen in direct-select mode while dragging a vertex and releasing the mouse button without stopping to move the mouse. Seems easier to reproduce using a trackpad.

Anyone else also facing this issue even after applying the fix?