From 34ce03cd19d5758fd15716a357219653934a1c20 Mon Sep 17 00:00:00 2001 From: Nigel Sim Date: Mon, 5 Mar 2018 09:53:40 +1000 Subject: [PATCH 1/2] 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 --- src/render.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/render.js b/src/render.js index a4ff50a92..c0acc9701 100644 --- a/src/render.js +++ b/src/render.js @@ -79,8 +79,8 @@ module.exports = function render() { }); } - store.ctx.map.fire(Constants.events.RENDER, {}); cleanup(); + store.ctx.map.fire(Constants.events.RENDER, {}); function cleanup() { store.isDirty = false; From 033406ab4058ee3e7989b20ae7b1603af5d3e61c Mon Sep 17 00:00:00 2001 From: Nigel Sim Date: Mon, 5 Mar 2018 10:05:21 +1000 Subject: [PATCH 2/2] mark the store as dirty to properly render the first time. --- src/setup.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/setup.js b/src/setup.js index 9098ad67c..d07936d2b 100644 --- a/src/setup.js +++ b/src/setup.js @@ -83,6 +83,7 @@ module.exports = function(ctx) { ctx.map.addLayer(style); }); + ctx.store.setDirty(true); ctx.store.render(); }, removeLayers: function() {