wip waypoints
This commit is contained in:
parent
84b6645cd9
commit
b0874115ab
@ -53,32 +53,45 @@ fetch('/map-data/minecraft/mc-sdf-org/markers.json')
|
|||||||
marker.bindPopup(waypoint.name);
|
marker.bindPopup(waypoint.name);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Subway Lines
|
|
||||||
markers.lines.subway_lines.forEach(line => {
|
|
||||||
// Iterate over each point pair
|
|
||||||
line.point_pairs.forEach(pair => {
|
|
||||||
var map_line_obj = L.polyline([
|
|
||||||
[pair.from.z * -1, pair.from.x],
|
|
||||||
[pair.to.z * -1, pair.to.x],
|
|
||||||
], {
|
|
||||||
color: line.color,
|
|
||||||
opacity: 0.5,
|
|
||||||
|
|
||||||
}).addTo(overlayLayers["Subway Lines"]);
|
|
||||||
map_line_obj.bindPopup(line.name);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// Areas
|
// Areas
|
||||||
markers.areas.forEach(area => {
|
markers.areas.forEach(area => {
|
||||||
var bounds = [
|
var bounds = [
|
||||||
[area.top_left.z * -1, area.top_left.x],
|
[area.top_left.z * -1, area.top_left.x],
|
||||||
[area.bottom_right.z * -1, area.bottom_right.x],
|
[area.bottom_right.z * -1, area.bottom_right.x],
|
||||||
];
|
];
|
||||||
var area_obj = L.rectangle(bounds, {color:"#00000000", fillOpacity: 0.2 }).addTo(clickable_areas);
|
var area_obj = L.rectangle(bounds, { color: "#00000000", fillOpacity: 0.2 }).addTo(clickable_areas);
|
||||||
area_obj.bindPopup(area.name);
|
area_obj.bindPopup(area.name);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
fetch('/map-data/minecraft/mc-sdf-org/subway_lines.json')
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(lines => {
|
||||||
|
lines.forEach(line => {
|
||||||
|
// // Iterate over each point pair
|
||||||
|
// line.point_pairs.forEach(pair => {
|
||||||
|
// var map_line_obj = L.polyline([
|
||||||
|
// [pair.from.z * -1, pair.from.x],
|
||||||
|
// [pair.to.z * -1, pair.to.x],
|
||||||
|
// ], {
|
||||||
|
// color: line.color,
|
||||||
|
// opacity: 0.5,
|
||||||
|
|
||||||
|
// }).addTo(overlayLayers["Subway Lines"]);
|
||||||
|
// map_line_obj.bindPopup(line.name);
|
||||||
|
// });
|
||||||
|
|
||||||
|
// Each line has a list of line segments
|
||||||
|
line.line_segments.forEach(segment => {
|
||||||
|
// Each line segment is a list of coordinates
|
||||||
|
var coords = segment.map(coord => [coord.z * -1, coord.x]);
|
||||||
|
var map_line_obj = L.polyline(coords, {
|
||||||
|
color: line.color,
|
||||||
|
opacity: 0.75,
|
||||||
|
}).addTo(overlayLayers["Subway Lines"]);
|
||||||
|
map_line_obj.bindPopup(line.name);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// Add the layers to the map
|
// Add the layers to the map
|
||||||
L.control.layers(layers, overlayLayers).addTo(map);
|
L.control.layers(layers, overlayLayers).addTo(map);
|
||||||
|
@ -518,9 +518,30 @@
|
|||||||
"x": -1033,
|
"x": -1033,
|
||||||
"z": 1087
|
"z": 1087
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": {
|
||||||
|
"x": -220,
|
||||||
|
"z": -186
|
||||||
|
},
|
||||||
|
"to": {
|
||||||
|
"x": -220,
|
||||||
|
"z": 1175
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": {
|
||||||
|
"x": -220,
|
||||||
|
"z": -186
|
||||||
|
},
|
||||||
|
"to": {
|
||||||
|
"x": -220,
|
||||||
|
"z": -1797
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"areas": [
|
"areas": [
|
||||||
|
124
static/map-data/minecraft/mc-sdf-org/subway_lines.json
Normal file
124
static/map-data/minecraft/mc-sdf-org/subway_lines.json
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "Sky Train",
|
||||||
|
"color": "red",
|
||||||
|
"line_segments": [
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"x": 0,
|
||||||
|
"z": 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Xnor50 Line",
|
||||||
|
"color": "grey",
|
||||||
|
"line_segments": [
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"x": -137,
|
||||||
|
"z": -119
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"x": -137,
|
||||||
|
"z": -100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"x": -207,
|
||||||
|
"z": -100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"x": -206,
|
||||||
|
"z": -303
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"x": -206,
|
||||||
|
"z": -433
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"x": -249,
|
||||||
|
"z": -433
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Yellow Line",
|
||||||
|
"color": "yellow",
|
||||||
|
"line_segments": [
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"x": 0,
|
||||||
|
"z": 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Green Line",
|
||||||
|
"color": "green",
|
||||||
|
"line_segments": [
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"x": -97,
|
||||||
|
"z": -467
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"x": -136,
|
||||||
|
"z": -467
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"x": -136,
|
||||||
|
"z": -463
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"x": -149,
|
||||||
|
"z": -463
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"x": -97,
|
||||||
|
"z": -478
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"x": -149,
|
||||||
|
"z": -478
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"x": -149,
|
||||||
|
"z": -394
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"x": -146,
|
||||||
|
"z": -394
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"x": -146,
|
||||||
|
"z": -282
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"x": -190,
|
||||||
|
"z": -282
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"x": -97,
|
||||||
|
"z": -482
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"x": -97,
|
||||||
|
"z": -493
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Blue Line",
|
||||||
|
"color": "blue"
|
||||||
|
}
|
||||||
|
]
|
Loading…
x
Reference in New Issue
Block a user