show date/time for georeferenced photos (#9990)

This commit is contained in:
Kyℓe Hensel
2023-12-07 00:08:13 +13:00
committed by GitHub
parent 04b9554a57
commit c976b9f7f4
2 changed files with 12 additions and 2 deletions

View File

@@ -85,6 +85,10 @@
padding: 4px 2px;
z-index: 10;
}
.photo-attribution-dual {
display: flex;
justify-content: space-between;
}
.photo-attribution a,
.photo-attribution a:visited,

View File

@@ -64,7 +64,7 @@ export function svgLocalPhotos(projection, context, dispatch) {
viewerEnter
.append('div')
.attr('class', 'photo-attribution fillD');
.attr('class', 'photo-attribution photo-attribution-dual fillD');
return planePhotoFrame.init(context, viewerEnter)
.then(planePhotoFrame => {
@@ -84,6 +84,11 @@ export function svgLocalPhotos(projection, context, dispatch) {
const attribution = viewerWrap.selectAll('.photo-attribution').text('');
if (image.date) {
attribution
.append('span')
.text(image.date.toLocaleString());
}
if (image.name) {
attribution
.append('span')
@@ -233,7 +238,8 @@ export function svgLocalPhotos(projection, context, dispatch) {
getSrc: () => readFileAsDataURL(file),
file: file,
loc: [exifData.longitude, exifData.latitude],
direction: exifData.GPSImgDirection
direction: exifData.GPSImgDirection,
date: exifData.CreateDate || exifData.DateTimeOriginal || exifData.ModifyDate,
};
loaded.push(photo);
const sameName = _photos.filter(i => i.name === photo.name);