Bring CP markers to the front.

This commit is contained in:
Dan Albert 2021-05-15 00:21:22 -07:00
parent 8ec133830f
commit 16b52f929c

View File

@ -126,7 +126,10 @@ function drawControlPoints() {
controlPointsLayer.clearLayers();
const zoom = map.getZoom();
game.controlPoints.forEach((cp) => {
L.marker(cp.position, { icon: iconFor(cp.blue) })
// We might draw other markers on top of the CP. The tooltips from the other
// markers are helpful so we want to keep them, but make sure the CP is always
// the clickable thing.
L.marker(cp.position, { icon: iconFor(cp.blue), zIndexOffset: 1000 })
.bindTooltip(`<h3 style="margin: 0;">${cp.name}</h3>`, {
permanent: zoom >= SHOW_BASE_NAME_AT_ZOOM,
})