From 74f473f5a585f80860adc0ed198ebbef9f35e715 Mon Sep 17 00:00:00 2001 From: Quincy Morgan <2046746+quincylvania@users.noreply.github.com> Date: Fri, 25 Sep 2020 15:19:18 -0400 Subject: [PATCH] Fix issue where currently drawn feature could be discarded when switching the background while navigating the map (close #7999) --- modules/behavior/hash.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/behavior/hash.js b/modules/behavior/hash.js index e81ea9354..ce039c28b 100644 --- a/modules/behavior/hash.js +++ b/modules/behavior/hash.js @@ -140,12 +140,12 @@ export function behaviorHash(context) { context.map().centerZoom([mapArgs[2], Math.min(_latitudeLimit, Math.max(-_latitudeLimit, mapArgs[1]))], mapArgs[0]); - if (q.id) { + if (q.id && mode) { var ids = q.id.split(',').filter(function(id) { return context.hasEntity(id); }); - var skip = mode && mode.id === 'select' && utilArrayIdentical(mode.selectedIDs(), ids); - if (ids.length && !skip) { + if (ids.length && + (mode.id === 'browse' || (mode.id === 'select' && !utilArrayIdentical(mode.selectedIDs(), ids)))) { context.enter(modeSelect(context, ids)); return; }