Bug 399034 - Pictures are not centered in the map
Summary: Pictures are not centered in the map
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Geolocation-GoogleMaps (show other bugs)
Version: 7.5.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-24 19:16 UTC by MarcP
Modified: 2022-01-31 17:23 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 7.6.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description MarcP 2018-09-24 19:16:27 UTC
SUMMARY

When selecting one or more pictures with geographical coordinates, and using the "Map" view on the top, the map is not centered on the selected pictures. Instead, it might show some location used previously.


STEPS TO REPRODUCE
1. Select pictures with GPS coordinates.
2. Open the Map view.


EXPECTED RESULT

The map should show the location of the pictures.


ACTUAL RESULT

The maps shows some location, and the user must move and zoom the map until he finds those pictures.

SOFTWARE VERSIONS
digiKam-6.0.0-beta1-20180920T204303-Win64.exe in Windows 10 64 bit.
Comment 1 Maik Qualmann 2018-09-24 19:35:56 UTC
The map shows all images of the album, whether they are selected or not does not matter. It should actually be just a look at the images as they may be distributed worldwide. For what you want is the map in the right sidebar thought.

Maik
Comment 2 MarcP 2018-09-24 19:44:08 UTC
I usually navigate pictures through Tags (but also Albums, and Dates). Actually, when I select an album or a tag, and click on "Map" view, only the pictures on the current selection are displayed on the map. Same for the Thumbnail, Preview and Table views, that show only the pictures in the current selections. By selection I mean the Album or Tag (or Search or Date) that is selected, not the individual pictures within.

But my complaint is that these pictures that are displayed on the map are not centered by default. As an example, imagine I've been browsing pictures of new york in the map view. Then I change to another album with geotagged pictures of Paris, and click on the Map view again. The map will still show New York (with the level of zoom I left it), instead of showing the new album on the map. You have to manually zoom out, find where the marker for the pictures are, and zoom in there.
Comment 3 Maik Qualmann 2018-09-25 06:51:15 UTC
Another example, the map also shows images from a virtual search, the first image is from New York, all others from Paris. The map would jump to New York, too, not really right... I mean to remember that we had bug reports that the map should just save the last position and zoom level. I'm going to search...

Maik
Comment 4 MarcP 2018-09-25 18:23:05 UTC
In the case a virtual search shows pictures from more than one location, I think it should zoom out until all markers are shown.
Comment 5 MarcP 2019-06-13 23:51:29 UTC
A similar issue is present when using the right map panel. The picture location is not updated until another picture is clicked while the panel is open.

I've recorded two short clips, one showing the bug with the top map view, and another one for the lateral right map panel. They can be watched here: https://imgur.com/a/JEblJIk
Comment 6 caulier.gilles 2020-08-01 14:30:45 UTC
digiKam 7.0.0 stable release is now published and now available as FlatPak:

https://www.digikam.org/news/2020-07-19-7.0.0_release_announcement/

We need a fresh feedback on this file using this version.

Thanks in advance

Gilles Caulier
Comment 7 MarcP 2020-08-01 15:16:31 UTC
This bug is still present.
Comment 8 MarcP 2022-01-21 18:29:19 UTC
Hi. Sorry to be a bother about this again. I have been using the map feature today, and I noticed this behavior still existed.

The map on the right panel works fine (it pans and zooms to show the selected picture(s)), but the map on the central panel does not. Shouldn't they behave the same way?

Again, I apologize for being insistent and thanks for your time.
Comment 9 caulier.gilles 2022-01-21 18:35:31 UTC
Hi Marc,

It still present with 7.5.0 ? This is what you mean ?

No problem to ping again about bugs. I prefer to see users alive instead to see user to post a report and become mute until the end of the world.

I currently process a mass bugs triage, and a lots of entries still here without feedback.

Gilles
Comment 10 MarcP 2022-01-21 18:43:15 UTC
Yes, it's still present in the stable 7.5 appimage.

When you click on an album or a tag while in the map view, the map view does not center and zooms too the pictures coordinates, it remains where it was centered (and zoomed) last time.
Comment 11 caulier.gilles 2022-01-21 18:51:32 UTC
Agree. Map from right sidebar is auto centered with current icon view selection.

The central view is never centered.

Gilles
Comment 12 caulier.gilles 2022-01-21 18:53:10 UTC
This is fully non dependant of the map backend used, not only Googlemaps.

Tested under MacOS with 7.6.0 pre-release.

Gilles
Comment 13 caulier.gilles 2022-01-21 19:09:28 UTC
Maik, 

I take a look to the differences between map view from right sidebar and the central view map, and map sidebar has this call to re-center the map on items :

https://invent.kde.org/graphics/digikam/-/blob/master/core/libs/properties/geolocation/itempropertiesgpstab.cpp#L447

This is exactly what we need, as API doc explain :

https://invent.kde.org/graphics/digikam/-/blob/master/core/utilities/geolocation/geoiface/widgets/mapwidget.cpp#L2327

... and of course, the central view do not have this call when album contents is assigned to the map :

https://invent.kde.org/graphics/digikam/-/blob/master/core/app/views/stack/mapwidgetview.cpp#L184

Note : The map sidebar has a boolean flag to indicate when the map need to be centered :

https://invent.kde.org/graphics/digikam/-/blob/master/core/libs/properties/geolocation/itempropertiesgpstab.cpp#L120

A similar mechanism need to be done in central view.

What do you think about ?

Gilles
Comment 14 Maik Qualmann 2022-01-21 21:00:44 UTC
The MapWidgetView::openAlbum() function is always called with a NULL pointer as album. The only call is here and makes no sense:

