小 (typo) |
(画了一部分,问号太多的线路xl自己来) |
||
| 第4行: | 第4行: | ||
<head> | <head> | ||
<style type=""> | |||
canvas{ | |||
width: 100% | width: 100% | ||
} | } | ||
</style> | </style> | ||
<meta charset="utf-8"> | |||
<title>Metro Map!</title> | |||
</head> | </head> | ||
<body> | <body> | ||
<canvas id="MainMap" width="0" height="0">Oops!</canvas> | |||
<script> | |||
window.dataset = { | |||
"lines": { | "lines": { | ||
"1": { | "1": { | ||
| 第39行: | 第39行: | ||
{ "PGNUN": "" } | { "PGNUN": "" } | ||
] | ] | ||
}, | |||
"2支线": { | |||
"color": "#3C44AA", | |||
"route": [ | |||
{ "WUMIN": "" }, | |||
{ "STRHD": "" }, | |||
{ "BREAD": "" } | |||
] | |||
}, | |||
"3": { | |||
"color": "#FED83D", | |||
"route": [ | |||
{ "SPAWN": "" }, | |||
{ "NNCNL": "" }, | |||
{ "pos": [0, 4], "stat": "planned" }, | |||
{ "INITS": "" }, | |||
{ "KEMOW": "" }, | |||
{ "pos": [8, 6], "stat": "planned" }, | |||
{ "YXLAN": "" } | |||
], | |||
"stat": "planned" | |||
}, | |||
"4": { | |||
"color": "#169C9C", | |||
"route": [] | |||
}, | }, | ||
"5": { | "5": { | ||
| 第74行: | 第99行: | ||
{ "ICERF": "" } | { "ICERF": "" } | ||
] | ] | ||
}, | |||
"8": { | |||
"color": "#5E7C16", | |||
"route": [] | |||
} | } | ||
}, | }, | ||
| 第115行: | 第144行: | ||
"label": "冰道", | "label": "冰道", | ||
"pos": [10, -8], | "pos": [10, -8], | ||
"stat": "planned" | |||
}, | |||
"INITS": { | |||
"label": "元始", | |||
"pos": [4, 4], | |||
"stat": "planned" | "stat": "planned" | ||
}, | }, | ||
| 第154行: | 第188行: | ||
"PGNUN": { | "PGNUN": { | ||
"label": "鸽联", | "label": "鸽联", | ||
"pos": [ | "pos": [4, -10], | ||
"stat": "planned" | "stat": "planned" | ||
}, | }, | ||
| 第171行: | 第205行: | ||
"pos": [0, 0], | "pos": [0, 0], | ||
"stat": "finished" | "stat": "finished" | ||
}, | |||
"STRHD": { | |||
"label": "要塞", | |||
"pos": [6, -6], | |||
"stat": "planned" | |||
}, | }, | ||
"SZHCT": { | "SZHCT": { | ||
| 第189行: | 第228行: | ||
"XJIAN": { | "XJIAN": { | ||
"label": "薪涧", | "label": "薪涧", | ||
"pos": [ | "pos": [4, -8], | ||
"stat": "planned" | "stat": "planned" | ||
}, | }, | ||
| 第206行: | 第245行: | ||
"pos": [-12, 6], | "pos": [-12, 6], | ||
"stat": "finished" | "stat": "finished" | ||
}, | |||
"YXLAN": { | |||
"label": "垭西兰", | |||
"pos": [8, 8], | |||
"stat": "planned" | |||
} | } | ||
} | } | ||
} | } | ||
</script> | |||
<script> | |||
const tilelen = 120 | |||
const BLACK = "#000000" | const BLACK = "#000000" | ||
const LIGHTGRAY = "#AAAAAA" | const LIGHTGRAY = "#AAAAAA" | ||
| 第239行: | 第283行: | ||
let stat = "finished" | let stat = "finished" | ||
if (waypoint.stat == "planned" || lastpoint.stat == "planned") stat = "planned" | if (waypoint.stat == "planned" || lastpoint.stat == "planned") stat = "planned" | ||
if (mapData.lines[line].stat == "planned") stat = "planned" | |||
if (links[[lastpoint.pos, waypoint.pos]] != undefined) { | if (links[[lastpoint.pos, waypoint.pos]] != undefined) { | ||
links[[lastpoint.pos, waypoint.pos]].push([line, color[stat]]) | links[[lastpoint.pos, waypoint.pos]].push([line, color[stat]]) | ||
} | } | ||
else { | else { | ||
links[[lastpoint.pos, waypoint.pos]] = [[line, color[stat]]] | if (links[[waypoint.pos, lastpoint.pos]] != undefined) { | ||
links[[waypoint.pos, lastpoint.pos]].push([line, color[stat]]) | |||
} | |||
else links[[lastpoint.pos, waypoint.pos]] = [[line, color[stat]]] | |||
} | } | ||
} | } | ||
| 第318行: | 第366行: | ||
mainMap.drawMap = drawMap | mainMap.drawMap = drawMap | ||
mainMap.drawMap(dataset) | mainMap.drawMap(dataset) | ||
</script> | |||
</body> | </body> | ||
</html> | </html> | ||