From 2efe9be3a448c8da216ec9b24d2e6f7ebc9aeb0e Mon Sep 17 00:00:00 2001 From: Azgaar Date: Thu, 26 Sep 2024 02:32:09 +0200 Subject: [PATCH] feat: start --- index.html | 55 ++++++++++++++++++---------- modules/dynamic/auto-update.js | 3 ++ modules/renderers/draw-burg-icons.js | 24 ++++++------ styles/default.json | 20 ++++++---- versioning.js | 2 +- 5 files changed, 63 insertions(+), 41 deletions(-) diff --git a/index.html b/index.html index df07d894..f8c60e08 100644 --- a/index.html +++ b/index.html @@ -6208,7 +6208,7 @@ - + @@ -6218,25 +6218,6 @@ - - - - - - Port - - - - - - - @@ -7778,6 +7759,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/dynamic/auto-update.js b/modules/dynamic/auto-update.js index e14e594f..2986000d 100644 --- a/modules/dynamic/auto-update.js +++ b/modules/dynamic/auto-update.js @@ -964,5 +964,8 @@ export function resolveVersionConflicts(mapVersion) { defs.select("#water").selectAll("path, use").remove(); viewbox.select("#coastline").selectAll("path, use").remove(); drawFeatures(); + + // v1.106.0 change burg groups and added customizable icons + icons.selectAll("circle, use").remove(); } } diff --git a/modules/renderers/draw-burg-icons.js b/modules/renderers/draw-burg-icons.js index 8e11bf3b..54f72e34 100644 --- a/modules/renderers/draw-burg-icons.js +++ b/modules/renderers/draw-burg-icons.js @@ -8,20 +8,20 @@ function drawBurgIcons() { // capitals const capitals = pack.burgs.filter(b => b.capital && !b.removed); const capitalIcons = burgIcons.select("#cities"); - const capitalSize = capitalIcons.attr("size") || 1; + const capitalIcon = capitalIcons.attr("data-icon") || "#icon-circle"; const capitalAnchors = anchors.selectAll("#cities"); const capitalAnchorsSize = capitalAnchors.attr("size") || 2; capitalIcons - .selectAll("circle") + .selectAll("use") .data(capitals) .enter() - .append("circle") + .append("use") .attr("id", d => "burg" + d.i) + .attr("href", capitalIcon) .attr("data-id", d => d.i) - .attr("cx", d => d.x) - .attr("cy", d => d.y) - .attr("r", capitalSize); + .attr("x", d => d.x) + .attr("y", d => d.y); capitalAnchors .selectAll("use") @@ -38,20 +38,20 @@ function drawBurgIcons() { // towns const towns = pack.burgs.filter(b => b.i && !b.capital && !b.removed); const townIcons = burgIcons.select("#towns"); - const townSize = townIcons.attr("size") || 0.5; + const townIcon = townIcons.attr("data-icon") || "#icon-circle"; const townsAnchors = anchors.selectAll("#towns"); const townsAnchorsSize = townsAnchors.attr("size") || 1; townIcons - .selectAll("circle") + .selectAll("use") .data(towns) .enter() - .append("circle") + .append("use") .attr("id", d => "burg" + d.i) + .attr("href", townIcon) .attr("data-id", d => d.i) - .attr("cx", d => d.x) - .attr("cy", d => d.y) - .attr("r", townSize); + .attr("x", d => d.x) + .attr("y", d => d.y); townsAnchors .selectAll("use") diff --git a/styles/default.json b/styles/default.json index 9168debc..f67ffe57 100644 --- a/styles/default.json +++ b/styles/default.json @@ -338,14 +338,16 @@ "font-family": "Almendra SC" }, "#burgIcons > #cities": { + "data-icon": "#icon-star", "opacity": 1, "fill": "#ffffff", "fill-opacity": 0.7, - "size": 1, + "font-size": 2, "stroke": "#3e3e4b", - "stroke-width": 0.24, - "stroke-dasharray": "", - "stroke-linecap": "butt" + "stroke-width": 10, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" }, "#anchors > #cities": { "opacity": 1, @@ -364,14 +366,16 @@ "font-family": "Almendra SC" }, "#burgIcons > #towns": { + "data-icon": "#icon-circle", "opacity": 1, "fill": "#ffffff", "fill-opacity": 0.7, - "size": 0.5, + "font-size": 1, "stroke": "#3e3e4b", - "stroke-width": 0.12, - "stroke-dasharray": "", - "stroke-linecap": "butt" + "stroke-width": 10, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" }, "#anchors > #towns": { "opacity": 1, diff --git a/versioning.js b/versioning.js index 0afaecdd..139d7f0e 100644 --- a/versioning.js +++ b/versioning.js @@ -12,7 +12,7 @@ * * Example: 1.102.2 -> Major version 1, Minor version 102, Patch version 2 */ -const VERSION = "1.105.6"; +const VERSION = "1.106.0"; if (parseMapVersion(VERSION) !== VERSION) alert("versioning.js: Invalid format or parsing function"); {