Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maintains zoom level and centers active pins #2219 #2236

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

whitneywind
Copy link
Member

Fixes #2219

  • These changes update the flyTo function so that it keeps the zoom level consistent with the user's current zoom level instead of reverting back to the original zoom level
  • They also calculate the longitude and latitude offsets as needed to keep the pins centered in the visible part of the map
desktopscreenrecording10-7.mov
mobilescreenrecording10-7.mov

@fancyham
Copy link
Collaborator

fancyham commented Oct 7, 2024

Looks nice!

I can’t see the code changes that you made, but hopefully nothing is hardcoded and the locations and pans and everything are being calculated dynamically based on the visible map area? ( which is tricky because the text panel can be different sizes and the user can adjust the panel size manually)

Please also test that it works correctly with all map/text panel splits on mobile and with all screen sizes!

The one situation that I’m thinking of here is where the user is on mobile and has adjusted the split screen so that the map is 80% of the screen and the text panel is 20%. Does the map centering also work there?

If it does, then this looks good to me and I’d say push as fast as possible to public if @Shienny1 doesn’t find any problems.

@whitneywind
Copy link
Member Author

whitneywind commented Oct 7, 2024

@fancyham That's a good point! Right now it doesn't account for a user manually adjusting the panel sizing after they make a search. Zooming will still work fine but the centering could be off in that case. I'll update it to factor in the panel size when calculating the long. and lat. offsets.

@whitneywind
Copy link
Member Author

@fancyham Okay, so it does stay horizontally centered no matter what. The vertical positioning doesn't change on mobile when the text panel is pulled down. Is that the desired behavior? Or should the pin and visible map area also move vertically when the text panel is pulled up and down?

@fancyham
Copy link
Collaborator

fancyham commented Oct 8, 2024

It'd be amazing if adjusting the map's percentage of the screen kept the center of the map centered dynamically as the user adjusts the split. The zoom level stays the same. Would that be possible? Sounds hard but I think that's what a user would ideally want to happen.

This would help users keep track of what they're looking at, rather than be confused by the pin they're looking at getting covered up by the text panel they just increased the size of, then having to manually pan the map to find the pin again.

@whitneywind
Copy link
Member Author

@fancyham Please let me know if I'm understanding correctly! So the vertical centering should change with the panel resizing, unlike it is now? If so, the only problem I see is that the map area would need to change with each adjustment in order to keep the pin centered. And since the user is probably manually moving around the map when it's 80% of the screen, if they moved to a different area and then adjust the panel, the map scrolling up and changing to account for that might be confusing.

Right now it's the same as it is on my mobile yelp app or google maps app, where if they move the panel up or down the map position stays the same to help the user stay oriented.

Copy link
Member

@entrotech entrotech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell, this is working really well! Tried various zoom levels, and various ways of causing the panning (typing in the address box, clicking on map pins, selecting a listing from the list box), and it all seems to work really well. I think it might be kind of jarring for the user to pan the map as the user drags the drag bar up and down on mobile or opens/closes the side drawer on desktop.

@entrotech entrotech merged commit 3b6f7fb into develop Oct 8, 2024
@entrotech entrotech deleted the wg-2219-map-panning branch October 8, 2024 21:49
@fancyham
Copy link
Collaborator

fancyham commented Oct 9, 2024

Good points! I think the map dynamically keeping things centered is perhaps too clever for its own good, and yes, it could be visually jarring. Knowing that Apple and Google don’t do it are great datapoints.

This is good to push! Thanks!

@fancyham
Copy link
Collaborator

fancyham commented Nov 17, 2024

BTW, I found an example of the ‘automatically zoom to keep what you were looking at on-screen even as you change the viewport’ idea we were discussing above inside Uber’s app.

It looks tricky to implement but quite useful — in this case, a trip to an airport — so it keeps that full route on-screen by shrinking or expanding it as needed, meaning that I’m comforted in knowing that Uber hasn’t forgotten the route I’ve been working on (imagine what it’d fee like if the map didn’t zoom… people trust what they can see, so if something important goes off-screen, that can be a problem):

RPReplay_Final1728934051.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Serious Bug: Map - Mobile map pans incorrectly when viewing an organization
3 participants