From 881f979d463966aec5e623404c8da1502e5fcbc7 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Tue, 8 Aug 2017 18:14:23 -0400 Subject: [PATCH] Return to browse mode when zooming out beyond edit limit (closes #4184) --- modules/renderer/map.js | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/modules/renderer/map.js b/modules/renderer/map.js index d94a8dbc6f..faadea1192 100644 --- a/modules/renderer/map.js +++ b/modules/renderer/map.js @@ -1,10 +1,12 @@ import * as d3 from 'd3'; import _ from 'lodash'; import { t } from '../util/locale'; +import { geoExtent } from '../geo'; -import { utilRebind } from '../util/rebind'; -import { utilBindOnce } from '../util/bind_once'; -import { utilGetDimensions } from '../util/dimensions'; +import { + modeBrowse, + modeSelect +} from '../modes'; import { svgAreas, @@ -14,18 +16,20 @@ import { svgMidpoints, svgPoints, svgVertices -} from '../svg/index'; +} from '../svg'; -import { geoExtent } from '../geo/index'; -import { modeSelect } from '../modes/select'; +import { uiFlash } from '../ui'; import { utilFastMouse, - utilSetTransform, - utilFunctor -} from '../util/index'; + utilFunctor, + utilRebind, + utilSetTransform +} from '../util'; + +import { utilBindOnce } from '../util/bind_once'; +import { utilGetDimensions } from '../util/dimensions'; -import { uiFlash } from '../ui/index'; export function rendererMap(context) { @@ -267,6 +271,7 @@ export function rendererMap(context) { function editOff() { context.features().resetStats(); surface.selectAll('.layer-osm *').remove(); + context.enter(modeBrowse(context)); dispatch.call('drawn', this, {full: true}); }