|
|
@@ -36,12 +36,13 @@ const Elevation = (() => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // Called by MapView when hovering a point that belongs to the current track
|
|
|
+ // Called by MapView when hovering a point that belongs to the current track.
|
|
|
+ // Cursor is on the map, so only draw the indicator — the map tooltip is
|
|
|
+ // already visible and is closer to the cursor than the chart tooltip would be.
|
|
|
function onMapHover(point) {
|
|
|
if (!bounds || !canvas) return;
|
|
|
drawIndicator(point);
|
|
|
- const x = PAD.left + (point.dist / bounds.totDist) * bounds.cw;
|
|
|
- positionTooltip(point, x, PAD.top + bounds.ch / 2);
|
|
|
+ hideTooltip();
|
|
|
}
|
|
|
|
|
|
// Called by MapView when hover leaves the current track
|
|
|
@@ -251,8 +252,10 @@ const Elevation = (() => {
|
|
|
drawIndicator(chartPt);
|
|
|
positionTooltip(chartPt, x, e.clientY - rect.top);
|
|
|
|
|
|
+ // Cursor is on the chart, so move the map marker without a Leaflet tooltip —
|
|
|
+ // the chart tooltip is already visible and is closer to the cursor.
|
|
|
if (fullPt && typeof MapView !== 'undefined') {
|
|
|
- MapView.showHoverMarker(fullPt.lat, fullPt.lon, fullPt, trackMeta);
|
|
|
+ MapView.showHoverMarker(fullPt.lat, fullPt.lon, fullPt, trackMeta, true);
|
|
|
}
|
|
|
}
|
|
|
|