Closed jaybo closed 4 years ago
I'm guessing this is related to: https://github.com/mapbox/mapbox-gl-draw/pull/901
Interesting, can you post a runnable example so that I can replicate it?
I've discovered a hack around the issue. In Quasar, in the "draw.selectionchanged" callback I've added:
Vue.nextTick(() => {
this.draw.add(features[0]); // total hack to force draw to change line selection state
this.setActiveRoute(features[0]); // change the line color
});
Since I'm pretty certain the underlying problem is https://github.com/mapbox/mapbox-gl-draw/pull/901, I don't think this is really your issue, and since I have a workaround, you're welcome to close this.
All right, closing for now. I'll take a look at the original issue if there is time. Why it wasn't merged yet? If you have any other information, let me know!
I have no inside knowledge, but it looks like draw has been largely dormant for the past year or so. Minor updates, but nothing of consequence, which is partly why I'm delighted your two projects have solved two of the major issues I've had.
I don't know why 901 wasn't merged (and now no longer passes integration testing). I've been on the verge of giving up on Mapbox multiple times just because of the lack of progress in the draw control.
I'm drawing a polyline with a style which contains a user property to control the color, as in:
Similar styles exist for the vertices and midpoints. I change the value of the "color" property on a "draw.selectionchange" message.
As I click between polylines, the vertices change color on the first mouse click, but the associated line requires two mouse clicks to change color. So I'm guessing there's some missing logic which should be changing the line selected state along with it's vertices after only a single click.
This problem exists whether I click on the line itself, or on the vertices individually.