Skip to content

Conversation

@bwees
Copy link
Member

@bwees bwees commented Aug 30, 2025

Description

Map defaults to a zoom level 12.5 on the new "Manage locations" tool when no location is set. This is caused by the zoom level check only checking if the value is undefined and not if its also 0.

Result of the incorrect behavior is it looks like the map is broken (Lat/Lng of 0,0 is the middle of the ocean) see pic below:

image

This pr changes the check to be for both 0 and undefined (just checks truthiness of the value) in order to determine zoom level.

Result:

image

How Has This Been Tested?

Tested on latest webUI

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if applicable
  • I have no unrelated changes in the PR.
  • I have confirmed that any new dependencies are strictly necessary.
  • I have written tests for new code (if applicable)
  • I have followed naming conventions/patterns in the surrounding code
  • All code in src/services/ uses repositories implementations for database calls, filesystem operations, etc.
  • All code in src/repositories/ is pretty basic/simple and does not have any immich specific logic (that belongs in src/services/)

Copy link
Member

@danieldietzler danieldietzler left a comment

Choose a reason for hiding this comment

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

I am kind of willing to blame weird metadata for this, but it's probably fine. Just feels a bit inconsistent to me (why would one lat result in a different zoom level than a different lat?)

@bwees
Copy link
Member Author

bwees commented Aug 30, 2025

The reason this exists is so when no location is set (0,0), it is initially showing an overview of the entire globe that you can then zoom in and set the location instead of first having to zoom out and then move the map. Then once the location is set, it starts zoomed in so you get a more detailed view of where the pin is dropped.

@alextran1502 alextran1502 merged commit b337206 into main Aug 30, 2025
57 of 58 checks passed
@alextran1502 alextran1502 deleted the fix/location-tool-map-zoom branch August 30, 2025 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants