Skip to content

Commit 1cef23c

Browse files
nigelsimmcwhittemore
authored andcommitted
Race condition loading shapes (#749)
* Make the draw.render event fire after cleanup This means that the draw control is in its final state when the event is fired so that it is safe for anything responding to the event to make changes to the draw instance * mark the store as dirty to properly render the first time.
1 parent 3ce702d commit 1cef23c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/render.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ module.exports = function render() {
7979
});
8080
}
8181

82-
store.ctx.map.fire(Constants.events.RENDER, {});
8382
cleanup();
83+
store.ctx.map.fire(Constants.events.RENDER, {});
8484

8585
function cleanup() {
8686
store.isDirty = false;

src/setup.js

+1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ module.exports = function(ctx) {
8585
ctx.map.addLayer(style);
8686
});
8787

88+
ctx.store.setDirty(true);
8889
ctx.store.render();
8990
},
9091
// Check for layers and sources before attempting to remove

0 commit comments

Comments
 (0)