Use FastAPI interface for the front lines.

Can't submit yet because there's no way to uniquely identify front-
lines, so no way to update these as they change.
This commit is contained in:
Dan Albert
2022-03-03 00:11:40 -08:00
parent e5f4974e9a
commit 8d806def5b
2 changed files with 8 additions and 20 deletions

View File

@@ -255,7 +255,6 @@ new QWebChannel(qt.webChannelTransport, function (channel) {
game.controlPointsChanged.connect(drawControlPoints);
game.groundObjectsChanged.connect(drawGroundObjects);
game.supplyRoutesChanged.connect(drawSupplyRoutes);
game.frontLinesChanged.connect(drawFrontLines);
game.mapReset.connect(drawAircraft);
});
@@ -625,12 +624,14 @@ function drawSupplyRoutes() {
function drawFrontLines() {
frontLinesLayer.clearLayers();
game.frontLines.forEach((front) => {
L.polyline(front.extents, { weight: 8, color: "#fe7d0a" })
.on("contextmenu", function () {
front.showPackageDialog();
})
.addTo(frontLinesLayer);
getJson("/front-lines").then((frontLines) => {
for (const front of frontLines) {
L.polyline(front.extents, { weight: 8, color: "#fe7d0a" })
.on("contextmenu", function () {
front.showPackageDialog();
})
.addTo(frontLinesLayer);
}
});
}