mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 03:51:23 +01:00
feat: routes - change data format, fix issues
This commit is contained in:
parent
077248e4d9
commit
19723bd513
8 changed files with 260 additions and 243 deletions
|
|
@ -1643,13 +1643,11 @@ function drawRoutes() {
|
|||
const routePaths = {};
|
||||
const lineGen = d3.line();
|
||||
|
||||
let points = Routes.preparePointsArray();
|
||||
|
||||
for (const route of pack.routes) {
|
||||
const {i, group} = route;
|
||||
lineGen.curve(ROUTE_CURVES[group] || ROUTE_CURVES.default);
|
||||
const routePoints = Routes.getPoints(route, points);
|
||||
const path = round(lineGen(routePoints), 1);
|
||||
const points = route.points.map(p => [p[0], p[1]]);
|
||||
const path = round(lineGen(points), 1);
|
||||
|
||||
if (!routePaths[group]) routePaths[group] = [];
|
||||
routePaths[group].push(`<path id="route${i}" d="${path}"/>`);
|
||||
|
|
@ -1663,11 +1661,6 @@ function drawRoutes() {
|
|||
TIME && console.timeEnd("drawRoutes");
|
||||
}
|
||||
|
||||
const ROUTES_SHARP_ANGLE = 135;
|
||||
const ROUTES_VERY_SHARP_ANGLE = 115;
|
||||
|
||||
function drawRoute() {}
|
||||
|
||||
function toggleMilitary() {
|
||||
if (!layerIsOn("toggleMilitary")) {
|
||||
turnButtonOn("toggleMilitary");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue