Preview a search result or route point on hover / press-and-hold, back on leave, committed on click
This commit is contained in:
1 parent
abde7fe5f9
commit
b80575828a
5 files changed
+123
No files matched your search
@@ -2,6 +2,7 @@ import { Marker } from "/vendor/maplibre-gl/maplibre-gl.mjs";
|
||||
import { ROUTE_ICON } from "/js/icons.js";
|
||||
import { notifySidePanelOpen, onlyOneSidePanelOpen, notifyGpxStoreChanged, onRoutePoint, onRouteEdit } from "/js/panels.js";
|
||||
import { isLoggedIn } from "/js/auth.js";
|
||||
import { wirePreview } from "/js/preview.js";
|
||||
|
||||
const ROUTE_URL = "/api/route";
|
||||
const VEHICLE_URL = "/api/vehicle";
|
||||
@@ -156,6 +157,9 @@ export class RoutePanelControl {
|
||||
this._pointButton("↓", "Move down", index < this._points.length - 1, () => this._move(point, 1)),
|
||||
this._pointButton("×", "Remove", true, () => this._removePoint(point)),
|
||||
);
|
||||
// Hover/hold previews the point; a click on its name commits.
|
||||
wirePreview(this._map, text, () => ({ lngLat: point.lngLat }));
|
||||
text.addEventListener("click", () => this._map.easeTo({ center: point.lngLat, zoom: Math.max(this._map.getZoom(), 14) }));
|
||||
this._list.appendChild(li);
|
||||
});
|
||||
this._editingNote.hidden = !this._editing;
|
||||
|
||||
Reference in new issue
Block a user