From 5860814d4697a862bfd108c1a202d0a1065cc1e4 Mon Sep 17 00:00:00 2001 From: Dranorter Date: Mon, 4 Oct 2021 14:50:23 -0400 Subject: [PATCH] Placed labels use most recent label group --- modules/ui/tools.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/ui/tools.js b/modules/ui/tools.js index 3880f2bb..d543de90 100644 --- a/modules/ui/tools.js +++ b/modules/ui/tools.js @@ -474,7 +474,10 @@ function addLabelOnClick() { const name = Names.getCulture(culture); const id = getNextId("label"); - let group = labels.select("#addedLabels"); + // use most recently selected label group + let selected = labelGroupSelect.value; + const symbol = selected ? "#" + selected : "#addedLabels"; + let group = labels.select(symbol); if (!group.size()) group = labels.append("g").attr("id", "addedLabels").attr("fill", "#3e3e4b").attr("opacity", 1).attr("stroke", "#3a3a3a").attr("stroke-width", 0).attr("font-family", "Almendra SC").attr("font-size", 18).attr("data-size", 18).attr("filter", null); const example = group.append("text").attr("x", 0).attr("x", 0).text(name);