blob: edff0b91af06eede231204c4f410820fadd54310 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
const print = console.log
const data = require("../data.js")
var w = 1275
var h = 2475
var m = "../map75.png"
print(`<?xml version="1.0" encoding="UTF-8"?>
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="${w}"
height="${h}"
>
<image xlink:href="${m}" x="0" y="0" width="${w}" height="${h}" image-rendering="pixelated" sodipodi:insensitive="true" />`)
for (let id in data.ROADS) {
id = id | 0
let a = (id / 100) | 0
let b = id % 100
let x = (data.TOWNS[a].layout.x + data.TOWNS[b].layout.x) >> 1
let y = (data.TOWNS[a].layout.y + data.TOWNS[b].layout.y) >> 1
let label = data.TOWNS[a].name + " / " + data.TOWNS[b].name
print(`<circle inkscape:label="${label}" cx="${x}" cy="${y}" r="12"/>`)
}
print(`</svg>`)
|