Description
On the results page, the route stop markers on the Google Map do not stay pinned to their
geographic location when the map zoom level changes. The marker holds a constant pixel
distance from the route path line rather than a fixed lat/lng point, so as the user zooms
out the marker visually drifts farther and farther from the road it belongs to. Zoomed in,
the marker sits correctly on the stop; zoomed all the way out, the path may render over
California while the marker appears over Washington. This is purely a visual/rendering bug —
the underlying coordinates are correct — but it makes users believe the optimized stop
location has changed.
The markers are rendered in
Map.tsx. The legacy Marker icon anchor is set
around Map.tsx:682-696, with a
fallback branch ({ url: iconUrl }) that supplies no anchor, and the icon
scaledSize/anchor depend on getMarkerScaledSize() returning a value
(Map.tsx:32-35). A missing or incorrect
anchor is the most likely cause of the marker not staying locked to its coordinate across
zoom levels — confirm during investigation.
Goal
Each stop marker stays visually pinned to its geographic location and the route path at every
zoom level.
Reproduction
Steps
- Run an optimization and open the results page with a route shown on the map.
- Observe a stop marker sitting correctly on the path at the default/zoomed-in level.
- Zoom the Google Map all the way out.
Expected: The marker stays anchored to its lat/lng on (or immediately adjacent to) the
route path at all zoom levels.
Actual: The marker keeps a fixed pixel gap from the path, so when zoomed out it appears
far from the road — e.g. path over California, marker over Washington — implying the location
changed.
Environment: main branch; results page map (@react-google-maps/api, Advanced Markers);
reproducible regardless of OS/browser.
Scope
In scope
- Fix marker anchoring so stop markers track their geographic coordinate across all zoom
levels in Map.tsx.
- Ensure both the normal and fallback icon branches (with and without
scaledSize) set a
correct anchor.
Out of scope
- Depot marker styling, hover overlay behavior
(MapStopHoverOverlay.tsx), and
edit-mode dragging logic.
- Any change to the optimization output / coordinate data itself.
Acceptance Criteria
Assign
@KesarSidhu
Description
On the results page, the route stop markers on the Google Map do not stay pinned to their
geographic location when the map zoom level changes. The marker holds a constant pixel
distance from the route path line rather than a fixed lat/lng point, so as the user zooms
out the marker visually drifts farther and farther from the road it belongs to. Zoomed in,
the marker sits correctly on the stop; zoomed all the way out, the path may render over
California while the marker appears over Washington. This is purely a visual/rendering bug —
the underlying coordinates are correct — but it makes users believe the optimized stop
location has changed.
The markers are rendered in
Map.tsx. The legacy
Markericon anchor is setaround Map.tsx:682-696, with a
fallback branch (
{ url: iconUrl }) that supplies noanchor, and the iconscaledSize/anchor depend ongetMarkerScaledSize()returning a value(Map.tsx:32-35). A missing or incorrect
anchor is the most likely cause of the marker not staying locked to its coordinate across
zoom levels — confirm during investigation.
Goal
Each stop marker stays visually pinned to its geographic location and the route path at every
zoom level.
Reproduction
Steps
Expected: The marker stays anchored to its lat/lng on (or immediately adjacent to) the
route path at all zoom levels.
Actual: The marker keeps a fixed pixel gap from the path, so when zoomed out it appears
far from the road — e.g. path over California, marker over Washington — implying the location
changed.
Environment:
mainbranch; results page map (@react-google-maps/api, Advanced Markers);reproducible regardless of OS/browser.
Scope
In scope
levels in Map.tsx.
scaledSize) set acorrect anchor.
Out of scope
(MapStopHoverOverlay.tsx), and
edit-mode dragging logic.
Acceptance Criteria
maximum zoom levels (bug no longer reproduces via the steps above).
scaledSize) anchor the marker correctly.Assign
@KesarSidhu