From 6eeaf9407606bc06e87af735228d1a102a9ce254 Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Wed, 24 Apr 2019 17:28:56 -0700 Subject: [PATCH] Show members of selected relations even when their feature layer is otherwise hidden (close #6220) --- modules/modes/select.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/modes/select.js b/modules/modes/select.js index 5af485984..0f614477f 100644 --- a/modules/modes/select.js +++ b/modules/modes/select.js @@ -233,7 +233,18 @@ export function modeSelect(context, selectedIDs) { mode.enter = function() { if (!checkSelectedIDs()) return; - context.features().forceVisible(selectedIDs); + var forceVisibleIDs = selectedIDs.slice(); + + selectedIDs.forEach(function(id) { + var entity = context.entity(id); + if (entity.type === 'relation') { + forceVisibleIDs = forceVisibleIDs.concat(entity.members.map(function(member) { + return member.id; + })); + } + }); + + context.features().forceVisible(forceVisibleIDs); var operations = Object.values(Operations) .map(function(o) { return o(selectedIDs, context); })