Add tooltips for TGOs.

This commit is contained in:
Dan Albert
2021-05-13 00:44:47 -07:00
parent eb26d54ac1
commit 1ab205cb46
3 changed files with 58 additions and 6 deletions

View File

@@ -166,9 +166,9 @@ function drawGroundObjects() {
blueSamThreatLayer.clearLayers();
redSamThreatLayer.clearLayers();
game.groundObjects.forEach((tgo) => {
L.marker(tgo.position, { icon: iconFor(tgo.blue) }).addTo(
groundObjectsLayer
);
L.marker(tgo.position, { icon: iconFor(tgo.blue) })
.bindTooltip(`${tgo.name}<br />${tgo.units.join("<br />")}`)
.addTo(groundObjectsLayer);
drawSamThreatsAt(tgo);
});
}