mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Stop forcing open CP tooltips.
These obscure the TGOs around them. Easy enough to mouse over, and the names aren't the important part.
This commit is contained in:
parent
3b62831401
commit
80f3857f44
@ -210,8 +210,6 @@ function recenterMap(center) {
|
|||||||
map.setView(center, 8, { animate: true, duration: 1 });
|
map.setView(center, 8, { animate: true, duration: 1 });
|
||||||
}
|
}
|
||||||
|
|
||||||
const SHOW_BASE_NAME_AT_ZOOM = 8;
|
|
||||||
|
|
||||||
class ControlPoint {
|
class ControlPoint {
|
||||||
constructor(cp) {
|
constructor(cp) {
|
||||||
this.cp = cp;
|
this.cp = cp;
|
||||||
@ -299,13 +297,10 @@ class ControlPoint {
|
|||||||
|
|
||||||
attachTooltipsAndHandlers(dragging = false) {
|
attachTooltipsAndHandlers(dragging = false) {
|
||||||
this.detachTooltipsAndHandlers();
|
this.detachTooltipsAndHandlers();
|
||||||
const zoom = map.getZoom();
|
|
||||||
const locationMarker = this.locationMarker(dragging);
|
const locationMarker = this.locationMarker(dragging);
|
||||||
const destinationMarker = this.destinationMarker();
|
const destinationMarker = this.destinationMarker();
|
||||||
locationMarker
|
locationMarker
|
||||||
.bindTooltip(`<h3 style="margin: 0;">${this.cp.name}</h3>`, {
|
.bindTooltip(`<h3 style="margin: 0;">${this.cp.name}</h3>`)
|
||||||
permanent: zoom >= SHOW_BASE_NAME_AT_ZOOM,
|
|
||||||
})
|
|
||||||
.on("click", () => {
|
.on("click", () => {
|
||||||
this.cp.showInfoDialog();
|
this.cp.showInfoDialog();
|
||||||
})
|
})
|
||||||
@ -740,5 +735,4 @@ function setTooltipZoomThreshold(layerGroup, showAt) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
setTooltipZoomThreshold(controlPointsLayer, SHOW_BASE_NAME_AT_ZOOM);
|
|
||||||
setTooltipZoomThreshold(selectedFlightPlansLayer, SHOW_WAYPOINT_INFO_AT_ZOOM);
|
setTooltipZoomThreshold(selectedFlightPlansLayer, SHOW_WAYPOINT_INFO_AT_ZOOM);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user