Skip to content

Conversation

@Cynamide
Copy link
Contributor

@Cynamide Cynamide commented Mar 27, 2025

Resolves #213 and #222

I know someone else is already working on it but thought I should try it anyways. Let me know if the map is intuitive to use.
Also, I bumped up the location of map just below the video so its easier to use with the video playing. The map is by default static for easy scrolling. Users can click on any path on the map to jump to that location. Also drag the marker for finer control. Both these cases will make the map interactive. A small icon on the top left which will make the map static/dynamic.

image

@github-actions
Copy link

github-actions bot commented Mar 27, 2025

Changes:

path lines diff
./components/RoutePathMap.tsx 203 +203
./components/RouteDynamicMap.tsx 50 +50
./map/index.ts 11 -31
./components/RouteStaticMap.tsx 0 -67

Total lines: 4576 (+155)

@github-actions
Copy link

github-actions bot commented Mar 27, 2025

deployed preview: https://255.connect-d5y.pages.dev

Welcome to connect! Make sure to:

  • read the contributing guidelines
  • mark your PR as a draft until it's ready to review
  • post the preview on Discord; feedback from users will speedup the PR review

Mobile

Desktop

@sshane
Copy link
Contributor

sshane commented Mar 29, 2025

The dragging of the car is pretty cool! Can we smoothly interpolate the position like old connect does?

Peek.2025-03-29.00-15.mp4

@incognitojam incognitojam added the enhancement new feature or request label Mar 29, 2025
@Cynamide
Copy link
Contributor Author

Thank you so much @incognitojam

@Cynamide
Copy link
Contributor Author

Right now, I am not interpolating the points and fully relying on the marker CSS to do the work for me with way less code. Let me know if interpolating looks necessary ( when the map is fully zoomed in, the marker is small enough to be between points where you can make out the grey and purple lines distinctly updating before marker moves).

Also found a little bug where map doesn't reload when a different route is selected. Will work on that.

@TheSecurityDev
Copy link

TheSecurityDev commented Mar 30, 2025

I like how the map is closer to the video, and how the route is darker for the past history. I may have to steal that for my PR #224. I also have the same issue with interpolation, but it's something that could be implemented if necessary, it just makes it a bit more complex.

Only thing I would suggest is making the car icon a bit smaller like mine, and improving the transition when seeking, since it's panning the map without updating the route immediately.

@Cynamide
Copy link
Contributor Author

Thats right, even after adding interpolation, there is still a need for smooth css transitions which is why I removed interpolation completely.
You are welcome to use my code for your PR. Also, yeah I'm working on adding cases where we would not need the CSS/panning transitions.

@Cynamide
Copy link
Contributor Author

Cynamide commented Mar 30, 2025

The reason I'm keeping a bigger icon is so that you cant see the purple and grey paths updating their positions behind the icon. also locked the max zoom-in for the map so that the icon doesn't become small enough to see this update. Looks like I'm all done now.

@TheSecurityDev
Copy link

The reason I'm keeping a bigger icon is so that you cant see the purple and grey paths updating their positions behind the icon. also locked the max zoom-in for the map so that the icon doesn't become small enough to see this update. Looks like I'm all done now.

Can't you have the division always right in the center and follow the icon smoothly?

@TheSecurityDev
Copy link

Also kind of curious, I just noticed you referenced pull request 212, which doesn't really seem relevant. Perhaps you meant #222?

@Cynamide
Copy link
Contributor Author

The reason I'm keeping a bigger icon is so that you cant see the purple and grey paths updating their positions behind the icon. also locked the max zoom-in for the map so that the icon doesn't become small enough to see this update. Looks like I'm all done now.

Can't you have the division always right in the center and follow the icon smoothly?

I could, but the problem is the polyline is updated instantly instead of having an animation like the marker. I'd have to calculate the points separately each time. I'll see if leaflet allows for animating polylines too. That should really fix it.

@Cynamide
Copy link
Contributor Author

Also kind of curious, I just noticed you referenced pull request 212, which doesn't really seem relevant. Perhaps you meant #222?

Oh right my bad. Thanks for pointing it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement new feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show real-time replay location in map

4 participants