Skip to content

Commit

Permalink
re-enable boxZoom upon removing control (mapbox#571)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewharvey committed Jan 19, 2017
1 parent edb8be2 commit 1d72e54
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module.exports = function(ctx) {
setup.removeLayers();
ctx.ui.removeButtons();
ctx.events.removeEventListeners();
if (ctx.mapBoxZoomOriginalState) ctx.map.boxZoom.enable();
ctx.map = null;
ctx.container = null;
ctx.store = null;
Expand All @@ -36,6 +37,7 @@ module.exports = function(ctx) {
controlContainer = ctx.ui.addButtons();

if (ctx.options.boxSelect) {
ctx.mapBoxZoomOriginalState = map.boxZoom._enabled;
map.boxZoom.disable();
// Need to toggle dragPan on and off or else first
// dragPan disable attempt in simple_select doesn't work
Expand Down

0 comments on commit 1d72e54

Please sign in to comment.