Placed labels use most recent label group (#673)

This commit is contained in:
dranorter 2021-10-09 06:44:12 -04:00 committed by GitHub
parent 965bfc7246
commit 9116d03e76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -469,7 +469,10 @@ function addLabelOnClick() {
const name = Names.getCulture(culture); const name = Names.getCulture(culture);
const id = getNextId("label"); 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()) if (!group.size())
group = labels group = labels
.append("g") .append("g")