feat: burg groups - image icons

This commit is contained in:
Azgaar 2025-01-02 14:14:00 +01:00
parent c29f3b73e8
commit 2f53a635c8
27 changed files with 225 additions and 211 deletions

View file

@ -36,7 +36,7 @@ function drawBurgIcons() {
// capitalAnchors
// .selectAll("use")
// .data(capitals.filter(c => c.port))
// .data(capital.filter(c => c.port))
// .enter()
// .append("use")
// .attr("xlink:href", "#icon-anchor")
@ -62,7 +62,7 @@ function drawBurgIcon(burg) {
}
function createIconGroups() {
const defaultStyle = style.burgIcons.towns || Object.values(style.burgIcons)[0];
const defaultStyle = style.burgIcons.town || Object.values(style.burgIcons)[0];
// save existing styles and remove all groups
document.querySelectorAll("g#burgIcons > g").forEach(group => {

View file

@ -11,8 +11,8 @@ function drawBurgLabels() {
const labelGroup = burgLabels.select("#" + name);
if (labelGroup.empty()) continue;
const dx = labelGroup.attr("data-dx");
const dy = labelGroup.attr("data-dy");
const dx = labelGroup.attr("data-dx") || 0;
const dy = labelGroup.attr("data-dy") || 0;
labelGroup
.selectAll("text")
@ -33,8 +33,8 @@ function drawBurgLabels() {
function drawBurgLabel(burg) {
const group = burgLabels.select("#" + burg.group);
const dx = labelGroup.attr("data-dx");
const dy = labelGroup.attr("data-dy");
const dx = labelGroup.attr("data-dx") || 0;
const dy = labelGroup.attr("data-dy") || 0;
group
.append("text")
@ -48,7 +48,7 @@ function drawBurgLabel(burg) {
}
function createLabelGroups() {
const defaultStyle = style.burgLabels.towns || Object.values(style.burgLabels)[0];
const defaultStyle = style.burgLabels.town || Object.values(style.burgLabels)[0];
// save existing styles and remove all groups
document.querySelectorAll("g#burgLabels > g").forEach(group => {