adds tooltips for elevation profile wps

This commit is contained in:
Christian Beutel
2024-12-02 01:30:46 +01:00
parent 5bd8c7b610
commit 410039d42e
3 changed files with 7 additions and 2 deletions

View File

@@ -615,4 +615,8 @@
width: 100%;
height: 100%;
}
:global(.maplibregl-popup-content) {
@apply bg-background rounded-md;
}
</style>

View File

@@ -696,7 +696,7 @@ export class ElevationProfile {
wpDiv.style.top = `8px`; // Position horizontally
// Add custom HTML content (e.g., icon + label)
wpDiv.innerHTML = `<i class="fa fa-${this.waypoints.at(index)?.icon ?? 'circle'}"></i>`;
wpDiv.innerHTML = `<div class="tooltip" data-title="${this.waypoints[index].name ?? "?"}"><i class="fa fa-${this.waypoints.at(index)?.icon ?? 'circle'}"></i></div>`;
waypointContainer.appendChild(wpDiv); // Add to container
});