https://invent.kde.org/graphics/digikam/-/blob/master/core/app/views/stack/itemiconview_albums.cpp#L174

The central map view uses the current item model. Ok, I center the map when it becomes active, this should do the trick.

Maik
Comment 15 Maik Qualmann 2022-01-21 21:08:52 UTC
Git commit b454652d233404a8936ee519f602ed5ca85970aa by Maik Qualmann.
Committed on 21/01/2022 at 21:07.
Pushed by mqualmann into branch 'master'.

center central Map Widget to items when it becomes active

M  +5    -0    core/app/views/stack/mapwidgetview.cpp

https://invent.kde.org/graphics/digikam/commit/b454652d233404a8936ee519f602ed5ca85970aa
Comment 16 caulier.gilles 2022-01-21 21:27:30 UTC
Hum the patch is not enough.

If you have more than one album with different shot locations, switch between album do not change the map zoom/focus.

For ex, if album has item from US and another one from EU, Switching between album from left sidebar must change the map to make all items visible. If an album as both (US+EU locations), the map must zoom forward to make all items as visible. This is what's i see from the right sidebar map when i change icon view selection with different location. 

Gilles
Comment 17 Maik Qualmann 2022-01-21 21:39:07 UTC
Git commit a825d693b321af0b42e56e0c1a0e4847c85311e0 by Maik Qualmann.
Committed on 21/01/2022 at 21:38.
Pushed by mqualmann into branch 'master'.

cleanup dead code

M  +1    -7    core/app/views/stack/itemiconview_albums.cpp
M  +15   -23   core/app/views/stack/mapwidgetview.cpp
M  +0    -1    core/app/views/stack/mapwidgetview.h

https://invent.kde.org/graphics/digikam/commit/a825d693b321af0b42e56e0c1a0e4847c85311e0
Comment 18 Maik Qualmann 2022-01-21 22:42:21 UTC
Git commit b6ae3da092e9514d63ff7603b05e159cac951ad6 by Maik Qualmann.
Committed on 21/01/2022 at 22:40.
Pushed by mqualmann into branch 'master'.

check if the model has been changed

M  +35   -0    core/app/views/stack/mapwidgetview.cpp
M  +4    -0    core/app/views/stack/mapwidgetview.h

https://invent.kde.org/graphics/digikam/commit/b6ae3da092e9514d63ff7603b05e159cac951ad6
Comment 19 Maik Qualmann 2022-01-21 22:48:20 UTC
@Gilles, Please test if it works correctly now.

Maik
Comment 20 Maik Qualmann 2022-01-21 22:57:41 UTC
Git commit 0645e206c639e375c34ec9d7836dd4886518ed3f by Maik Qualmann.
Committed on 21/01/2022 at 22:56.
Pushed by mqualmann into branch 'master'.

this signal is better

M  +3    -3    core/app/views/stack/mapwidgetview.cpp

https://invent.kde.org/graphics/digikam/commit/0645e206c639e375c34ec9d7836dd4886518ed3f
Comment 21 Maik Qualmann 2022-01-22 07:39:02 UTC
Git commit 75ce84b5b8e7846391e61b2b944a9e4a4e663f54 by Maik Qualmann.
Committed on 22/01/2022 at 07:37.
Pushed by mqualmann into branch 'master'.

only center the map for new selected items
FIXED-IN: 7.6.0

M  +29   -28   core/app/views/stack/mapwidgetview.cpp

https://invent.kde.org/graphics/digikam/commit/75ce84b5b8e7846391e61b2b944a9e4a4e663f54
Comment 22 MarcP 2022-01-25 16:25:43 UTC
Hi, today I tried the latest appimage and that feature now works perfectly, thanks!

Just one little aesthetic issue. When there is no geolocation information in the current selection, now the map points to the 0,0 coordinates (the Atlantic ocean near Africa). Maybe the map could show a message saying "No geolocation information available", or be greyed out and stay at the same location. Similar to what happens in the right panel. The user experience would be more polished.
Comment 23 caulier.gilles 2022-01-25 16:44:51 UTC
Hi Marc,

You are right, the central view must have the same behavior than right side panel.

Gilles
Comment 24 Maik Qualmann 2022-01-26 07:37:10 UTC
For the sidebar, the text that no geolocations information is available is fine. I would not like such an empty area for the map in the center. We should set the whole earth view as coordinates and zoom level and disable the view.

Maik
Comment 25 Maik Qualmann 2022-01-28 22:47:05 UTC
Git commit f98695bb3727f7bebd40179ed5981dfe5fb26b6f by Maik Qualmann.
Committed on 28/01/2022 at 22:46.
Pushed by mqualmann into branch 'master'.

disable map and zoom to full earth view

M  +52   -13   core/app/views/stack/mapwidgetview.cpp

https://invent.kde.org/graphics/digikam/commit/f98695bb3727f7bebd40179ed5981dfe5fb26b6f
Comment 26 Maik Qualmann 2022-01-28 22:48:17 UTC
I don't really like it at the moment. Feedback and ideas welcome.

Maik
Comment 27 MarcP 2022-01-31 16:44:41 UTC
(In reply to Maik Qualmann from comment #26)
> I don't really like it at the moment. Feedback and ideas welcome.
> 
> Maik

I think it's ok as it is now. How do other programs do when you select a picture without geo information?
Comment 28 caulier.gilles 2022-01-31 17:06:25 UTC
Hi Marc,

Which program exactly ?

Gilles
Comment 29 MarcP 2022-01-31 17:23:12 UTC
I don't know, Lightroom, Microsoft Photos, The Photos app for Apple, Picasa, for instance. I'll have a look if I have some time later.