feat: start

This commit is contained in:
Azgaar 2024-09-26 02:32:09 +02:00
parent 84c326e347
commit 2efe9be3a4
5 changed files with 63 additions and 41 deletions

View file

@ -6208,7 +6208,7 @@
<input type="file" accept=".csv" id="culturesCSVToLoad" />
</div>
<!-- svg elements not required for map display -->
<!-- reusable svg elements -->
<svg id="defElements" width="0" height="0" style="position: absolute">
<defs>
<marker id="end-arrow" viewBox="0 -5 10 10" refX="6" markerWidth="7" markerHeight="7" orient="auto">
@ -6218,25 +6218,6 @@
<path d="M0,-5L10,0L0,5" fill="#555" />
</marker>
<symbol id="icon-store" viewBox="0 0 616 512">
<path
d="M602 118.6L537.1 15C531.3 5.7 521 0 510 0H106C95 0 84.7 5.7 78.9 15L14 118.6c-33.5 53.5-3.8 127.9 58.8 136.4 4.5.6 9.1.9 13.7.9 29.6 0 55.8-13 73.8-33.1 18 20.1 44.3 33.1 73.8 33.1 29.6 0 55.8-13 73.8-33.1 18 20.1 44.3 33.1 73.8 33.1 29.6 0 55.8-13 73.8-33.1 18.1 20.1 44.3 33.1 73.8 33.1 4.7 0 9.2-.3 13.7-.9 62.8-8.4 92.6-82.8 59-136.4zM529.5 288c-10 0-19.9-1.5-29.5-3.8V384H116v-99.8c-9.6 2.2-19.5 3.8-29.5 3.8-6 0-12.1-.4-18-1.2-5.6-.8-11.1-2.1-16.4-3.6V480c0 17.7 14.3 32 32 32h448c17.7 0 32-14.3 32-32V283.2c-5.4 1.6-10.8 2.9-16.4 3.6-6.1.8-12.1 1.2-18.2 1.2z"
/>
</symbol>
<symbol id="icon-anchor" viewBox="0 0 30 28">
<title>Port</title>
<path
d="M15 4c0-0.547-0.453-1-1-1s-1 0.453-1 1 0.453 1 1 1 1-0.453 1-1zM28 18.5v5.5c0 0.203-0.125 0.391-0.313 0.469-0.063 0.016-0.125 0.031-0.187 0.031-0.125 0-0.25-0.047-0.359-0.141l-1.453-1.453c-2.453 2.953-6.859 4.844-11.688 4.844s-9.234-1.891-11.688-4.844l-1.453 1.453c-0.094 0.094-0.234 0.141-0.359 0.141-0.063 0-0.125-0.016-0.187-0.031-0.187-0.078-0.313-0.266-0.313-0.469v-5.5c0-0.281 0.219-0.5 0.5-0.5h5.5c0.203 0 0.391 0.125 0.469 0.313s0.031 0.391-0.109 0.547l-1.563 1.563c1.406 1.891 4.109 3.266 7.203 3.687v-10.109h-3c-0.547 0-1-0.453-1-1v-2c0-0.547 0.453-1 1-1h3v-2.547c-1.188-0.688-2-1.969-2-3.453 0-2.203 1.797-4 4-4s4 1.797 4 4c0 1.484-0.812 2.766-2 3.453v2.547h3c0.547 0 1 0.453 1 1v2c0 0.547-0.453 1-1 1h-3v10.109c3.094-0.422 5.797-1.797 7.203-3.687l-1.563-1.563c-0.141-0.156-0.187-0.359-0.109-0.547s0.266-0.313 0.469-0.313h5.5c0.281 0 0.5 0.219 0.5 0.5z"
/>
</symbol>
<symbol id="icon-route" viewBox="0 0 512 512">
<path
d="M416 320h-96c-17.6 0-32-14.4-32-32s14.4-32 32-32h96s96-107 96-160-43-96-96-96-96 43-96 96c0 25.5 22.2 63.4 45.3 96H320c-52.9 0-96 43.1-96 96s43.1 96 96 96h96c17.6 0 32 14.4 32 32s-14.4 32-32 32H185.5c-16 24.8-33.8 47.7-47.3 64H416c52.9 0 96-43.1 96-96s-43.1-96-96-96zm0-256c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zM96 256c-53 0-96 43-96 96s96 160 96 160 96-107 96-160-43-96-96-96zm0 128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"
/>
</symbol>
<g id="defs-relief">
<symbol id="relief-mount-1" viewBox="0 0 100 100">
<path d="m3,69 16,-12 31,-32 15,20 30,24" fill="#fff" stroke="#5c5c70" stroke-width="1" />
@ -7778,6 +7759,40 @@
</symbol>
</g>
<g id="defs-icons">
<symbol id="icon-circle" viewBox="0 0 100 100" width="1em" height="1em" overflow="visible">
<circle cx="0" cy="0" r="50" />
</symbol>
<symbol id="icon-square" viewBox="0 0 100 100" width="1em" height="1em" overflow="visible">
<rect x="-50" y="-50" width="100" height="100" />
</symbol>
<symbol id="icon-triangle" viewBox="0 0 100 100" width="1em" height="1em" overflow="visible">
<polygon points="0,-50 50,50 -50,50" />
</symbol>
<symbol id="icon-star" viewBox="0 0 100 100" width="1em" height="1em" overflow="visible">
<polygon points="0,-50 15,-15 50,-15 20,15 30,50 0,30 -30,50 -20,15 -50,-15 -15,-15" />
</symbol>
<symbol id="icon-anchor" viewBox="0 0 30 28">
<path
d="M15 4c0-0.547-0.453-1-1-1s-1 0.453-1 1 0.453 1 1 1 1-0.453 1-1zM28 18.5v5.5c0 0.203-0.125 0.391-0.313 0.469-0.063 0.016-0.125 0.031-0.187 0.031-0.125 0-0.25-0.047-0.359-0.141l-1.453-1.453c-2.453 2.953-6.859 4.844-11.688 4.844s-9.234-1.891-11.688-4.844l-1.453 1.453c-0.094 0.094-0.234 0.141-0.359 0.141-0.063 0-0.125-0.016-0.187-0.031-0.187-0.078-0.313-0.266-0.313-0.469v-5.5c0-0.281 0.219-0.5 0.5-0.5h5.5c0.203 0 0.391 0.125 0.469 0.313s0.031 0.391-0.109 0.547l-1.563 1.563c1.406 1.891 4.109 3.266 7.203 3.687v-10.109h-3c-0.547 0-1-0.453-1-1v-2c0-0.547 0.453-1 1-1h3v-2.547c-1.188-0.688-2-1.969-2-3.453 0-2.203 1.797-4 4-4s4 1.797 4 4c0 1.484-0.812 2.766-2 3.453v2.547h3c0.547 0 1 0.453 1 1v2c0 0.547-0.453 1-1 1h-3v10.109c3.094-0.422 5.797-1.797 7.203-3.687l-1.563-1.563c-0.141-0.156-0.187-0.359-0.109-0.547s0.266-0.313 0.469-0.313h5.5c0.281 0 0.5 0.219 0.5 0.5z"
/>
</symbol>
<symbol id="icon-store" viewBox="0 0 616 512">
<path d="M602 118.6L537.1 15C531.3 5.7 521 0 510 0H106C95 0 84.7 5.7 78.9 15L14 118.6c-33.5 53.5-3.8 127.9 58.8 136.4 4.5.6 9.1.9 13.7.9 29.6 0 55.8-13 73.8-33.1 18 20.1 44.3 33.1 73.8 33.1 29.6 0 55.8-13 73.8-33.1 18 20.1 44.3 33.1 73.8 33.1 29.6 0 55.8-13 73.8-33.1 18.1 20.1 44.3 33.1 73.8 33.1 4.7 0 9.2-.3 13.7-.9 62.8-8.4 92.6-82.8 59-136.4zM529.5 288c-10 0-19.9-1.5-29.5-3.8V384H116v-99.8c-9.6 2.2-19.5 3.8-29.5 3.8-6 0-12.1-.4-18-1.2-5.6-.8-11.1-2.1-16.4-3.6V480c0 17.7 14.3 32 32 32h448c17.7 0 32-14.3 32-32V283.2c-5.4 1.6-10.8 2.9-16.4 3.6-6.1.8-12.1 1.2-18.2 1.2z" />
</symbol>
<symbol id="icon-route" viewBox="0 0 512 512">
<path
d="M416 320h-96c-17.6 0-32-14.4-32-32s14.4-32 32-32h96s96-107 96-160-43-96-96-96-96 43-96 96c0 25.5 22.2 63.4 45.3 96H320c-52.9 0-96 43.1-96 96s43.1 96 96 96h96c17.6 0 32 14.4 32 32s-14.4 32-32 32H185.5c-16 24.8-33.8 47.7-47.3 64H416c52.9 0 96-43.1 96-96s-43.1-96-96-96zm0-256c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zM96 256c-53 0-96 43-96 96s96 160 96 160 96-107 96-160-43-96-96-96zm0 128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"
/>
</symbol>
</g>
<g id="defs-compass-rose" stroke-width="1.1">
<g id="rose-coord-line" stroke="#3f3f3f">
<line id="sL1" x1="0" y1="-20000" x2="0" y2="20000" />

View file

@ -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();
}
}

View file

@ -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")

View file

@ -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,

View file

@ -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");
{