Repository navigation
AB#730 Convert TileLayerContainer to a function component - #6065
Conversation
Create the Leaflet GridLayer directly instead of extending react-leaflet's GridLayer, and use useLeaflet/useConfigContext/useRouter instead of wrapper components. The layer is now removed on unmount, and the popup class is computed per render so 'vehicle-popup' no longer leaks to later popups. Extract sendSelectionAnalytics and rewrite the unit tests accordingly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use optional chaining, share the parking hub filtering between the click handler and popup rendering, derive the vehicle popup flag from the target layer, and read the current time with useCurrentTime instead of withCurrentTime. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
# Conflicts: # app/component/map/tile-layer/TileLayerContainer.jsx
|
Very strange behavior happened while testing: Search route ie Tram 15 and select it. See the route line and rendered vehicle icons This happens with every route I tested, couldn't verify the issue in production. |
I tested this cause it might've been my recent changes to the mapLayer context but couldnt reproduce (using this branch or v3), can you verify if this happens in v3/dev or just this branch |
|
NVM, it seemed a bug because of selected location and selected routes showed strange looking results, but when investigating further it works as intended. I tested with 2 different routes and Near you (with specific location), but it works as intended. Just looked odd :D |
Proposed Changes
TileLayerContainerfrom a class component to a function component, using theuseLeafletanduseCurrentTimehooksvehicle-popupclassName leaking to later popupsshowSpinner, bogus popup options)Pull Request Check List
Review