-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
feat(web): Map in albums & shared albums #17906
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason you cannot reuse the existing map?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean ? I use the <Map ... />
object on line 127 in album-map.svelte
,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh sorry I assumed we had more logic from the map +page.svelte
in the map component, but apparently we don't. That's kinda ugly, but not your problem then 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see... I've taken a lot from /map
logic. Sorry for this ugly code 🤦♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was saying that how the map page currently is built is ugly lol.
@@ -32,6 +33,8 @@ | |||
|
|||
let { isViewing: showAssetViewer } = assetViewingStore; | |||
|
|||
let isInMapView = $state(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you help refactoring this boolean state to a AlbumMapViewManager
global state class? It will look nicer because we will not use props drilling and binding.
You can see an example here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
working on it. I've tried something, but not tested yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be good 👌
|
||
onDestroy(() => { | ||
abortController?.abort(); | ||
abortController?.abort(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, done !
* add btn, map and marker * Fix bug in navigation assetviewer * Correct bug on main Viewer * Add to user album the map of his pictures * change icon to outline * lint & format * with manager instead of variable * remove duplicate * chore: minor styling change * formatting --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
Description
The goal of this PR is to add a map in albums and shared albums so that a user receiving a link can quickly locate the photos.
This is ideal for sharing a trip without needing to check the location of each photo individually.
To do this, I added a map button in
/albums
and/share
.When clicked, a modal window opens with a map showing markers for photos/videos.
Clicking on a marker allows viewing them just like in the
/map
page.To implement this change, a new component
album-map.svelte
was created, takingalbum
andisInMapView
as arguments.The second property was useful because there are two
AssetViewer
instances, and they were interfering with each other, causing unintended behaviors.Following this idea, I also added the same variable to
asset-grid.svelte
.How Has This Been Tested?
I tested that viewing photos in the album still works, as well as viewing them on the map.
I also verified that a shared album with hidden metadata does not display any location information.
Additionally, no extra photos are shown: only the photos associated with a marker are displayed.
npm run lint
npm run format
npm run check:svelte
npm run check:typescript
npm run test
Screenshots
Checklist:
src/services/
uses repositories implementations for database calls, filesystem operations, etc.src/repositories/
is pretty basic/simple and does not have any immich specific logic (that belongs insrc/services/
)