feat: Implement route planning feature with project selection and optimization

- Added route planning functionality to the map page, allowing users to select projects for routing.
- Implemented state management for route projects, start/end points, and search functionality.
- Integrated OpenRouteService API for route calculation and optimization.
- Enhanced UI with a route planning panel, including search and drag-and-drop reordering of projects.
- Added visual indicators for route start and end points on the map.
- Included translations for route planning features in both Polish and English.
- Created utility functions for route calculations, optimizations, and formatting of route data.
This commit is contained in:
2025-09-26 00:18:10 +02:00
parent 8a0baa02c3
commit 5aac63dfde
6 changed files with 3750 additions and 100 deletions

View File

@@ -307,7 +307,34 @@ const translations = {
viewAllProjects: "Zobacz wszystkie projekty",
zoomIn: "Przybliż",
zoomOut: "Oddal",
viewProjectDetails: "Zobacz szczegóły projektu"
viewProjectDetails: "Zobacz szczegóły projektu",
routePlanning: {
title: "Planowanie trasy",
projects: "projektów",
searchPlaceholder: "Szukaj projektów...",
noProjectsFound: "Nie znaleziono projektów pasujących do \"{{query}}\"",
searchHintText: "Spróbuj szukać po nazwie projektu lub numerze WP",
searchHint: "Przeciągnij aby zmienić kolejność",
searchHintIcons: "Ustaw początek • Ustaw koniec • Usuń",
dragToReorder: "Przeciągnij aby zmienić kolejność",
setStart: "Ustaw początek",
setEnd: "Ustaw koniec",
remove: "Usuń",
start: "START",
end: "KONIEC",
setAsStartPoint: "Ustaw jako punkt początkowy",
setAsEndPoint: "Ustaw jako punkt końcowy",
removeFromRoute: "Usuń z trasy",
calculating: "Obliczanie...",
findOptimalRoute: "Znajdź optymalną trasę",
calculateRoute: "Oblicz trasę",
routeCalculated: "Trasa obliczona",
optimized: "zoptymalizowana",
method: "Metoda",
error: "Błąd",
planRoutes: "Planuj trasy między projektami",
clickToAddProjects: "Kliknij na znaczniki projektów, aby dodać je do trasy"
}
},
// Tasks
@@ -753,7 +780,34 @@ const translations = {
viewAllProjects: "View All Projects",
zoomIn: "Zoom In",
zoomOut: "Zoom Out",
viewProjectDetails: "View Project Details"
viewProjectDetails: "View Project Details",
routePlanning: {
title: "Route Planning",
projects: "projects",
searchPlaceholder: "Search projects...",
noProjectsFound: "No projects found matching \"{{query}}\"",
searchHintText: "Try searching by project name or WP number",
searchHint: "Drag to reorder",
searchHintIcons: "Set start • Set end • Remove",
dragToReorder: "Drag to reorder",
setStart: "Set start",
setEnd: "Set end",
remove: "Remove",
start: "START",
end: "END",
setAsStartPoint: "Set as start point",
setAsEndPoint: "Set as end point",
removeFromRoute: "Remove from route",
calculating: "Calculating...",
findOptimalRoute: "Find Optimal Route",
calculateRoute: "Calculate Route",
routeCalculated: "Route Calculated",
optimized: "optimized",
method: "Method",
error: "Error",
planRoutes: "Plan routes between projects",
clickToAddProjects: "Click on project markers to add them to your route"
}
},
contracts: {