feat(map): Color-coded route lines, enhanced waypoint markers and live map multi-route rendering#222
Open
feat(map): Color-coded route lines, enhanced waypoint markers and live map multi-route rendering#222
Conversation
added 2 commits
April 7, 2026 23:06
- Add addon/utils/route-colors.js with color palette, colorForId(), darkenColor(), routeStyleForStatus(), and waypointIconHtml() utilities - Update leaflet-map-manager.js: addRoutingControl now accepts color, orderId, status, and places options; uses lineOptions.styles for status-based cased polylines and createMarker for divIcon waypoints (green P pickup, red D dropoff, numbered route-colored stops) - Update leaflet-live-map.js: render color-coded polylines for all active routes after load via new renderLiveRoutes private method; handles OSRM and GeoJSON geometry formats; sticky tooltips with order/driver/status - Update order details controller: pass routingOptions (color, status, places) to addRoutingControl and replaceRoutingControl - Update order form route component: pass color, status, places to replaceRoutingControl in previewRoute - Append route visualization CSS to fleetops-engine.css: waypoint marker reset, tooltip, popup, live-map route tooltip, and pulse animation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements a comprehensive UI/UX improvement for order route visualization across the FleetOps map, covering both the order detail view and the live dispatcher map.
Changes
New:
addon/utils/route-colors.jsA self-contained utility module that centralizes all route color and styling logic:
ROUTE_COLOR_PALETTEcolorForId(id)order.public_id) via djb2 hash — same order always renders in the same colordarkenColor(hex, amount)routeStyleForStatus(status, color)stylesarray for status-based line renderingwaypointIconHtml(label, bgColor)L.divIconcircular waypoint markersStatus → Line style mapping:
pending→ single dashed gray linecanceled→ dashed red, low opacitycompleted→ solid teal, reduced opacitydispatched/in_progress→ two-layer cased polyline (dark outline + bright fill)Updated:
addon/services/leaflet-map-manager.jsaddRoutingControl()now accepts extended options:lineOptions.stylesis now populated fromrouteStyleForStatus()instead of LRM defaults (which produced an undifferentiated red line for every order)createMarker()callback replaces the hardcoded blue pin with:Updated:
addon/components/map/leaflet-live-map.jsload()task completes,#renderLiveRoutes(routes)draws color-coded polylines for all active orders on the live dispatcher mapdetails.coordinates)details.geometry.coordinates)details.routes[0].geometry.coordinates)_liveRouteLayerGroupsand cleaned up on component destroyUpdated:
addon/controllers/operations/orders/index/details.jsroutingOptionsgetter builds{ orderId, status, places, color }from the current order modelsetup()and the socket event handler passroutingOptionstoaddRoutingControl()andreplaceRoutingControl()Updated:
addon/components/order/form/route.jspreviewRoute()now extractsorderId,status, andplacesfrom the order being created/edited and passes them toreplaceRoutingControl()placesgetter (pickup + waypoints + dropoff) is reused as the place data source for waypoint popup contentUpdated:
addon/styles/fleetops-engine.cssNew CSS classes appended:
.fleetops-waypoint-markerdivIconbackground/border defaults.fleetops-waypoint-tooltip.fleetops-waypoint-popup-wrapper.fleetops-waypoint-popup.fleetops-route-tooltip-wrapper.fleetops-route-tooltip@keyframes fleetops-route-pulsein_progressroutesVisual Before / After
Testing Notes
public_idand the waypoint markers should be the new circular divIconspending,in_progress,completed, andcanceledorders to verify status-based line styling